function getXMLHTTP(){
//Create a boolean variable to check for valid IE instance.
var xmlhttp = false;
//Check for IE
try{
	//If JS version is > 5
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){
	//If not use old activeX
	try{
		//If we are using IE version < 5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
	catch(e){
		//Else using non IE browser
		xmlhttp = false;}
}

//If non IE create JS instance of object
if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
	xmlhttp = new XMLHttpRequest();}

return xmlhttp;
}

function processAjax(serverPage, getOrPost, obj, str, loading_img){
	xmlhttp = getXMLHTTP();
	if(getOrPost == "GET"){
		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readystate == 4 && xmlhttp.status == 200){
				obj.innerHTML = xmlhttp.responseText;}
		}
		xmlhttp.send(null);}
	else{
		xmlhttp.open("POST", serverPage, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
				obj.innerHTML = xmlhttp.responseText;
				if(loading_img != '') document.getElementById(loading_img).style.display = 'none';
			}
		}
		xmlhttp.send(str);
	}
}