var intLinkTimeoutID = 0;
		
function startCountDown()
{
	var id = window.setInterval(setCountDown,1000);
}

function setCountDown()
{
	var dteEvent = new Date(2008, 4, 17, 0, 0, 0);
	var dteNow = new Date();
	var intResult = parseInt((dteEvent - dteNow) / 1000);
	var strCountDown = "";

	//calculate the days.
	var intDays = parseInt(intResult/86400)
	intResult = intResult - (intDays*86400);

	var intHours = parseInt(intResult / 3600)
	intResult = intResult - (intHours*3600);

	var intMins = parseInt(intResult / 60)
	intSecs = intResult - (intMins*60)

	if(intResult > 0){
	    varCountDown = String(intDays) + "D " + String(intHours) + "H " + String(intMins) + "M " + intSecs + "s";
	}else{
	    varCountDown = "Zero";
	}

	if("string" == typeof CountDown.innerText)
	{
	    CountDown.innerText = varCountDown;
	}
	else if("string" == typeof CountDown.textContent)
	{
	    CountDown.textContent = varCountDown;
	}
}

function ShowDate()
{
	var s = "";
	var d = new Date();
	if(d.getDate() < 10) s += "0";
	s += d.getDate() + "/";                   	//Get day
	if((d.getMonth() + 1) < 10) s += "0";
	s += (d.getMonth() + 1) + "/";            	//Get month
	s += d.getFullYear();   					//Get year.
	document.write(s)
	return s;
}

function AddFavorite()
{
	window.external.AddFavorite("http://www.danumrally.co.uk", "Danum Rally");
}
			
function ShowMenu(strDiv){
	HideAllMenu();
	document.all(strDiv).style.visibility = 'visible';
	intLinkTimeoutID = window.setTimeout("HideMenu('" + strDiv + "');", 2000);
}
function HideMenu(strDiv){
	document.all(strDiv).style.visibility = 'hidden';	
}
function HideAllMenu(){
	HideMenu("Links");
	HideMenu("Results");
}
function LoadPage(strSrc){
	//frames['BodyFrame'].location.href = strSrc
	//document.getElementById('BodyFrame').src = strSrc
	window.navigate(strSrc);
	return false;
}
function Nifty()
{
    if(!NiftyCheck())
    {
        return;
    }
    else
    {
        Rounded("div#DivEvent","#FFFFFF","#FFFDC4");
        Rounded("div#DivMain","#FFFFFF","#FFFDC4");
    }
}

function OpenWindow(strImage)
{   
    var x;
    try
    {
	    window.event.returnValue = '';
	}
	catch(e){}
	x = window.open(strImage);
}