var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie

function navRollOver(obj, state) {
  document.getElementById(obj).className = (state == 'on') ? 'navOn' : 'nav';
}

function writeNav(s) {
	var navList = new Array();
	var navURL = new Array();
	var navURLtype = new Array();
	
	navList[0] = "WELCOME";
	navURL[0] = "index.html";
	navList[1] = "WHAT IS EXTRANEAL?";
	navURL[1] = "whatisextraneal.html";
	navList[2] = "USE IN FLUID MANAGEMENT";
	navURL[2] = "fluid.html";
	navList[3] = "UNIQUE MECHANISM OF ACTION";
	navURL[3] = "mechanism.html";
	navList[4] = "IMPORTANT RISK INFORMATION";
	navURL[4] = "safetyinfo.html";
	navList[5] = "EXTRANEAL TRAINING (FOR CLINICIANS)";
	navURL[5] = "https://www.renalsource.com/extranealtraining/";
	navURLtype[5] = "_blank";
	navList[6] = "GLUCOSE MONITORING CARDS";
	navURL[6] = "glucose_cards.html";
	navList[7] = "PRESCRIBING INFORMATION";
	navURL[7] = "prescribinginfo.html";
	navList[8] = "REFERENCES";
	navURL[8] = "references.html";
 	
	document.write('<table id="nav" cellspacing=0 cellpadding=0 border=0 width=245 valign=top>');
	document.write('<tr><td height=10></td></tr>');
	for (i=0;i<navList.length;i++)
		document.write('<tr><td id="nav'+i+'" height=21 class="'+((s!=i) ? "nav" : "navSelected")+'">'+((s!=i) ? "<a href=\""+navURL[i]+"\" onMouseOver=\"navRollOver(\'nav"+i+"\', \'on\')\" onMouseOut=\"navRollOver(\'nav"+i+"\', \'off\')\" "+(navURLtype[i] ? "TARGET='"+navURLtype[i]+"'" : "")+">" : "")+navList[i]+((s!=i) ? "</a>" : "")+'</td></tr>');
	document.write('</table>');
}

function writeHeader() {
	document.write('<tr><td valign=top height=120 colspan=2>');
	document.write('	<table cellpadding=0 cellspacing=0 border=0 background="images/header_bg.jpg" width=100% height=100>');
	document.write('		<tr>');
	document.write('			<td align=left><img src="images/header_baxter.jpg"><img src="images/header_tagline.jpg"></td>');
	document.write('			<td align=right><img src="images/header_extraneal.jpg"></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td valign=top height=20 background="images/top_banner_bg.gif" colspan=2></td>');
	document.write('		</tr>');
	document.write('	</table>');
	document.write('</td></tr>');
}

function writeFooter() {
	document.write('<br><table id="footer">');
	document.write('	<tr>');
	document.write('   		<td colspan="2" valign=top class="copyright">');
	document.write('			<a href="javascript:slidePopup(\'520\',\'600\',\'aboutus.html\',true)">About Us</a><img src="images/spacer.gif" height=1 width=10>');
	document.write('			<a href="http://www.baxter.com/information/privacy/" target="_blank">Privacy policy</a><img src="images/spacer.gif" height=1 width=10>');
//	document.write('			<a href="javascript:slidePopup(\'520\',\'600\',\'terms.html\',true)">Terms</a><img src="images/spacer.gif" height=1 width=10>');
	document.write('			<a href="javascript:slidePopup(\'520\',\'600\',\'contactus.html\',true)">Contact Us</a><img src="images/spacer.gif" height=1 width=10>');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr height=2><td colspan="2"><img src="images/spacer.gif" height=2 width=1></td></tr>');
	document.write('	<tr height=1><td background="images/dotted_line.gif" colspan="2" height=1><img src="images/spacer.gif" height=1 width=1></td></tr>');
	document.write('	<tr height=2><td colspan="2"><img src="images/spacer.gif" height=2 width=1></td></tr>');
	document.write('	<tr>');
	document.write('		<td valign="top" class="copyright"><strong>BAXTER</strong> and <strong>EXTRANEAL</strong> are trademarks of Baxter International Inc.</td>');
	document.write('		<td align="right"><div id="footerlogo"><a href="http://www.baxter.com" target="_blank"><img src="images/footer_logo.gif" width="83" height="14" alt="" border="0"></a></div></td>');
	document.write('	</tr>');
	document.write('</table>');
}

function slidePopup(w,h,page,scrollbars,newwindow) {
	var screenW, screenH, posX, posY, windowname;
	if (parseInt(navigator.appVersion)>3) {
		screenW = screen.width;
		screenH = screen.height;
		posX=Math.floor((screenW-w)/2);
		posY=Math.floor((screenH-h)/2);
	}
	else {
		posX=0;
		posY=0;
	}
	windowname = ((newwindow) ? newwindow : "baxter");
	configStr='width='+w+',height='+h+',screenX='+posX+',screenY='+posY+',top='+posY+',left='+posX+',scrollbars='+((scrollbars==true) ? "yes" : "no")+',resizable=no,toolbar=no,menubar=no';
	window.open(page,windowname,configStr);
}
