function getXmlConn()
{
	var xmlhttp;
	if(window.XMLHttpRequest)
	{
		try
		{ xmlhttp = new XMLHttpRequest(); }
		catch(e){ xmlhttp = false; }
	}
	else if(window.ActiveXObject)
	{
		try
		{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch(e)
		{
			try
			{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch(e2){ xmlhttp = false; }
		}
	}
	else{ xmlhttp = false; alert("No XMLHTTP!"); }
	return xmlhttp;
}

function changePage(divDest,destURL)
{
	tempVar = divDest;
	xmlhttp = getXmlConn();
	if(xmlhttp == false)
	{ return; }
	
	var destFinal = "http://"+window.location.hostname+window.location.pathname+destURL;
	xmlhttp.onreadystatechange=pageChanged;
	xmlhttp.open("GET",destURL);
	xmlhttp.setRequestHeader('Content-Type','text/xml');
	//xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlhttp.send(null);
}

function pageChanged()
{
	if(xmlhttp.readyState==4)
	{
		if(xmlhttp.status == 200 || xmlhttp.status == 0)
		{
			//alert("returned with status: "+xmlhttp.status+"\n"+xmlhttp.responseText);
			document.getElementById(tempVar).innerHTML = xmlhttp.responseText;
			return false;
		}
		else
		{
			alert("There was an error fetching the page: "+xmlhttp.status+"\nIf this error persists please contact the site administrator.");
			return false;
		}
	}
}
