function changeContent(pageName,divId)
{	
	if(divId)
		new loadXmlHttp(pageName,divId);
	else
		new loadXmlHttp(pageName,'dynamicDiv');

}

function loadXmlHttp(pageName,divId)
{	
	var f = this;
	f.xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		 f.xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		 {
			f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		 }
		 catch (e)
		 {
			 f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		 }
	 }



	if (f.xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url="ajax/getPageContents.php";
	url=url+"?page="+pageName;
	url=url+"&sid="+Math.random();
	f.el=document.getElementById(divId);
        //f.innerHTML = '<table><tr><td><img src="../images/loading.gif"></td></tr></table>';
        
	f.xmlHttp.onreadystatechange=function(){f.stateChanged();};
	f.xmlHttp.open("GET",url,true);
	f.xmlHttp.send(null);
	
}


loadXmlHttp.prototype.stateChanged=function () 
{
	if (this.xmlHttp.readyState==4)
	{
			this.el.innerHTML = this.xmlHttp.responseText;

	}


}



function changeImage(imgLocation,imgName)
{
	document.getElementById(imgLocation).src='images/'+imgName;
}

