var oBanner = new Banner("ticker", 725);

function HandleLoad()
{

	window.status = "";

	var iparmBannerPos;
	iparmBannerPos = GetMenuParm("BannerPos");

	oBanner.SetUp(oBanner, iparmBannerPos);

	if (!ie)
	{
		document.getElementById("menu1").style.top = "126px";
		document.getElementById("menu2").style.top = "126px";
		document.getElementById("content").style.top = "40px";
		Timer();
	}

	//alert(firstreel.loops);
}

function GetParm(sName)
{
	var iStart;
	var iEnd;
	var sParm;
	var sParms = location.search;

	iStart = sParms.indexOf(sName);
	if (iStart > 0)
	{
		iStart = sParms.indexOf("=",iStart) + 1;
		iEnd = sParms.indexOf("&",iStart);
		if (iEnd < iStart)
			iEnd = sParms.length;
		sParm = sParms.substring(iStart, iEnd);
		return sParm;
	}
	else
		return 0;
}

function GetMenuParm(theParm)
{
	return GetParm(theParm);
	//alert(1);
}

function menuClicked(iM)
{
	var fForm = document.fNav;

	fForm.BannerPos.value = oBanner.BannerPosition();
	if (iM == 1)
		fForm.action = "../Bowmanvillegolf/photos.html";
	else if (iM == 2)
		fForm.action = "../Bowmanvillegolf/tournaments.html";
	else if (iM == 3)
		fForm.action = "../Bowmanvillegolf/functions.html";
	else if (iM == 4)
		fForm.action = "../Bowmanvillegolf/courseinfo.html";
	else if (iM == 5)
		fForm.action = "../Bowmanvillegolf/rates.html";
	else if (iM == 6)
		fForm.action = "../Bowmanvillegolf/index.html";
	else if (iM == 7)
		fForm.action = "../Bowmanvillegolf/contactus.html";
	else if (iM == 8)
		fForm.action = "../Bowmanvillegolf/directions.html";
	else
		fForm.action = "../Bowmanvillegolf/index.html";

	fForm.submit();
}

var firstreel=new reelslideshow({
	wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
	dimensions: [790, 209], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo1.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo2.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo3.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo4.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo5.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo6.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo7.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo8.jpg"],
		["../Bowmanvillegolf/images/header/BowmanvilleGolf_Photo9.jpg"] //<--no trailing comma after very last image element!
	],
	displaymode: {type:'auto', pause:3000, cycles:100, pauseonmouseover:true},
	orientation: "h", //Valid values: "h" or "v"
	persist: true, //remember last viewed slide and recall within same session?
	slideduration: 1000 //transition duration (milliseconds)
})

var dtTimer;
var sURL = unescape(window.location.pathname);

function Timer()
{
	dtTimer = new Date();
	ShowTimer();
}

function ShowTimer()
{
	var dtClock = new Date();

	var dtDiff = (dtClock - dtTimer)/60000;
	dtDiff = 3 - Math.round(dtDiff);

	if (dtDiff <= 0)
		window.location.href = sURL;


	setTimeout("ShowTimer()",60000);
}
