//------------------ Clock JS -------------

var clockID = null;
var clockRunning = false;

function simpleFindObj(name, inLayer) 
{
	return document[name] || (document.all && document.all[name])
	|| (document.getElementById && document.getElementById(name))
	|| (document.layers && inLayer && document.layers[inLayer].document[name]);
}


function divWrite(div, input)
{
	var div_x = simpleFindObj(div);
	input = input;
	if (div_x && div_x.innerHTML) 
	{
		div_x.innerHTML = input;
	}
	else if (div_x && div_x.document) 
	{
		div_x.document.writeln(input);
		div_x.document.close();
	}
}

function UTCDisplay(utc) {		
	divWrite("clocklayer", utc);
}

function stop()
{
	if(clockRunning) clearTimeout(clockID);
	clockRunning = false;
}

function makeGMT (day, date, month, year, hour, minute, second)
{
	if (day == 0) day = "¤é";
	else if (day == 1) day = "Mon";
	else if (day == 2) day = "Tue";
	else if (day == 3) day = "Wed";
	else if (day == 4) day = "Thu";
	else if (day == 5) day = "Fri";
	else if (day == 6) day = "Sat";
	if (month == 0) month = "Jan";
	else if (month == 1) month = "Feb";
	else if (month == 2) month = "Mar";
	else if (month == 3) month = "Apr";
	else if (month == 4)month = "May";
	else if (month == 5) month = "Jun";
	else if (month == 6) month = "Jul";
	else if (month == 7) month = "Aug";
	else if (month == 8) month = "Sep";
	else if (month == 9) month = "Oct";
	else if (month == 10) month = "Nov";
	else if (month == 11) month = "Dec";

	if (date < 10) date = ("0" + date);
	if (hour < 10) hour = ("0" + hour);
	if (minute < 10) minute = ("0" + minute);
	if (second < 10) second = ("0" + second);
	UTCDisplay(day + ", " + date + " " + month + " " + year + " - " + hour + ":" + minute + ":" + second);
}

function display() 
{
	var ltime = new Date(); 

	var UTCDay = ltime.getDay();
	var UTCDate = ltime.getDate();
	var UTCMonth = ltime.getMonth();
	var UTCYear = ltime.getFullYear();
	var UTCHours = ltime.getHours();
	var UTCMinutes = ltime.getMinutes();
	var UTCSeconds = ltime.getSeconds();
//	UTCMinutes = UTCMinutes + 4;
makeGMT (UTCDay, UTCDate, UTCMonth, UTCYear, UTCHours, UTCMinutes, UTCSeconds)

	clockID = setTimeout('display()',1000);
	clockRunning = true;
}


function tick() 
{
	stop();
	display();
}