////////////////////////////////////////////////////////////////
//basic AJAX functions to load div's with certain pages
var globHeight = 0;

function doAJAX(url, div)
{
	this.stateChange.apply
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		var xmlhttp=new XMLHttpRequest();
		xmlhttp.onreadystatechange= function() { stateChange(xmlhttp, div); };
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else
	{
		// code for IE6, IE5
		var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.onreadystatechange= function() { stateChange(xmlhttp, div); };
		xmlhttp.open("GET",url,true);
		xmlhttp.send();
	}
}
function stateChange(xmlhttp, div)
{
	if (xmlhttp.readyState==4)
	{
		if(xmlhttp.status==200)
		{
			document.getElementById(div).innerHTML = xmlhttp.responseText;
			document.getElementById(div).style.height = "";
		}
		else
		{
			document.getElementById(div).innerHTML = "Sorry, an error occured. Please try again.";
		}
	}
}
