﻿// Clock Script Generated By Maxx Blade's Clock v2.0d
// http://www.maxxblade.co.uk/clock
function timeSource(){
   //x=new Date( timeNow().getUTCFullYear(),
   //            timeNow().getUTCMonth(),
   //            timeNow().getUTCDate(),
   //            timeNow().getUTCHours(),
   //            timeNow().getUTCMinutes(),
   //            timeNow().getUTCSeconds());

   x=new Date( timeNow() );

   x.setTime(x.getTime());
   return x;
}
function timeNow(){
   return new Date();
}
function leadingZero(x){
   return (x>9)?x:'0'+x;
}
function twelveHour(x){
   if(x==0){
      x=12;
   }
   return (x>12)?x-=12:x;
}
function fixYear2(x){
   x=(x<500)?x+1900:x;
   return String(x).substring(2,4)
}
function displayTime(){
   document.getElementById('divCurrentDate').innerHTML=eval(outputDate);
   document.getElementById('divCurrentTime').innerHTML=eval(outputTime);
   setTimeout('displayTime()',1000);
}
function amPMsymbol(x){
   return (x>11)?'PM':'AM';
}
function showFilled(Value) {
  return (Value > 9) ? "" + Value : "0" + Value;
}
function StartClock24() {
  TheTime = new Date;
  document.clock.showTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("StartClock24()",1000)
}

var dayNames=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
var monthNames=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var outputDate="dayNames[timeSource().getDay()]+' '+timeSource().getDate()+' '+monthNames[timeSource().getMonth()]+' '+fixYear2(timeSource().getYear())";
var outputTime="twelveHour(timeSource().getHours())+':'+leadingZero(timeSource().getMinutes())+':'+leadingZero(timeSource().getSeconds())+' '+amPMsymbol(timeSource().getHours())";
//var outputTime="dayNames[timeSource().getDay()]+' '+timeSource().getDate()+' '+monthNames[timeSource().getMonth()]+' '+fixYear2(timeSource().getYear())+' '+':'+':'+' '+twelveHour(timeSource().getHours())+':'+leadingZero(timeSource().getMinutes())+':'+leadingZero(timeSource().getSeconds())+' '+amPMsymbol(timeSource().getHours())";

if(!document.all){ window.onload=displayTime; }else{ displayTime(); }



