// JavaScript Document

var opened;

var days = {0:'Sunday',1:'Monday',2:'Tuesday',3:'Wednesday',4:'Thursday',5:'Friday',6:'Saturday'};
var months = {0:'January',1:'February',2:'March',3:'April',4:'May',5:'June',6:'July',7:'August',8:'September',9:'October',10:'November',11:'December'};

Event.observe ( window, 'load', showtime);

function showtime() {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
		var dayoftheweek = now.getDay();
		var month = now.getMonth();
		var dayofthemonth = now.getDate();
		var year = now.getFullYear();
        var timeValue = days[dayoftheweek] + ', ';
		timeValue += months[month] + ' ' + dayofthemonth + ', '; 
		timeValue += year + ' | '; 
		timeValue += ((hours < 10) ? '0' + hours : hours);
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
        $('top_main_text').update(timeValue);
        timerID = setTimeout("showtime()",1000);
}
