﻿function clock(){
	var oDate = new Date();
	var nDate = oDate.getDate();
	var sMonth = GetMonth(oDate.getMonth());
	var sDay = GetDayName(oDate.getDay());
	var nYear = oDate.getFullYear();
		
    //var sRet = sDay + ", " + nDate + " " + sMonth + " " + nYear;

    var sRet = sDay + ", " + nDate + " " + sMonth;

	
	var oTime = "";
	
	if (oDate.getHours() < 10)
	    oTime += "0";
	    
	oTime += oDate.getHours() + ":";
	
	if (oDate.getMinutes() < 10)
	    oTime += "0";
	    
	oTime += oDate.getMinutes() + ":";
	
	if (oDate.getSeconds() < 10)
	    oTime += "0";
	    
	oTime += oDate.getSeconds();
	    		
	if(document.getElementById("clock")) {
		document.getElementById("clock").innerHTML = sRet
		document.getElementById("clock").title = sRet + " - " + oTime;
	}
	
	setTimeout("clock()",1000);
		
} 

function GetMonth(nMonth){
	var aMonth = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
	return aMonth[nMonth];
}

function GetDayName(nDay){
    var aDay = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
	return aDay[nDay];
}