var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject() {

// lista delle variabili locali
var
 // variabile di ritorno, nulla di default
 XHR = null,
 
 // informazioni sul nome del browser
 browserUtente = navigator.userAgent.toUpperCase();


 // browser standard con supporto nativo
 // non importa il tipo di browser
 if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
  XHR = new XMLHttpRequest();

 // browser Internet Explorer
 // ่ necessario filtrare la versione 4
 else if(
  window.ActiveXObject &&
  browserUtente.indexOf("MSIE 4") < 0
 ) {
 
  // la versione 6 di IE ha un nome differente
  // per il tipo di oggetto ActiveX
  if(browserUtente.indexOf("MSIE 5") < 0)
   XHR = new ActiveXObject("Msxml2.XMLHTTP");

  // le versioni 5 e 5.5 invece sfruttano lo stesso nome
  else
   XHR = new ActiveXObject("Microsoft.XMLHTTP");
 }

 return XHR;
}

/*
function process() {
	
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0 )
		{
			name = encodeURIComponent ( document.getElementById("myName").value);
			xmlHttp.open ("GET","quickstart.php?name=" + name, true);
			
			xmlHttp.send(null);
		}
		else 
			setTimeout ('process()', 1000 );
}
function handleServerResponse(){

	if (xmlHttp.readyState == 4 ) {
		if (xmlHttp.status == 200 ) {
			xmlResponse = xmlHttp.responseXML;
			xmlDocumentElement = xmlResponse.documentElement;
			helloMessage = xmlDocumentElement.firstChild.data;
			document.getElementById("divMessage").innerHTML = helloMessage;
			setTimeout('process()',1000);
		}
		
		else {
			alert("C'รจ stato un problema nell'accesso al server: " + xmlHttp.statusText);
		}
	}
} */

