var xmlhttp

function loadXMLDoc(url) {
   // codice per Mozilla, etc.
   if (window.XMLHttpRequest) {
      xmlhttp=new XMLHttpRequest()
      xmlhttp.onreadystatechange=xmlhttpChange
      xmlhttp.open("GET",url,true)
      xmlhttp.send(null)
   }
   // codice per  IExplore
   else if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
      if (xmlhttp) {
         xmlhttp.onreadystatechange=xmlhttpChange
         xmlhttp.open("GET",url,true)
         xmlhttp.send()
      }
   }
}

function xmlhttpChange() {
   // if xmlhttp shows "loaded"
   if (xmlhttp.readyState==4) {
      // if "OK"
      if (xmlhttp.status==200) {
         document.getElementById('cookies').innerHTML = xmlhttp.responseText;
      }
      else {
         alert("Impossibile ricevere i dati")
      }
   }
}