// loadstatus.js
// Author: http://www.realizecreations.com
// loads the server status using AJAX, XML, XSLT generating XHTML segment
// (Sounds so cool!)


function LoadStatus()
{
	ReallyLoadStatus();
	setInterval("ReallyLoadStatus()", 5000);
}

function ReallyLoadStatus()
{
	var xmlHttp = GetXMLHttp();
	if(!xmlHttp) return; // cannot initialize object
	
	xmlHttp.onreadystatechange=function()
	{
		var info = document.getElementById("info");
		
		switch(xmlHttp.readyState)
		{
		case 0: // The request is not initialized
			break;
		case 1: // The request has been set up 
			break;
		case 2: // The request has been sent
			break;
		case 3: // The request is in process
			break;
		case 4: // The request is complete
			info.innerHTML = xmlHttp.responseText;
			break;
		}
	}
	
	xmlHttp.open("GET", "loadstatus.php?nocache="+(Math.random()*11), true);
	xmlHttp.send(null);
	return false; // dun go refresh page
}

LoadStatus();