var isNetscape	= (document.layers);
var isOpera	= (document.getElementById);
var isIE	= (document.all);
var TotalListStyle;
var MonthListStyle;
var TotalIsVisible = 0;
var MonthIsVisible = 0;


function InitRankings()
{
	if (isNetscape)
	{
		TotalListStyle = document.TotalList;
		MonthListStyle = document.MonthList;
	}
	else if (isOpera)
	{
		TotalListStyle = document.getElementById("TotalList").style;
		MonthListStyle = document.getElementById("MonthList").style;
	}
	else if (isIE)
	{
		TotalListStyle = TotalList.style;
		MonthListStyle = MonthList.style;
	}
	TotalListStyle.left=580;
	TotalListStyle.top=170;
	MonthListStyle.left=780;
	MonthListStyle.top=170;
}

function ShowMenu(MenuName)
{
	if (MenuName == "total")
	{
		TotalListStyle.visibility='visible';
		TotalIsVisible	=	1;
		MonthListStyle.visibility='hidden';
		MonthIsVisible	=	0;
	}
	else
	{
		MonthListStyle.visibility='visible';
		MonthIsVisible	=	1;
		TotalListStyle.visibility='hidden';
		TotalIsVisible	=	0;
	}
}

function HideMenus()
{
	if (MonthIsVisible != 2)
	{
		MonthListStyle.visibility='hidden';
		MonthIsVisible	=	0;
	}
	if (TotalIsVisible != 2)
	{
		TotalListStyle.visibility='hidden';
		TotalIsVisible	=	0;
	}
}
function PreserveMenu(MenuName)
{
	if (MenuName == "total")
	{
		TotalIsVisible	=	2;
	}
	else
	{
		MonthIsVisible	=	2;
	}
}
function KillMenu(MenuName)
{
	if (MenuName == 0)
	{
		TotalListStyle.visibility='hidden';
		TotalIsVisible	=	0;
	}
	else
	{
		MonthListStyle.visibility='hidden';
		MonthIsVisible	=	0;
	}
}


var dn = "";
var old = "";

function InitCountdown(time)
{
if (document.all || document.getElementById)
{
	document.write('<span id="checkincountdown"></span>');
}
else if (document.layers)
{
	document.write('<ilayer id="checkincountdown"><layer id="checkincountdown"></layer></ilayer>');
}
	countdown(time);
}

function countdown(timeleft)
{
	if (document.layers)
		document.checkincountdown.visibility="show"
	if (old == "die") {
		return;
	}

	var days =  Math.floor((timeleft / 60) / 60 / 24);
	var hours =  Math.floor((timeleft / 3600) % 24);
	var minutes =  Math.floor((timeleft / 60) % 60);
	var seconds = timeleft % 60;

	if (minutes <= 9)
	{
		minutes = "0"+minutes;
	}
	if (seconds <= 9)
	{
		seconds = "0"+seconds;
	}

	dmyclock = '<div align="center"><b>Starting in:</b> '+days+' days and '+hours+':'+minutes+':'+seconds+'</div>';

	if (old == "true")
	{
		document.write(dmyclock);
		old = "die";
		return;
	}

	if (document.layers) {
		dcpos = document.checkincountdown;
		checkincountdown = dcpos.document.dliveclockns;
		checkincountdown.document.write(dmyclock);
		checkincountdown.document.close();
	}
	else if (document.all)
	{
		checkincountdown.innerHTML = dmyclock;
	}
	else if (document.getElementById)
	{
		document.getElementById("checkincountdown").innerHTML = dmyclock;
	}
	setTimeout("countdown("+timeleft+" - 1)",1000);
}