/* Create a new XMLHttpRequest object to talk to the Web server */
function getXMLHttp() {

	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();
	}

	return xmlHttp;

}

function ajaxGet( url, onReadyEventHandler ) {
	var xmlHttp = arguments[2] ? arguments[2] : getXMLHttp();
	
	xmlHttp.open( "GET", url, true );
	xmlHttp.onreadystatechange = onReadyEventHandler;
	xmlHttp.send( null );
}

function ajaxPost(url, params, onReadyEventHandler) {
	var xmlHttp = arguments[3] ? arguments[3] : getXMLHttp();
	
	xmlHttp.open( "POST", url, true );
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = onReadyEventHandler;
	xmlHttp.send( params );
}

