// ------------------------------------------------------ 
// $Id: xmlhttp.js,v 1.2 2005/07/27 06:38:57 Brian Exp $
// ------------------------------------------------------ 

var xmlhttp = null;
var agt=navigator.userAgent.toLowerCase();
var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

/*@cc_on @*/ //Conditional compilation
/*@if (@_jscript_version >= 5)
	try {
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	} catch (e) {
		try {
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	} catch (E) {
		xmlhttp = null;
	}
} @else {
	xmlhttp = null;
}
@end @*/

if (xmlhttp == null) {
	try {
		if (is_gecko)
		{
		   xmlhttp = new XMLHttpRequest();
		}
		else 
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	} catch (e) {
		xmlhttp = null;
	}
}

function getXMLData(url, methodToCallAfterLoading, method) {
	window.document.body.style.cursor = "wait";
		for (var j=0; j<11; j++) {
		}
	if (!method) method = "GET";
	xmlhttp.open(method, url, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState == 4) {
			document.body.style.cursor = 'auto';
			if (methodToCallAfterLoading != null) {
				methodToCallAfterLoading(xmlhttp.responseText);
			}
		}
	}
	xmlhttp.send(null);
}
