function pubblicaAnnuncio(foto,categoria,testo,autore,risposta,destinatarioNotifica,destinatario) {  
setTimeout('leggiAnnunci()',3000);
function crea_oggetto_req() {   
    var req = false;   
    if (typeof XMLHttpRequest != "undefined")   
        req = new XMLHttpRequest();   
    if (!req && typeof ActiveXObject != "undefined") {   
        try {   
            req=new ActiveXObject("Msxml2.XMLHTTP");   
        } catch (e1) {   
            try {   
                req=new ActiveXObject("Microsoft.XMLHTTP");   
            } catch (e2) {   
                try {   
                    req=new ActiveXObject("Msxml2.XMLHTTP.4.0");   
                } catch (e3) {   
                    req=null;   
                }   
            }   
        }   
    }   
  
    if(!req && window.createRequest)   
        req = window.createRequest();   
  
    if (!req) alert("Il browser non supporta AJAX");   
  
    return req;   
}   
  
// l'oggetto per comunicare con il server   
//var http_req = crea_oggetto_req();

   
var http_req = crea_oggetto_req();   
// invia i dati del form al server
  testo=encodeURIComponent(testo);
  categoria=encodeURIComponent(categoria);
  if(testo!="" && categoria!=""){
	var dati_post = "annuncio="+testo+"&categoria="+categoria+"&foto="+foto+"&autore="+autore+"&risposta="+risposta+"&destinatarioNotifica="+destinatarioNotifica+"&destinatario="+destinatario; 
	
	http_req.open('GET', 'new/inc/pubblicaAnnuncio.asp?' + dati_post, true);   
    //http_req.onreadystatechange = gestisci_risposta;
	http_req.send(null);
	//alert(dati_post)
	document.getElementById('annuncio').value="";
	document.getElementById('categoria').value="";	
}
else
{
window.alert('Per pubblicare l\' annuncio devi compilare sia il campo categoria che il campo annuncio. Grazie');
}


}