// JavaScript Document : A date script

function makeMonthArray()
       {
	    this.length = 12;
		this[1] = "January";
		this[2] = "February";
		this[3] = "March";
		this[4] = "April";
		this[5] = "May";
		this[6] = "June";
		this[7] = "July";
		this[8] = "August";
		this[9] = "September";
		this[10] = "October";
		this[11] = "November";
		this[12] = "December";
		return (this);	   
	   }
	   
   function makeDayArray()
       {
	    this.length = 7;
		this[1] = "Sunday";
		this[2] = "Monday";
		this[3] = "Tuesday";
		this[4] = "Wednesday";
		this[5] = "Thursday";
		this[6] = "Friday";
		this[7] = "Saturday";
		return (this);
	   }	   


  function showDate()
    {
	  monthName = new makeMonthArray();
	  dayName = new makeDayArray();
	  
	   myDate  = new Date();
	   myday   = myDate.getDay() +1 ;
	    date   = myDate.getDate();
	   myMonth = myDate.getMonth() + 1;
	   myYr    = myDate.getFullYear();
	  

	  datestr = dayName[myday];
	  datestr += "   ";
	  datestr += monthName[myMonth];
	  datestr += ", ";
	  datestr += date;
	  datestr += "  ";
	  datestr += myYr;
	  
	  document.write(datestr);
	
	}

function startTime()
{
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
var s=today.getSeconds()
// add a zero in front of numbers<10
m=checkTime(m)
s=checkTime(s)
document.getElementById('txt').innerHTML=h+":"+m+":"+s
t=setTimeout('startTime()',500)
}

function checkTime(i)
{
if (i<10) 
  {i="0" + i}
  return i
}