/*
Purpose		: style page's associated li tag 
Parameters		: the parmPageIndex integer value page onload sends
Dependencies	: none
*/
function switchSelectedLiStyle(parmPageIndex)
{
	var liTag = null;
	parmPageIndex = "tourPageCorporateLi" + parmPageIndex;
	liTag = document.getElementById(parmPageIndex);
	liTag.className = "selected";
	//liTag.style.paddingLeft = "1pt";
} // End switchLiStyles()

/* This function gets called when the user select as tournament
   in one of the drop-down lists on the page
*/
function loadPage(list) 
{
	var url = list.options[list.selectedIndex].value;
	// check whether a Tournament was selected or not
	if (url != "0")
	{
		// open in new window if the link it is an outside link
		if (null != url.match('http'))
		{
			window.open(url,'new_window');
			return false;
		} // End if
		else
		{
			// inside link. open in the same window
			window.open(url, target="_top");
			return false;//open link in same browser
		} // End else
	}
	else 
	{
		//No tournament selected
		alert("Please select a tournament.");
	} // End else
} // End loadPage(l)

// HIGHLIGHT NAVIGATION ---------------------	
function extractPageName(hrefString)
	{
	        var arr = hrefString.split('/');
	        return  (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();               
	}
	
	function setActiveMenu(arr, crtPage)
	{
	        for (var i=0; i<arr.length; i++)
	        {
	                if(extractPageName(arr[i].href) == crtPage)
	                {
	                        if (arr[i].parentNode.tagName != "DIV")
	                        {
	                                arr[i].className = "selected";
	                                arr[i].parentNode.className = "selected";
	                        }
	                }
	        }
	}
	
	function setPage()
	{
	        hrefString = document.location.href ? document.location.href : document.location;
	
	        if (document.getElementById("tourPageNavCo")!=null)
	                setActiveMenu(document.getElementById("tourPageNavCo").getElementsByTagName("a"), extractPageName(hrefString));
	}