////////////// Rollovers
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


///////////// Countdown
function countdown(year, month, day, hour, minute, dayId, timeId)
{
	var dayHtml = document.getElementById(dayId);
	var timeHtml = document.getElementById(timeId);

	Today = new Date();
	Todays_Year = Today.getFullYear() - 2000;
	Todays_Month = Today.getMonth();

	//Convert both today's date and the target date into miliseconds.                           
	Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
	Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
	Target_Date = (new Date(year, month - 1, day, hour, minute, 00)).getTime();                  

	//Find their difference, and convert that into seconds.                  
	Time_Left = Math.round((Target_Date - Todays_Date) / 1000);

	//dayHtml.innerHTML = Time_Left;

	days = Math.floor(Time_Left / (60 * 60 * 24));
	Time_Left %= (60 * 60 * 24);
	hours = Math.floor(Time_Left / (60 * 60));
	Time_Left %= (60 * 60);
	minutes = Math.floor(Time_Left / 60);
	Time_Left %= 60;
	seconds = Time_Left;

	if (days < 0 && hours < -3)
	{
		dayHtml.innerHTML = "Results to come";
		//alert(1);
	}
	else {
		if (Time_Left < 0)
			Time_Left = 0;

		//dps = 's'; hps = 's'; mps = 's'; sps = 's';
		dps = ' days'; hps = ''; mps = ''; sps = '';

		if (hours < 10) hours = "0" + hours;
		if (minutes < 10) minutes = "0" + minutes;
		if (seconds < 10) seconds = "0" + seconds;

		if (days > 0)
		{
			dayHtml.innerHTML = days + dps + ' ';
			//alert(2);
		} else {
			dayHtml.innerHTML = "Today";
			//alert(3);
		}
		if (hours + minutes + seconds > 0)
		{
			dayHtml.innerHTML += hours + hps + ':';
			dayHtml.innerHTML += minutes + mps + ':';
			dayHtml.innerHTML += seconds + sps + ' ';
			//alert(4);
			/*
			timeHtml.innerHTML = hours + hps + ':';
			timeHtml.innerHTML += minutes + mps + ':';
			timeHtml.innerHTML += seconds + sps + ' ';
			*/
		} else {
			//timeHtml.innerHTML = "Right Now!";
			dayHtml.innerHTML += " Right Now!";
			//alert(5);
		}

		//Recursive call, keeps the clock ticking.
		setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',\'' + dayId + '\',\'' + timeId + '\');', 1000);
	}
}