var xmlHttp; // this function initializes the xmlHttp variable in a cross browser fashion

function createXMLHttpRequest() {   

	if (window.ActiveXObject) {        
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");   
	} else if (window.XMLHttpRequest) {       
		xmlHttp = new XMLHttpRequest();     
	}  

} // this function initiates the Ajax request (cycle) by first initializing the xmlHttp object // that contains the request and response, setting its main properties and sending the request

function sendxml(url) {   
	createXMLHttpRequest();   // specify (callback) function to handle response  
	xmlHttp.onreadystatechange = handleStateChange;  // GET or POST, what is the URL, Asynch or Synch  
	xmlHttp.open("GET",url+Math.random(), true);   
	xmlHttp.send(null); 

	//setTimeout('startRequest()', 10000);
} // the callback function that is called upon any change in the state of the xmlHttp object.// Note: these state changes occur at various times during the Http request/response cycle.

function handleStateChange() {
	var xmlresult="";
	if ( xmlHttp.readyState == 4) {      
		if (xmlHttp.status == 200) {         
			xmlresult = xmlHttp.responseText;
			if (xmlresult!="" && xmlresult.length>0) {
				alert(xmlresult)
			}
		}   
	} 
}


var str_wait = '<img src="/images/img_wait.gif" align=absmiddle>';

_this = XHRequest.prototype;
function XHRequest(){}
_this.getObject = function() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else {
		alert("XML HTTP Request support cannot be found!");
		return null;
	}
}