/*** XMLHttpRequest Routines **/

var XMLHttp;

function sendRequest(url)
{
	XMLHttp = getXMLHttp();
	XMLHttp.open("GET",url);
	XMLHttp.onreadystatechange=handlerFunk;
	XMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	XMLHttp.send(null);
}

function handlerFunk(){
	if(XMLHttp.readyState == 4){
		var xml = XMLHttp.responseXML;
		var text = XMLHttp.responseText;
		nextstep(xml, text);
	}
}

function getXMLHttp()
{
  var XMLHttp = null;
  if (window.XMLHttpRequest) {
    try {
      XMLHttp = new XMLHttpRequest();
    } catch (e) { }
  } else if (window.ActiveXObject) {
    try {
      XMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) { }
    }
  }
  return XMLHttp;
}

function getLatestCount()
{
	sendRequest("totalCount.php");
}

function nextstep(xml, text)
{
	document.getElementById('totalCount').innerHTML = text;
}
