var timer = 0;
function applyBg(){
if(document.getElementById("readMore1")){	
	document.getElementById("header").style.background = "url(images/header.jpg) top no-repeat";
	document.getElementById("downloadAtag").style.background = "url(images/download.png) top no-repeat";
	document.getElementById("readMore1").style.background = "url(images/more.gif) bottom no-repeat";
	document.getElementById("readMore2").style.background = "url(images/more.gif) bottom no-repeat";/**/
}
	//alert(document.getElementsByTagName("DIV")[0].id);
	divObjs = document.getElementsByTagName("DIV");
	divObjs[0].innerHTML="";
	document.body.style.paddingRight = "0px";
	timer = setTimeout("removeTable()",3000);
}

	
function removeTable(){
	clearTimeout(timer)
	tables = document.getElementsByTagName("TABLE")
	//alert("removing tables");
	for(i=0; i<tables.length; i++){
		//document.body.removeChild(tables[i]);
		//tables[i].innerHTML = "";
		for(j=0; j<tables[i].childNodes.length; j++){
			tables[i].removeChild(tables[i].childNodes[j]);
		}
	}

}




function getContents(type){
	type=="home"?document.getElementById("footerlinks").style.display="none":document.getElementById("footerlinks").style.display="block";
	document.getElementById("midCont").innerHTML = '<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><div style="text-align:center"><img src="images/loading.gif" alt="Loading" /></div><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var url="getcontents.asp"
	url=url+"?page="+type;
	xmlHttp.onreadystatechange=fetchData;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	/**/
}

function fetchData ()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		alert(xmlHttp.responseText);
		//root = xmlHttp.responseXML.documentElement;

			/*dates = root.getElementsByTagName("Date");
			for(i=0;i<dates.length;i++){
				dates[i].firstChild?arrDate[i]=dates[i].firstChild.nodeValue:arrDate[i]="";
				root.getElementsByTagName("To")[i].firstChild?arrTo[i]=root.getElementsByTagName("To")[i].firstChild.nodeValue:arrTo[i]="";
				root.getElementsByTagName("Event")[i].firstChild?arrEvent[i]=root.getElementsByTagName("Event")[i].firstChild.nodeValue:arrEvent[i]="";
				root.getElementsByTagName("Description")[i].firstChild?arrDesc[i]=root.getElementsByTagName("Description")[i].firstChild.nodeValue:arrDesc[i]="";
			}
			hlight = root.getElementsByTagName("Highlight");
			for(i=0; i<hlight.length; i++){
				hlight[i].firstChild?arrHlight[i]=hlight[i].firstChild.nodeValue:arrHlight[i]="";
			}
*/
		//document.getElementById("midCont").innerHTML = root.firstChild.nodeValue;
		document.getElementById("midCont").innerHTML = xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}