//ajax functions
//xmlhttp.js

//Function to create XMLHttp Object
function getxmlhttp(){
	//create a boolean variable to check for a valid MS ActiveX Instance
	var xmlhttp = false;
	
	//check if we are using IE
	try{
		//If the Javascript version is greater than 5
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		//if not, then use the older ActiveX Object
		try{
			//If we are using IE
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			//Else we must be using non-IE browser
			xmlhttp = false;
		}
	}
	
	//if we aren't using IE, create a Javascript instance of the object
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

//Function to process an XMLHttp Request
function processajax(obj, serverPage){
	//Get an XMLHttpRequest object for use
	var theimg;
	xmlhttp = getxmlhttp();
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			document.getElementById(obj).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}