

function showCommentiBlog(id, np){

	r=Math.random();

	_url="commentiblog.php?cosa=lista&id="+id+"&numpag="+np+"&ran="+r;


	httpRequest("GET", _url, true, handleResponseCom);

}





function sendFormBlog(id){


	nome=document.getElementById('nomeCom').value;


	messaggio=document.getElementById('messaggio').value;
	email=document.getElementById('emailCom').value;

	messaggio=messaggio.replace(/\r\n/g,"BiErrE");
	messaggio=messaggio.replace(/\r/g,"BiErrE");
	messaggio=messaggio.replace(/\n/g,"BiErrE");


	messaggio=encodeURIComponent(messaggio);


	nome=encodeURIComponent(nome);


	document.getElementById('formCommenti').innerHTML="<br><br><br> &nbsp; &nbsp; invio in corso...<br><br><br><br><br><br><br>";


	_url="commentiblog.php";
	_data="cosa=invia&id="+id+"&messaggio="+messaggio+"&nome="+nome+"&email="+email;


	httpRequest("POST", _url, true, handleResponseCom, _data);
}






function handleResponseCom(){

	if (request.readyState==4){
		if (request.status==200){
			var mex=request.responseText;

	document.getElementById('divCommenti').innerHTML=mex;
		} else {
			alert ("Problema di connessione");
		}
	} 
}



function eliminaCommento(c, b){
	document.location.href='blog.php?id='+b+'&eliminacommento='+c;

}



