var salt='&Rand='+parseInt(Math.random()*99999999); // or salt = 1;  
var async = true; // async = is an asynchronous XML request
var callBackExpression;
var myXHR = getXHRequest();

function getXHRequest() {
	var req;
	try { req = new XMLHttpRequest() } catch (e) {
		try { req = new ActiveXObject("Msmxl2.XMLHttp") } catch (e2) {
			try { req = new ActiveXObject("Microsoft.XMLHTTP") } catch (e3) {
				req = false;
			}
		}
	}
	return req;
}

function AJAXRequest(requestType, url, query, postVariables, callBackExpression) {
	
	myXHR.onreadystatechange = function() {
		if ((myXHR.readyState==4) && (myXHR.status==200)) { eval(callBackExpression); }
	}

	myXHR.open(requestType,(url + '?' + query + salt),async);
	if (requestType=='GET') { postVariables = null; } 
	else {
		myXHR.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		myXHR.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		myXHR.setRequestHeader("Content-length", postVariables.length);
		myXHR.setRequestHeader("Connection", "close");
		//Send the proper header information along with the request
	}
	// alert("Posting: " + postVariables);
	myXHR.send(postVariables);
	
}

