/* Start of Browser Specific CSS inclusion*/

var browserName = navigator.appName;
var agt = navigator.userAgent.toLowerCase();
var navPos = agt.indexOf('netscape');
var safPos = agt.indexOf('safari');
if (browserName != "Microsoft Internet Explorer")
{
	if (safPos !=-1) {
		document.write('<link rel="stylesheet" type="text/css" href="css/text/en/text_saf.css" />');
	}
	if (navPos !=-1) {
		document.write('<link rel="stylesheet" type="text/css" href="css/text/en/text_ns.css" />');
	} 
} else {
	document.write('<link rel="stylesheet" type="text/css" href="css/text/en/text.css" />');
}
/* End of Browser Specific CSS inclusion*/

// ****************MASTHEAD JAVASCRIPT*********************//

/*** global vars to keep track of menu state ***/
var menuOpen = false; //name of menu open
var overNav = false; //is the user over the nav?
var timeElapsed = 0; // var to keep track of time elapsed
var timerLength = 2000;	// length of timer


/*** turn off previous open menu ***/
function turnOffPrev()
{
	overNav = true;
	if(menuOpen)
	{
		//buttonclick(menuOpen,'close',globalBtn);
		showSub(menuOpen,false)
	}
}

/*** start the counter ***/
function startNavTimer()
{
	// comment...
	overNav = false;
	setTimeout('count()',100)

}

/*** set var so counter stops ***/
function stopNavTimer()
{
	overNav = true;
}

/*** count function - counts up to timerLength ***/
function count()
{
	timeElapsed += 100;
	// is the user still over the nav? If not, stop counting:
	if(!overNav)
	{
		if(timeElapsed < timerLength)
		{
			// call again:
			setTimeout('count()',100);
		}
		else
		{
			// got to the end, so stop counter and turn off the menu
			//reset timer:
			timeElapsed = 0;
			turnOffPrev();

		}
	}
	else
	{
		// stop counting, and reset counter:
		timeElapsed = 0;
	}
}

/*** show sub menu ***/
function showSub(el,status)
{
	linkObj = document.getElementById(el);
	list = el+"Sub";
	listObj = document.getElementById(list);
	if(status)
	{
		linkObj.className = "buttonHi";
		listObj.style.display = "block";
		listObj.style.visibility = "visible";
		menuOpen = el;
	}
	else
	{
		linkObj.className = "button";
		listObj.style.display = "none";
		menuOpen = false;
	}
}
// ****************MASTHEAD JAVASCRIPT*********************//

function popUp(url,height,width,windowName)
{
	var param = 'scrollbars=yes, height='+height+', width='+width+'';
	newwindow=window.open(url,windowName,param);
	if (window.focus) {newwindow.focus()}
	return false;
}
