// Menu JavaScript Document

<!--//--><![CDATA[//><!--

//top dropdown menu
sfHover = function() {
	var sfEls = document.getElementById("primaryNav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);


//font size changer
function setFontSize(btName, x){
	//main contents
	var mainConArray=new Array("1", "2", "3", "4", "5a", "5b");  
	for(i=0;i<=mainConArray.length;i++){
		var divName = eval("document.getElementById('mainContent"+mainConArray[i]+"')");
		if (divName){
			divName.className= x;
		}
	}
	//bottom bar	
	for(i=1;i<=3;i++){
		var botdivName = eval("document.getElementById('bottomBar"+i+"')");
		if (botdivName){
			botdivName.className= x;
		}
	}
	
	//right bar
	var rightBarArray=new Array("a", "b", "c", "d", "e");
	for(i=0;i<=rightBarArray.length;i++){
		var rightDivName = eval("document.getElementById('sideBar2"+rightBarArray[i]+"')");
		if (rightDivName){
			rightDivName.className= x;
		}
	}
	
	//provider search detail pages content
	var psdivName = eval("document.getElementById('psContent')");
	if (psdivName){
		psdivName.className= x;
	}	
	
	//formulary search results pages
	var psdivName = eval("document.getElementById('formularyResults')");
	if (psdivName){
		psdivName.className= x;
	}	
	
	//A|A|A menu
	
	var aaamenu = eval(document.getElementById(btName));
	if(aaamenu){
		document.getElementById(btName).style.color= '#dde0e9';
		var offColor = '#8991b5';
		if(btName == "small_bt"){
			setCookie('fontsize','small','365');
			document.getElementById('medium_bt').style.color= offColor;
			document.getElementById('large_bt').style.color= offColor;
		}
		if(btName == "medium_bt"){
			setCookie('fontsize','medium','365');
			document.getElementById('small_bt').style.color= offColor;
			document.getElementById('large_bt').style.color= offColor;
		}
		if(btName == "large_bt"){
			setCookie('fontsize','large','365');
			document.getElementById('small_bt').style.color= offColor;
			document.getElementById('medium_bt').style.color= offColor;
		}
	}
}

function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


//--><!]]>
