// JavaScript Document

function pageLoad()
{
	//getAd();	
}

var hidemenu = "";


function buttonOver(button)
{
	with(document)
	{
	getElementById(button).style.backgroundImage = "url(images/button_over.jpg)";
	getElementById(button).style.cursor = 'pointer';
	}
	reveal(button);
}

function buttonOut(button)
{
	document.getElementById(button).style.backgroundImage = "url(images/button.jpg)";
	hide("clubs");
}

function featureOver(button)
{
	document.getElementById(button).style.backgroundImage = "url(images/feature_over.jpg)";
}

function featureOut(button)
{
	document.getElementById(button).style.backgroundImage = "url(images/feature.jpg)";
}

function clubOver(button, theId)
{
	with(document)
	{
		getElementById("menu_1").style.visibility = "hidden";
		getElementById(theId).style.backgroundColor = "#666666";
		getElementById(theId).style.cursor = 'pointer';
	}
	reveal(button);
}

function clubOut(button, theId)
{
	with(document)
	{
		getElementById(theId).style.backgroundColor = "#333333";
		//body.style.cursor = 'default';
	}
	hide(button);
}

function linkClick(button, theName)
{
	window.location = theName;
}

function reveal(menu)
{
	clearTimeout(hidemenu);
	if(menu == "clubs") document.getElementById("menu_1").style.visibility = "visible";
	else hide("clubs");
}

function hide(menu)
{
	clearTimeout(hidemenu);
	if(menu == 'clubs') hidemenu = setTimeout("hide2('clubs');",1000);
}

function hide2(menu)
{
	if(menu == "clubs") document.getElementById("menu_1").style.visibility = "hidden";
}

function clearTimer(menu)
{
	clearTimeout(hidemenu);
}





// random ad generator
var ad_array = new Array
(
	Array("banner01.gif", "http://www.monicawhite.com" ),
	Array("banner02.jpg", "http://www.944.com" ),
	Array("banner03.jpg", "http://www.dreamcarrentals.com" )
)


function getAd()
{
	var theNumber = Math.floor(Math.random()*ad_array.length);
	with(document)
	{
	getElementById("theAd").src = "images/" +  ad_array[theNumber][0];
	getElementById("banner_URL").href = ad_array[theNumber][1];
	getElementById("banner_URL").target = "_blank";
	}
	//alert(theNumber);
}