var gClockMonth = null;
var gClockDay = null;
var gClockTime = null;

function linkMenuSelect(a_Menu)
{
	var idx = a_Menu.selectedIndex;
	var theURL = a_Menu.options[idx].value;
	if (theURL != "")
		window.location = theURL;
}

function fixForIE()
{
	//alert(navigator.userAgent);
	if (navigator.userAgent.indexOf("MSIE") > 0)
	{
		var theHeader = document.getElementById("header");
		theHeader.style.position = "absolute";
		var theMenu = document.getElementById("sidebarcontainer");
		theMenu.style.position = "absolute";
		theMenu.style.width = "150px";
	}
}

function clockStart()
{
	setInterval(clockTick, 10000);
	clockTick();
}

function clockTick()
{
	if (gClockMonth == null)
		gClockMonth = document.getElementById("clockmonth");
	if (gClockDay == null)
		gClockDay = document.getElementById("clockday");
	if (gClockTime == null)
		gClockTime = document.getElementById("clocktime");
		
	var theTime = new Date();
	
	var theMonth = theTime.getMonth();
	switch (theMonth)
	{
		case 0:
			theMonth = "January";
			break;
		case 1:
			theMonth = "February";
			break;
		case 2:
			theMonth = "March";
			break;
		case 3:
			theMonth = "April";
			break;
		case 4:
			theMonth = "May";
			break;
		case 5:
			theMonth = "June";
			break;
		case 6:
			theMonth = "July";
			break;
		case 7:
			theMonth = "August";
			break;
		case 8:
			theMonth = "September";
			break;
		case 9:
			theMonth = "October";
			break;
		case 10:
			theMonth = "November";
			break;
		case 11:
			theMonth = "December";
			break;
	}
	gClockMonth.innerHTML = theMonth
	
	gClockDay.innerHTML = padNumber(theTime.getDate());
	gClockTime.innerHTML = padNumber(theTime.getHours()) + ":" + padNumber(theTime.getMinutes());
}

function padNumber(a_Num, a_Width)
{
	if (a_Num.toString().length == 1)
		return "0" + a_Num;
	return a_Num;
}
