/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
	try {
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e2) {
			xmlHttp = false;
		}
	}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
{	xmlHttp = new XMLHttpRequest();
}



function callServer(openURL, responseFunction, useGet, postQueryString)
{	/*	Default is to POST the request.
	*/

	var d = new Date();
	openURL = openURL + '&ieCache=' + d.getTime();

	if (useGet)
	{
		xmlHttp.open("GET", openURL, true);
		xmlHttp.onreadystatechange = responseFunction;
		xmlHttp.send(null);

	}else
	{
		var urlParts = /^(.*?)\?(.*)$/.exec(postQueryString);
		var params = urlParts[2];
		xmlHttp.open("POST", openURL, true);
		xmlHttp.onreadystatechange = responseFunction;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
	}

}

