/* 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');
var firePos = agt.indexOf('mozilla');
if (browserName != "Microsoft Internet Explorer")
{
	if (safPos !=-1) {
		document.write('<link rel="stylesheet" type="text/css" href="arallowrez/css/text/en/text_saf_hpb.css" />');
		document.write('<link rel="stylesheet" type="text/css" href="css/common/common_saf.css" />');
	}
	else if (firePos !=-1) {	
		document.write('<link rel="stylesheet" type="text/css" href="arallowrez/css/text/en/text_ns.css" />');
		document.write('<link rel="stylesheet" type="text/css" href="css/common/common_other.css" />');
	}
	else if (navPos !=-1) {
		document.write('<link rel="stylesheet" type="text/css" href="arallowrez/css/text/en/text.css" />')
		document.write('<link rel="stylesheet" type="text/css" href="css/common/common_other.css" />');
	} 	
} 
else {	
		document.write('<link rel="stylesheet" type="text/css" href="arallowrez/css/text/en/text.css" />');
		document.write('<link rel="stylesheet" type="text/css" href="css/common/common_other.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
/*Changed to 400 from 2000*/
var timerLength = 400;	// 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";
  toggleSelects("hide");
  menuOpen = el;
 }
 else
 {
  linkObj.className = "button";
  listObj.style.display = "none";
  toggleSelects("");
  menuOpen = false;
 }
} */
/*changed for IE selectbox problem*/
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;
 }
} 


/* commented to fix X-Browser issue in Mac on 02 Nov 2006
function alterClass(el) {
	linkObj = document.getElementById(el);	
		linkObj.className = "buttonHi";
		
	
}


function revertClass (el) {
	linkObj = document.getElementById(el);	
	linkObj.className = "button";
		
}
*/
// ****************MASTHEAD JAVASCRIPT*********************//

/** Added newly for 1388 overlap issue */
/* commented to fix X-Browser issue in Mac on 02 Nov 2006
function toggleSelects(param)
{
 
 for(x=0;x<document.forms.length;x++){
  for(i=0;i<document.forms[x].length;i++){
   var elemID=document.forms[x].elements[i];
   if (elemID.type.substring(0,6) == "select"){
    if(param == "hide")
     elemID.style.visibility = "hidden";
    else
     elemID.style.visibility = "visible";
   }
  }
 }
}

// added for IE select box problem
function toggleSelects() {
var ieULs = document.getElementById('nav').getElementsByTagName('ul');
 
for (j=0; j<ieULs.length; j++) {
ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
 
 var ieMat = ieULs[j].firstChild;
  ieMat.style.width=ieULs[j].offsetWidth+"px";
  ieMat.style.height=ieULs[j].offsetHeight+"px"; 
  ieULs[j].style.zIndex="99";
}
 
 var ieLIs = document.getElementById('nav').getElementsByTagName('li');
 for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
  ieLIs[i].onmouseover=function() {this.className+=" toggleSelects";}
  ieLIs[i].onmouseout=function() {this.className=this.className.replace(' toggleSelects', '');}
 }}
*/

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;
}




