var watchID = null
var watchRun = false 
function stopwatch(){
  if(watchRun) 
    clearTimeout(watchID)
  watchRun = false
} 
function startwatch(){
  stopwatch()
  dayTime()
} 
function dayTime() {
  day = new Date();
  hour = day.getHours();
  minute = day.getMinutes();
  second = day.getSeconds();
  if (hour > 12) 
     { hours = hour - 12;
       part  = 'PM';
	}
  else 
     { part = 'AM';
      if (hour == 0) 
         { hours = 12 }
      else 
         { hours = hour }
     } 
  if (minute < 10) 
     {minutes = 0}
  else 
     {minutes = ""} 
  if (second < 10) 
     {seconds = 0}
  else 
     {seconds =""}
  date   = ('' + (day.getDate())+"/"+(day.getMonth()+1)+ "/"+day.getYear()+ '');
  time   = ('' + hours + ":"+minutes+""+minute+ ":"+seconds+""+second+ '')
  parts  = ('' +  part+ '')
  document.timedate.time.value   = time
  document.timedate.date.value   = date
  document.timedate.parts.value  = parts
  watchID = setTimeout("dayTime()",1000)
  watchRun = true
}
