// ActionScript Document

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Sandeep Gangadharan :: http://www.sivamdesign.com/scripts/ */

function formatTime() {
  now = new Date();
  hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();

    if (min <= 9) {
      min = "0" + min;
    }
    if (sec <= 9) {
      sec = "0" + sec;
    }
    if (hour > 12) {
      hour = hour - 12;
      add = " p.m.";
    } else {
      hour = hour;
      add = " a.m.";
    }
    if (hour == 12) {
      add = " p.m.";
    }
    if (hour == 00) {
      hour = "12";
    }

    document.form1.sivam.value = ((hour<=9) ? "0" + hour : hour) + ":" + min + ":" + sec + add;
    setTimeout("formatTime()", 1000);
}

function getdate(){
 var now = new Date()
 days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
 "Friday", "Saturday");
  months = new Array("January","February", "March", "April", "May","June", "July", "August","September","November","December"); 
 //document.form1.date.value=days[now.getDay()]+", "+months[now.getMonth()]+" "+now.getDate()+" "+now.getFullYear() ;
 document.write (days[now.getDay()]+", "+months[now.getMonth()]+" "+now.getDate()+" "+now.getFullYear()) ;
}

