function update_date() {
	var months=new  Array(13);
	months[1]="JAN";
	months[2]="FEB";
	months[3]="MAR";
	months[4]="APR";
	months[5]="MAY";
	months[6]="JUN";
	months[7]="JUL";
	months[8]="AUG";
	months[9]="SEP";
	months[10]="OCT";
	months[11]="NOV";
	months[12]="DEC";
	var time=new Date();
	var lmonth=months[time.getMonth() + 1];
	var ddate=new Array(31);
	ddate[1]="01";
	ddate[2]="02";
	ddate[3]="03";
	ddate[4]="04";
	ddate[5]="05";
	ddate[6]="06";
	ddate[7]="07";
	ddate[8]="08";
	ddate[9]="09";
	ddate[10]="10";
	ddate[11]="11";
	ddate[12]="12";
	ddate[13]="13";
	ddate[14]="14";
	ddate[15]="15";
	ddate[16]="16";
	ddate[17]="17";
	ddate[18]="18";
	ddate[19]="19";
	ddate[20]="20";
	ddate[21]="21";
	ddate[22]="22";
	ddate[23]="23";
	ddate[24]="24";
	ddate[25]="25";
	ddate[26]="26";
	ddate[27]="27";
	ddate[28]="28";
	ddate[29]="29";
	ddate[30]="30";
	ddate[31]="31";
	var theday=new Array(6);
	theday[0]="SUN";
	theday[1]="MON";
	theday[2]="TUE";
	theday[3]="WED";
	theday[4]="THU";
	theday[5]="FRI";
	theday[6]="SAT";
	
	var date=ddate[time.getDate()];
	var year=time.getYear();
	var day=theday[time.getDay()];
	if (year < 2000)   
	year = year + 1900;
	
	
	document.getElementById('td_month').innerHTML = lmonth;
	document.getElementById('td_date').innerHTML = date;
	document.getElementById('td_day').innerHTML = day;

};

function clock()  {
var digital = new Date();
var hhours=new Array(23);
hhours[0]="00";
hhours[1]="01";
hhours[2]="02";
hhours[3]="03";
hhours[4]="04";
hhours[5]="05";
hhours[6]="06";
hhours[7]="07";
hhours[8]="08";
hhours[9]="09";
hhours[10]="10";
hhours[11]="11";
hhours[12]="12";
hhours[13]="13"
hhours[14]="14"
hhours[15]="15"
hhours[16]="16"
hhours[17]="17"
hhours[18]="18"
hhours[19]="19"
hhours[20]="20"
hhours[21]="21"
hhours[22]="22"
hhours[23]="23"


var hours = hhours[digital.getHours()];
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;



document.getElementById('td_hours').innerHTML = hours;
document.getElementById('td_minutes').innerHTML = minutes;
setTimeout("clock()", 1000);
};
function init() {
    clock();
    update_date();
}
window.onload=init;

