function UpdateWebCams() {
  loadXMLDoc("getLastWebcam2.asp", "webcam2");
  loadXMLDoc("getLastWebcam1.asp", "webcam1");
  setTimeout("UpdateWebCams()", 60000);
}

function loadXMLDoc(url, id) {
  var xmlhttp = null;
  if (window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  if (xmlhttp != null) {
    xmlhttp.onreadystatechange = function() {state_Change(id, xmlhttp);};
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);
  } 
}

function state_Change(id, xmlhttp) {
  if (xmlhttp.readyState == 4) {
    if (xmlhttp.status == 200) {
      var webcam = document.getElementById(id);
      webcam.innerHTML = xmlhttp.responseText;
    }
  }
}

function wait(msecs)
{
  var start = new Date().getTime();
  var cur = start
  while(cur - start < msecs) {
    cur = new Date().getTime();
  }	
} 
