var xml = "";
function getPage() {
  var url = "get-timestamp.php";
  if (window.XMLHttpRequest) {
    xml = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    xml = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    alert("Your browser lacks the needed ability to use Ajax");
    return false;   
  }
  xml.onreadystatechange = processPage;
  xml.open("GET", url, true);
  xml.send("");
  setTimeout('getPage()', 5*1000);
}
 
function processPage() {
  if (xml.readyState == 4) {
    if (xml.status == 200) {
      div = document.getElementById("myclock");
      div.innerHTML = xml.responseText;
    } else {
      alert("There was a problem retrieving the XML data:\n" + xml.statusText);
    }
  }  
}    

