// Javascript code that writes out the DIV contining the global nav

nav_ready = false;

// BEGIN PRIMARY NAVIGATION TABLE 
	document.write('<div id="navigationDiv"> \
<table width="156" height="73" cellpadding="0" cellspacing="0" border="0">\
	<tr bgcolor="#000000"><td height="1" colspan="5"><spacer type="block" height="1" width="1" /></td></tr>\
	<tr height="71"><td bgcolor="#000000" width="1"><spacer type="block" height="1" width="1" /></td>\
	                <td width="68"><a href="index4.htm"><img src="index4_archivos/logo.gif" alt="Logo" height="71" width="68" border="0" /></a></td>\
					<td bgcolor="#000000" width="1"><spacer type="block" height="1" width="1" /></td>\
					<td bgcolor="#ff0000" width="85">\
						<table width="83" height="71" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000">');
						

for (var i = 0; i < glnav_menuNames.length; i++) {

	// write out code for menu image
	if (glnav_menuNames[i]==whichMenu) {
		document.write('				<tr height="17"><td><a href="' + glnav_menuSectionURLs[i] + '" onMouseOver="setRolloverTimer(\'' + glnav_menuNames[i] + '\', whichMenu);" onMouseOut="setRolloffTimer(\'' + glnav_menuNames[i] + '../images/nav/global\', whichMenu);"><img name="nav_' + glnav_menuNames[i] + '" alt="" src="' + glnav_imgPath + glnav_navImgPrefix + glnav_menuNames[i] + '_on.gif" height="17" width="85" border="0" /></a></td></tr>\n');
	} else {
		document.write('				<tr height="17"><td><a href="' + glnav_menuSectionURLs[i] + '" onMouseOver="setRolloverTimer(\'' + glnav_menuNames[i] + '\', whichMenu);" onMouseOut="setRolloffTimer(\'' + glnav_menuNames[i] + '\', whichMenu);"><img name="nav_' + glnav_menuNames[i] + '" alt="" src="' + glnav_imgPath + glnav_navImgPrefix + glnav_menuNames[i] + '.gif" height="17" width="85" border="0" /></a></td></tr>\n');
	} 
	
	// add black line if not the last menu item
	if (i!=glnav_menuNames.length-1) {
		document.write('				<tr bgcolor="#000000"><td height="1"><spacer type="block" height="1" width="1" /></td></tr>');
	}
}


document.write('						</table></td>\
					<td bgcolor="#000000" width="1"><spacer type="block" height="1" width="1" /></td>\
	<tr bgcolor="#000000"><td height="1" colspan="5"><spacer type="block" height="1" width="1" /></td></tr>\
</table>\
</div>');

// END PRIMARY NAVIGATION TABLE

// BEGIN country NAVIGATION TABLE 
document.write('<div id="countryDiv" style="style="left:100;""> \
<table width="173" height="18" cellpadding="0" cellspacing="0" border="0">\
	<tr bgcolor="#ffffff"><td height="1" colspan="5"><spacer type="block" height="1" width="1" /></td></tr>\
	<tr height="17"><td bgcolor="#ffffff" width="1"><spacer type="block" height="1" width="1" /></td>\
	                <td width="71"><a href="index.html"><img src="index4_archivos/login_usa.gif" alt="Select language" height="17" width="71" border="0" /></a></td>\
					<td bgcolor="#ffffff" width="1"><spacer type="block" height="1" width="1" /></td>\
					<td bgcolor="#ff0000" width="99">\
						<table width="99" height="17" cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff">');
												
						
	for (var i = 0; i < gCouNav_menuNames.length; i++) {

		// write out code for menu image
		if (gCouNav_menuNames[i]==whichMenu) {
			var temp ='		<tr height="17"><td><a href="index.html' + gCouNav_menuSectionURLs[i] + '" onMouseOver="setRolloverTimer(images/nav/country\'' + gCouNav_menuNames[i] + '\', whichMenu);" onMouseOut="setRolloffTimer(\'' + gCouNav_menuNames[i] + '\', whichMenu);"><img name="nav_' + gCouNav_menuNames[i] + '" alt="" src="' + gCouNav_imgPath + gCouNav_navImgPrefix + gCouNav_menuNames[i] + '_on.gif" height="17" width="99" border="0" /></a></td></tr>\n';
			document.write(temp);
		} else {
			var temp ='		<tr height="17"><td><a href="http://www.piedmontmedicalinc.net/cgi-bin/med/spn/mreg.cgi' + gCouNav_menuSectionURLs[i] + '" onMouseOver="setRolloverTimer(\'' + gCouNav_menuNames[i] + '\', whichMenu);" onMouseOut="setRolloffTimer(\'' + gCouNav_menuNames[i] + '\', whichMenu);"><img name="nav_' + gCouNav_menuNames[i] + '" alt="Sitio Web en espaņol" src="' + gCouNav_imgPath + gCouNav_navImgPrefix + gCouNav_menuNames[i] + '.gif" height="17" width="99" border="0" /></a></td></tr>\n';
			document.write(temp);
		} 
		//alert(temp);
		// add black line if not the last menu item
		if (i!=gCouNav_menuNames.length-1) {
			document.write('			<tr bgcolor="#ffffff"><td height="1"><spacer type="block" height="1" width="1" /></td></tr>');
	}
}


document.write('						</table></td>\
					<td bgcolor="#ffffff" width="1"><spacer type="block" height="1" width="1" /></td>\
	<tr bgcolor="#ffffff"><td height="1" colspan="5"><spacer type="block" height="1" width="1" /></td></tr>\
</table>\
</div>');

// END country NAVIGATION TABLE

// BEGIN CODE TO GENERATE MENUS
for (var i = 0; i < glnav_menuNames.length; i++) {
	var menuName = glnav_menuNames[i];
	document.write(glnav_menuObjs[menuName].div);
	
}
// END CODE TO GENERATE MENUS

// BEGIN CODE TO GENERATE Country MENUS
for (var i = 0; i < gCouNav_menuNames.length; i++) {
	var menuName = gCouNav_menuNames[i];
	document.write(glnav_menuObjs[menuName].div);
	//debugln(glnav_menuObjs[menuName].div);
}
// END CODE TO GENERATE MENUS

