var xmlHttpTime;
var clockid=0;

function initrefresh()
{
	
	timebarupdate();
}

function timebarupdate()
{
	
	xmlHttpTime=GetXmlHttpObject();
	if (xmlHttpTime==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url;
	url="includes/servertime.php?rand="+Math.random();
	xmlHttpTime.onreadystatechange=stateChanged1;
	xmlHttpTime.open("GET",url,true);
     xmlHttpTime.send(null);
	clockid=setTimeout("timebarupdate()",1000);
	
}


function stateChanged1() 
{ 
	
	
	if (xmlHttpTime.readyState==4 || xmlHttpTime.readyState=="complete")
	{ 
		
		document.getElementById("timebar").innerHTML=xmlHttpTime.responseText;
	} 
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}

