var timerID = null;
var timerRunning = false;
var tspent = 10700000000;
var tarrests = 872721;
function stopclock(){
 if(timerRunning) {
  clearTimeout(timerID);
  timerRunning = false;
 }
}
function startclock(){
 stopclock();
 showtime();
}
function separate(input) {
 var output = "";
  for (var i=0; i < input.length; i++) {
   if (i != 0 && (input.length - i) % 3 == 0) output += ",";
   output += input.charAt(i);
  }
 return output;
}
function calc(total,month,day,hours,minutes,seconds) {
 var num = 0;
 num = month * (total/12);
 num = num + (day * (total/365));
 num = num + (hours * (total/365/24));
 num = num + (minutes * (total/365/24/60));
 num = "" + Math.ceil(num + (seconds * total/365/24/60/60));
 return num;
}
function showtime(){
 var now = new Date();
 var today = now;
 var month = now.getMonth();
 var day = now.getDate();
 var hours = now.getHours();
 var minutes = now.getMinutes();
 var seconds = now.getSeconds();
 var timeValue = "" + ((hours > 12) ? hours - 12 : hours);
 timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
 timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;
 timeValue  += (hours >= 12) ? " P.M." : " A.M.";
 var spent = calc(tspent,month,day,hours,minutes,seconds);
 spent = separate(spent);
 spent = "$" + spent;
 var arrests = calc(tarrests,month,day,hours,minutes,seconds);
 arrests = separate(arrests);
 arrests = "" + arrests;
 document.clock.time.value = timeValue;
 document.clock.spent.value = spent;
 document.clock.arrests.value = arrests;
 timerID = setTimeout("showtime()",1000);
 timerRunning = true;
}