//	 AJAX Engine

function getHTTPObject() {
	if (typeof XMLHttpRequest != "undefined") {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		var arrVersions = [ "MSXML2.XMLHttp.5.0",
				"MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
				"MSXML2.XMLHttp","Microsoft.XMLHttp"
				];
		for (var i = 0; i < arrVersions.length; i++) {
			try {
				var objXmlHttp = new ActiveXObject(arrVersions[i]);
				return objXmlHttp;
			} catch (objError) {
				alert("An exception occurred in the script.");
			}
		}
	}
	throw new Error("XMLHttp object could be created.");
}

function execute(strURL) {
	if (strURL.indexOf("?") > 0)
		strURL += "&";
	else
		strURL += "?";
	var date = new Date();
	strURL += "time=" + date.toUTCString();
	document.body.style.cursor = 'wait';
	try {
		/*if(objHTTP && objHTTP.readyState != 0) {
			objHTTP.abort()
		}*/
	
		var objHTTP = getHTTPObject();
		if(objHTTP) {
			objHTTP.open("GET", strURL, true);
			objHTTP.onreadystatechange = function() {
				switch (objHTTP.readyState) {
					case 2, 3:
						document.body.style.cursor = 'wait';
						//displaying animated gif or something
						break;
					case 4:
						if (objHTTP.status != 200) {
							return false;
						}
						if (objHTTP.responseText) {
							eval(objHTTP.responseText);
						}
						objHTTP = null;
						break;
				}
				document.body.style.cursor = 'default';
			};
			objHTTP.send(null);
		}
	} catch (objError) {
		alert("Server is not available at this time to process your request.");
		//alert(objError.name + ":" + objError.message)
	}
}
// End AJAX Engine