function ChangeFontSize(id, size)
{
	document.getElementById(id).style.fontSize = size + "px";
	oTblList = document.getElementsByTagName("TABLE");
	if (oTblList && oTblList.length)
	{
		for (i=0; i < oTblList.length; i++)
		{
			if (oTblList[i].style)
			{
				oTblList[i].style.fontSize = size + "px";
			}
		}
	}	
	//SET COOKIE HERE
	createCookie('customfontsize',size,7);

}



function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function loadCookie() {
	var x = readCookie('customfontsize')
	if (x) {
		size = x;
		switch (x)
			{
				case "10":
					textlink = '1';
				break;
			
				case "12":
					textlink = '2';
				break;
			
				case "14":
					textlink = '3';
				break;
			}
		ChangeFontSize('content', x, textlink)
	}
}

//HCP Validation for Refer a Colleague
/*function validateRefer(contact)
{
	if(""==document.forms.formRefer.colleagueEmail.value)
	{
		alert("Please enter/format your colleague's e-mail address");
		return false;
	}
	if(""==document.forms.formRefer.firstName.value)
	{
		alert("Please enter your colleague's first name");
		return false;
	}
	if(""==document.forms.formRefer.lastName.value)
	{
		alert("Please enter your colleague's last name");
		return false;
	}
	if(""==document.forms.formRefer.yourEmail.value)
	{
		alert("Please enter/format your e-mail address");
		return false;
	}
}

//Consumer Validation for Email to Friend
function validateEmail(contact)
{
	if(""==document.forms.formEmail.friendEmail.value)
	{
		alert("Please enter a valid e-mail address (eg, name@company.com) if you wish to e-mail this site to a friend.");
		return false;
	}
	if(""==document.forms.formEmail.friendName.value)
	{
		alert("Please enter your friend's name.");
		return false;
	}	
	if(""==document.forms.formEmail.yourEmail.value)
	{
		alert("Please enter a valid e-mail address (eg, name@company.com) if you wish to e-mail this site to a friend.");
		return false;
	}	
	if(""==document.forms.formEmail.yourName.value)
	{
		alert("Please enter your name.");
		return false;
	}	
}

//validate Request Samples
function validateRequestSamples(contact)
{
	if(""==document.forms.formRefer.yourEmail.value)
	{
		alert("Please enter/format your e-mail address (eg, name@company.com)");
		return false;
	}
}*/




//Preload Images 
	var imagePath = "/images";
	
	//hcp images
	about_altabax_Off = new Image();
	about_altabax_Off.src = imagePath + "/navigation/hcp_off_nav01.jpg";
	about_altabax_On = new Image();
	about_altabax_On.src = imagePath + "/navigation/hcp_on_nav01.jpg";
	
	treating_infections_Off = new Image();
	treating_infections_Off.src = imagePath + "/navigation/hcp_off_nav02.jpg";
	treating_infections_On = new Image();
	treating_infections_On.src = imagePath + "/navigation/hcp_on_nav02.jpg";
	
	resources_Off = new Image();
	resources_Off.src = imagePath + "/navigation/hcp_off_nav03.jpg";
	resources_On = new Image();
	resources_On.src = imagePath + "/navigation/hcp_on_nav03.jpg";
	
	sample_Off = new Image();
	sample_Off.src = imagePath + "/navigation/hcp_off_nav04.jpg";
	sample_On = new Image();
	sample_On.src = imagePath + "/navigation/hcp_on_nav04.jpg";
	
	consumer_Off = new Image();
	consumer_Off.src = imagePath + "/navigation/hcp_off_nav05.jpg";
	consumer_On = new Image();
	consumer_On.src = imagePath + "/navigation/hcp_off_nav05.jpg";
	
	//consumer images
	altabax_Off = new Image();
	altabax_Off.src = imagePath + "/navigation/con_off_nav01.jpg";
	altabax_On = new Image();
	altabax_On.src = imagePath + "/navigation/con_on_nav01.jpg";
	
	treat_Off = new Image();
	treat_Off.src = imagePath + "/navigation/con_off_nav02.jpg";
	treat_On = new Image();
	treat_On.src = imagePath + "/navigation/con_on_nav02.jpg";
	
	faq_Off = new Image();
	faq_Off.src = imagePath + "/navigation/con_off_nav03.jpg";
	faq_On = new Image();
	faq_On.src = imagePath + "/navigation/con_on_nav03.jpg";
	
	health_Off = new Image();
	health_Off.src = imagePath + "/navigation/con_off_nav05.jpg";
	health_On = new Image();
	health_On.src = imagePath + "/navigation/con_on_nav05.jpg";;
	
