// Copyright © 1999 Doug Popeney
// Created by Doug Popeney (easyjav@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
  var timerID = null
  var timerRunning = false

  function MakeArray(size) 
  {
  this.length = size;
  for(var i = 1; i <= size; i++)
  {
  this[i] = "";
  }
  return this;
  }
  function stopclock (){
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false

  }

  function showtime () {
  var now = new Date();
 
  year = new String(now.getFullYear())
 // yearLen = year.length
 // year = year.split("")
 // year = year[yearLen - 2] + year[yearLen - 1]
 // var month = now.getMonth() + 1;
  var month = now.getMonth(); 
  var date = now.getDate();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var day = now.getDay();
  Day = new MakeArray(7);
  Day[0]="Sunday";
  Day[1]="Monday";
  Day[2]="Tuesday";
  Day[3]="Wednesday";
  Day[4]="Thursday";
  Day[5]="Friday";
  Day[6]="Saturday";
 
  Month = new MakeArray(12);
  Month[0]="January";
  Month[1]="February";
  Month[2]="March";
  Month[3]="April";
  Month[4]="May";
  Month[5]="June";
  Month[6]="July";
  Month[7]="August";
  Month[8]="September";
  Month[9]="October";
  Month[10]="November";
  Month[11]="December";
  

  var timeValue = "";
  timeValue += (Day[day]) + " ";
  timeValue += (Month[month]) + " " + date + ", ";
  timeValue += year + " ";

  // Set inner text of span tag with id timeDate
  document.getElementById("timeDate").innerHTML = timeValue;

  timeValue = "";
  timeValue += ((hours <= 12) ? hours : hours - 12);
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += (hours < 12) ? "am" : "pm";
  // Set inner text of span tag with id timeTime
  document.getElementById("time").innerHTML = timeValue;

  timerID = setTimeout("showtime()",1000);
  timerRunning = true
  }
  function startclock () {
  stopclock();
  showtime()
  }
