var camImage = 'http://64.92.144.11:82/-wvhttp-01-/getoneshot';
var refreshIntervalSeconds = 5;
var secondsLeft = refreshIntervalSeconds;
var reloadCount = 24;

function startCount() {
  if (reloadCount < 1) {
     document.webCam.timer.value = "-----";
    return;
  } else {
      startClock();
      }
}


function startClock() {
  if (secondsLeft > 0) {
    if (secondsLeft < 10) {
      document.webCam.timer.value = '0' + secondsLeft;
    } else {
      document.webCam.timer.value = secondsLeft;
    }
    secondsLeft = secondsLeft - 1
    timerID = setTimeout('startClock()', 1000);
  } else {
  date = new Date();
  imageNumber = date.getTime();
  document.webCamImage.src = camImage + '?' + imageNumber;
  secondsLeft = refreshIntervalSeconds;
  reloadCount = reloadCount - 1;
  startCount();
  }
}