function showTime(){
  var now = new Date();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  //var timeValue = "" + ((hours > 12) ? hours - 12 : hours);
  var timeValue = ((hours < 10) ? '0' : '') + hours;
  timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;
  document.getElementById('clock').innerHTML = timeValue;
  timerID = setTimeout("showTime()", 1000);
  timerRunning = true;
}