// funzioni per i commenti

function ShowComm(idgioco){
	
	MetodoPost('../elabora.php', '&mode=commenta&act=showcomm&gioco=' + idgioco + '', PasteComm);

}

function PasteComm(commenti){
	
	if(commenti == "E2"){ document.getElementById('commenti').innerHTML = commenti; }
	
	if(commenti == "E1") document.getElementById('commenti').innerHTML = "<br />Non sono ancora stati scritti commenti per questo gioco.";
	else document.getElementById('commenti').innerHTML = commenti;
}

function SendComm(idgioco){
	
	msg = document.forms['frmComm'].txtareaComm.value;
	
	MetodoPost('../elabora.php', '&mode=commenta&act=sendcomm&gioco=' + idgioco +'&message='+ msg +'', ShowComm);
	
	document.forms['frmComm'].txtareaComm.value = "";
	document.forms['frmComm'].txtareaComm.disabled = true;
	document.forms['frmComm'].btnComm.disabled = true;
	document.getElementById('commenti').innerHTML = "<br />attendere qualche istante...";
	
	document.forms['frmComm'].btnComm.value = "il commento e\' stato inserito!";

}