// This could be written a LOT better!!!! - times are in milliseconds
timecount = 0;
ts = 2000;        
tsrandom = 200;  
timeend = 900000;
timeends = 3*timeend;
webcam1s = "http://webcama1.komar.org/current-half.jpg";
webcam2s = "http://webcamd2.komar.org/current-half.jpg";
webcam3s = "http://webcamb3.komar.org/current-half.jpg";
webcam1 = "http://webcama1.komar.org/current.jpg";
webcam2 = "http://webcamd2.komar.org/current.jpg";
webcam3 = "http://webcamb3.komar.org/current.jpg";
webcambreak = "http://www.komar.org/halloween/webcam/2009/hulk-break.jpg";
webcambreaks = "http://www.komar.org/halloween/webcam/2009/hulk-break-half.jpg";

function RefreshImage1(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeend) {
      image = webcambreak;
      ts = timeend;
   }
   document.images["refreshwebcam1"].src = image+tmp; 
   setTimeout("RefreshImage1(webcam1)", (ts+tsrand));
}

function RefreshImage2(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeend) {
      image = webcambreak;
      ts = timeend;
   }
   document.images["refreshwebcam2"].src = image+tmp; 
   setTimeout("RefreshImage2(webcam2)", (ts+tsrand));
}

function RefreshImage3(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeend) {
      image = webcambreak;
      ts = timeend;
   }
   document.images["refreshwebcam3"].src = image+tmp; 
   setTimeout("RefreshImage3(webcam3)", (ts+tsrand));
}

function RefreshImage1s(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeends) {
      image = webcambreaks;
      ts = timeend;
   }
   document.images["refreshwebcam1s"].src = image+tmp; 
   setTimeout("RefreshImage1s(webcam1s)", (ts+tsrand));
}

function RefreshImage2s(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeends) {
      image = webcambreaks;
      ts = timeend;
   }
   document.images["refreshwebcam2s"].src = image+tmp; 
   setTimeout("RefreshImage2s(webcam2s)", (ts+tsrand));
}

function RefreshImage3s(image) {
   timecount = timecount + ts;
   tsrand = Math.floor(tsrandom*Math.random());
   tmp = new Date();
   tmp = "?hd2009"+tmp.getTime(); 
   if (timecount>timeends) {
      image = webcambreaks;
      ts = timeend;
   }
   document.images["refreshwebcam3s"].src = image+tmp; 
   setTimeout("RefreshImage3s(webcam3s)", (ts+tsrand));
}
