var XMLHTTPREQUEST_READY_STATE_UNINITIALIZED = 0;
var XMLHTTPREQUEST_READY_STATE_LOADING       = 1;
var XMLHTTPREQUEST_READY_STATE_LOADED        = 2;
var XMLHTTPREQUEST_READY_STATE_INTERACTIVE   = 3;
var XMLHTTPREQUEST_READY_STATE_COMPLETED     = 4;

var XMLHTTPREQUEST_MS_PROGIDS = new Array(
  "MSXML2.XMLHTTP",
  "Microsoft.XMLHTTP",
  "Msxml2.XMLHTTP.7.0",
  "Msxml2.XMLHTTP.6.0",
  "Msxml2.XMLHTTP.5.0",
  "Msxml2.XMLHTTP.4.0",
  "MSXML2.XMLHTTP.3.0"
);

function GetXmlHttpObject(){
	var xmlHttp = null;

	// Create the appropriate HttpRequest object for the browser.
	if (window.XMLHttpRequest != null)
		xmlHttp = new window.XMLHttpRequest();
	else if (window.ActiveXObject != null)	{
		// Must be IE, find the right ActiveXObject.
		var success = false;
		for (var i = 0; i < XMLHTTPREQUEST_MS_PROGIDS.length && !success; i++){
			try{
				xmlHttp = new ActiveXObject(XMLHTTPREQUEST_MS_PROGIDS[i]);
				success = true;
			}catch (ex){}
		}
	}
	// Display an error if we couldn't create one.
	//if (xmlHttp == null) alert("Error in HttpRequest():\n\n" + "Cannot create an XMLHttpRequest object.");
	return xmlHttp;
}

function Passxml(url){
	return false; 
	var xmlHttp=GetXmlHttpObject();
	//if (xmlHttp==null){
		// this browser does not handle AJAX
		//alert(" this browser does not handle AJAX");
	 	//return false;
	//} 
	xmlHttp.onreadystatechange=function() {
		//alert("state=" + xmlHttp.readyState);
		if (xmlHttp.readyState == XMLHTTPREQUEST_READY_STATE_COMPLETED){ 
			// call a function with data returned
			//alert ( xmlHttp.status);
			if ( xmlHttp.status == 200 ) {
				doSomethingWithTheData(xmlHttp.responseText);
			}else{
				// set flags to indicate that this did not work
				// needs option to redo
				alert("problem communicating with server");
				Loading = false;
			}
		}
	}
	//ck = Request.ServerVariables("HTTP_COOKIE")
	xmlHttp.open("GET",url,true);
	//xmlHttp.setRequestHeader "Cookie",ck
	try{xmlHttp.send(null);}catch(e){alert("Send failed");}
	return true;
}
