var xmlHttp = getXmlHttpObject();
var obj = ''



function sendct(nome,email,nameobj,msg,code,chkmyem,objnote){
   obj=objnote;
   
    
  if (email.length > 0) {
   xmlHttp.open('GET', 'sys/sendct.php?m='+msg+'&n='+nome+'&e='+email+'&o='+nameobj+'&c='+code+'&cke='+chkmyem, true);
   xmlHttp.onreadystatechange = stateChanged_ct; 
   xmlHttp.send(null);
  } else {
    alert("il campo email non puņ essere vuoto!!");
   }   	
  
}


function stateChanged_ct() {
	
	
   if(xmlHttp.readyState == 4) {
         //Stato OK
     if (xmlHttp.status == 200) {
        var resp = xmlHttp.responseText;
                 
      if(resp) {
	
              var label = document.getElementById(obj);
       	   
             label.innerHTML =resp;
          

   		 
      }
    } else {
     alert(xmlHttp.responseText);
  }
 }
}

//funzione per abilitare Ajax, la chiamata č diversa a seconda del browser
function getXmlHttpObject()
   {
      var xmlHttp=null;
    try
      {
        //Firefox e Opera
        xmlHttp=new XMLHttpRequest();
      }
       catch(e)
      {
        //Internet Explorer
      try
       {
         xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
       catch(e)
       {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
     }
return xmlHttp;
} 

