function AddShoutPost(fo, div, tar, adre) { 
	$('shoutbutton').innerHTML = "<input type='button' onclick=\"RefreshShoutbox('"+div+"', '"+adre+"actions.php?typek=ref'); ods()\"  value='Odswiez posty' class='button'>";
	$('shoutchangebutton').innerHTML = "<input type='button' onClick=\"AddShoutPost('"+fo+"', '"+div+"', '"+adre+"actions.php?typek=add', '"+adre+"'); ods()\"  value='Wyslij' class='button'>";
		 var req = mint.Request();
			 req.onInitialization = function() { $(div).innerHTML = "Przygotowanie..."; }
             req.OnLoading = function() { $(div).innerHTML = "<center><img src='infusions/shoutbox_panel/images/load.gif'></center>"; }
             req.OnSuccess = function() { $(div).innerHTML = this.responseText; }
             req.OnError = function () { $(div).innerHTML = "Wystąpił błąd !!!"; }             
             req.SendForm(fo,tar);
}

function Edit(div, mess, shoutid, tar, adres) {
	 $(div).innerHTML = "";
	 $('shoutbutton').innerHTML = "";
		document.chatform.sm.value = mess;
	 $('shoutchangebutton').innerHTML = "<input type='button' onClick=\"AddShoutPost('shout', '"+div+"', '"+adres+"actions.php?typek=editt&shoutid="+shoutid+"', '"+adres+"'); ods()\"  value='Wyslij' class='button'>";
		 var req = mint.Request();
			 req.onInitialization = function() { $(div).innerHTML = "Przygotowanie..."; }
			 req.OnLoading = function() { $(div).innerHTML = "<center><img src='infusions/shoutbox_panel/images/load.gif'></center>"; }
             req.method = 'POST';
             req.OnSuccess = function() { $(div).innerHTML = ""; }
             req.OnError = function () { $(div).innerHTML = "Wystąpił błąd !!!"; }
             req.Send(tar, div);             
}

function RefreshShoutbox(div, tar) {
	var req =  mint.Request();	
		req.url = tar;
		req.OnSuccess = function() { $(div).innerHTML = this.responseText; }
		req.method = 'POST';
		req.OnError = function () { $(div).innerHTML = "Wystąpił błąd !!!"; }
		req.Send(tar, div);             
}

function dell(div, tar) {
	 var req = mint.Request();
		req.onInitialization = function() { $(div).innerHTML = "Przygotowanie..."; }
		req.OnLoading = function() { $(div).innerHTML = "<center><img src='infusions/shoutbox_panel/images/load.gif'></center>";  }
		req.method = 'POST';
		req.OnSuccess = function() { 
	$(div).innerHTML = this.responseText; }
		req.OnError = function () { $(div).innerHTML = "Wystąpił błąd !!!"; }
		req.Send(tar, div);
}