//Rollover function
	function rollOver(imageTagName, imageFileName)
	{
	  document.images[imageTagName].src=imageFileName;
	}

	function swapImg(pageName){
		switch(pageName){
			case "About":
				document.images["about"].src = imagePath + "/navigation/hcp_on_nav01.jpg";
				document.getElementById('aboutaltabaxNav').style.visibility = "visible";
				document.getElementById('resourcesNav').style.visibility = "hidden";
				document.getElementById('hcpSkinInfectNav').style.visibility = "hidden";
				var hTag1 = document.getElementById('aboutatabaxLink');
				hTag1.setAttribute('onMouseOut', '');
				hTag1.setAttribute('onMouseOver', '');
				document.getElementById("aboutatabaxLink").onmouseover = "";
				document.getElementById("aboutatabaxLink").onmouseout = "";				
				break;
			case "Treating":
				document.images["treating"].src = imagePath + "/navigation/hcp_on_nav02.jpg";
				document.getElementById('hcpSkinInfectNav').style.visibility = "visible";
				document.getElementById('aboutaltabaxNav').style.visibility = "hidden";
				document.getElementById('resourcesNav').style.visibility = "hidden";
				var hTag2 = document.getElementById('treatingSI');
				hTag2.setAttribute('onMouseOut', '');
				hTag2.setAttribute('onMouseOver', '');
				document.getElementById("treatingSI").onmouseover = "";
				document.getElementById("treatingSI").onmouseout = "";
				break;
			case "resources":
				document.images["resources"].src = imagePath + "/navigation/hcp_on_nav03.jpg";
				document.getElementById('resourcesNav').style.visibility = "visible";
				document.getElementById('aboutaltabaxNav').style.visibility = "hidden";
				document.getElementById('hcpSkinInfectNav').style.visibility = "hidden";
				var hTag3 = document.getElementById('hcpResources');
				hTag3.setAttribute('onMouseOut', '');
				hTag3.setAttribute('onMouseOver', '');
				document.getElementById("hcpResources").onmouseover = "";
				document.getElementById("hcpResources").onmouseout = "";
				break;
			case "eDetail":
				document.images["detail"].src = imagePath + "navigation/hcp_on_nav04.jpg";
				document.getElementById('AboutNav').style.visibility = "hidden";
				document.getElementById('aboutaltabaxNav').style.visibility = "hidden";	
				document.getElementById('hcpSkinInfectNav').style.visibility = "hidden";		
				break;
			case "None":
				document.getElementById('aboutaltabaxNav').style.visibility = "hidden";
				document.getElementById('resourcesNav').style.visibility = "hidden";
				document.getElementById('hcpSkinInfectNav').style.visibility = "hidden";					
				break;
			//switch statement for consumer side
			case "aboutaltabax":
				document.images["altabax"].src = imagePath + "/navigation/con_on_nav01.jpg";
				document.getElementById('conAboutNav').style.visibility = "visible";
				document.getElementById('SkinInfectNav').style.visibility = "hidden";
				var pTag1 = document.getElementById('atabaxLink');
				pTag1.setAttribute('onMouseOut', '');
				pTag1.setAttribute('onMouseOver', '');
				document.getElementById("atabaxLink").onmouseover = "";
				document.getElementById("atabaxLink").onmouseout = "";				
				break;					
			case "skininfection":
				document.images["treat"].src = imagePath + "/navigation/con_on_nav02.jpg";
				document.getElementById('conAboutNav').style.visibility = "hidden";
				document.getElementById('SkinInfectNav').style.visibility = "visible";
				var pTag2 = document.getElementById('siLink');
				pTag2.setAttribute('onMouseOut', '');
				pTag2.setAttribute('onMouseOver', '');
				document.getElementById("siLink").onmouseover = "";
				document.getElementById("siLink").onmouseout = "";		
				break;	
			case "FAQ":
				document.images["faq"].src = imagePath + "/navigation/con_on_nav03.jpg";
				document.getElementById('conAboutNav').style.visibility = "hidden";
				document.getElementById('SkinInfectNav').style.visibility = "hidden";
				var pTag3 = document.getElementById('faqLink');
				pTag3.setAttribute('onMouseOut', '');
				pTag3.setAttribute('onMouseOver', '');
				document.getElementById("faqLink").onmouseover = "";
				document.getElementById("faqLink").onmouseout = "";	
				break;				
			case "Other":
				document.getElementById('conAboutNav').style.visibility = "hidden";
				document.getElementById('SkinInfectNav').style.visibility = "hidden";	
				break;																									
		}
	}
	
	function determineSecNav(secondaryName){
		switch(secondaryName){
		//HCP
		//Resource Section
		case "articles":
			document.getElementById('treatingArticles').style.backgroundColor = "#ffffff";
			document.getElementById('treatingArticles').style.color = "#27C2D4";
			break;
		case "links":
			document.getElementById('moreInfo').style.backgroundColor = "#ffffff";
			document.getElementById('moreInfo').style.color = "#27C2D4";			
			break;
		case "images":
			document.getElementById('images').style.backgroundColor = "#ffffff";
			document.getElementById('images').style.color = "#27C2D4";
			break;
		case "news":
			document.getElementById('news').style.backgroundColor = "#ffffff";
			document.getElementById('news').style.color = "#27C2D4";
			break;
		//Treating Skin Infections
		case "hcpSkin":
			document.getElementById('hcpSkin').style.backgroundColor = "#ffffff";
			document.getElementById('hcpSkin').style.color = "#27C2D4";
			break;
		//AboutAltabax Section	
		case "works":
			document.getElementById('works').style.backgroundColor = "#ffffff";
			document.getElementById('works').style.color = "#27C2D4";
			break;
		case "topicalAdvantage":
			document.getElementById('topicalAdvantage').style.backgroundColor = "#ffffff";
			document.getElementById('topicalAdvantage').style.color = "#27C2D4";
			break;
		case "efficacy":
			document.getElementById('efficacy').style.backgroundColor = "#ffffff";
			document.getElementById('efficacy').style.color = "#27C2D4";
			break;
		case "safety":
			document.getElementById('safety').style.backgroundColor = "#ffffff";
			document.getElementById('safety').style.color = "#27C2D4";
			break;
		//Consumer Section
		//About Altabax Section
		case "use":
			document.getElementById('use').style.backgroundColor = "#ffffff";
			document.getElementById('use').style.color = "#27C2D4";
			break;
		case "conSafety":
			document.getElementById('conSafety').style.backgroundColor = "#ffffff";
			document.getElementById('conSafety').style.color = "#27C2D4";
			break;
		case "prescriptions":
			document.getElementById('prescriptions').style.backgroundColor = "#ffffff";
			document.getElementById('prescriptions').style.color = "#27C2D4";
			break;
		//About Skin Infections
		case "wound":
			document.getElementById('wound').style.backgroundColor = "#ffffff";
			document.getElementById('wound').style.color = "#27C2D4";
			break;
		case "resistance":
			document.getElementById('resistance').style.backgroundColor = "#ffffff";
			document.getElementById('resistance').style.color = "#27C2D4";
			break;
		case "SelfTest":
			document.getElementById('SelfTest').style.backgroundColor = "#ffffff";
			document.getElementById('SelfTest').style.color = "#27C2D4";
			break;				
		}
	}
	
	
	function warn()
	{
		window.open('/warnonleave.html', 'warn', 'scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no,width=700,height=200');		
	}
	
	function openURL(){
		window.close();
	}
	
// JavaScript Document
/* PreLoad Images for IE 6 */
(function(){

	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
		
	}catch(oh){};
})();
/* PreLoad Images for IE 6 */