var xmlHttp
var div

function progessAnimation(div){
	document.getElementById(div).innerHTML="<br /><br /><img src='images/progressAnimation.gif' />";
}
function stateChanged(){ 

	if (xmlHttp.readyState==4 ){
		if (xmlHttp.status==200) {
			document.getElementById(div).innerHTML=xmlHttp.responseText 
		}
	}
}

function GetXmlHttpObject(){
	var xmlHttp=null;

	try{
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	 // Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function da(f){
	
	if (f == "left"){
		var url="../avalon/ajax/stats.php";
		setTimeout('update("'+url+'","'+f+'")',15000);
		div = "sidebar1";
	}
}

function update(url,f)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	da(f);
}