

var http = getHTTPObject();				//	We create the HTTP Object
var datashuffle = "";					//	Store data in functions for global reference
var pipethru = "";					//	Store data to move thru the HTTP process
var fexec = "";						//	Execute function after HTTP response

function URLencode(sStr) {
	return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
}

function JSDataSubmit(tpe, theurl, datastr) {
	datastr = datastr.replace(/\+/g, '%2B');
	if(tpe=="post") {
		http.open("POST", theurl); 
		http.onreadystatechange = handleHttpResponse;
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
		http.send(datastr);
	} else {
		http.open("GET", theurl + "?" + datastr, true); 
		http.onreadystatechange = handleHttpResponse;
		http.send(" ");
	}
}
function handleHttpResponse() {
	if (http.readyState == 4) {
		if(http.status!=400) {
			datashuffle = http.responseText;
			if(fexec!="") eval(fexec);
		}
	}
}
function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}



