//global vars begin
var flyoutClosingTime = 300; // time to wait after moving of a flyout before closing it

var SB_NAV_STATE_SET = 0;
var SB_CURRENT_NAV = "";
var SB_CURRENT_FLOAT = null;
var SB_CURRENT_ROLLOVER = "";
var SB_CURRENT_SECTION_ROLLOVER = null;
var SB_CURRENT_EXPAND_NAV  = null;
var SB_BROWSER = sb_getBrowserType();
var SB_FLOAT_TIMEOUT;
//global vars end



//prototypes begin
sb_nodeObject.prototype.sb_add = function(sb_sectionObject) 
{
	this.nodeCollection[this.nodeCounter] = sb_sectionObject;
	this.nodeCounter ++;
}

sb_topNavObject.prototype.sb_add = function(sb_topNavImageObject) 
{
	this.imageCollection[this.imageCounter] = sb_topNavImageObject;
	this.imageCounter ++;
}

sb_sitemapObj.prototype.a = function(sb_siteAreaObj) 
{
	this.n[this.nodeCounter] = sb_siteAreaObj;
	this.nodeCounter ++;
}
sb_siteAreaObj.prototype.a = function(sb_n) 
{	
	this.nodeCollection[this.nodeCounter] = sb_n;
	this.nodeCounter ++;
}

//prototypes end



/*
------------------------------------------
Function name  -  sb_getBrowserType
Description - queries the user's SB_BROWSER and sets properties in an object 
			  for a specific type of SB_BROWSER look at the objects properties
------------------------------------------	
*/
function sb_getBrowserType() {
	var myAgent = navigator.userAgent;
	var isMac = myAgent.toString().toUpperCase().indexOf("MAC") != -1;
	var isNS = myAgent.toString().toUpperCase().indexOf("MOZILLA") != -1;
	var isNS6 = myAgent.toString().toUpperCase().indexOf("NETSCAPE6/6") != -1;
	var isNS7 = myAgent.toString().toUpperCase().indexOf("NETSCAPE/7") != -1;
	var isMoz = ((parseInt(navigator.appVersion) >= 5) && myAgent.toString().toUpperCase().indexOf("NETSCAPE") == -1);
	
	this.ie = document.all ? 1 : 0;
	this.ns4 = document.layers ? 1 : 0;
	this.dom = document.getElementById ? 1 : 0;
	this.iemac = ((ie) && (isMac)) ? 1 : 0;
	this.ns6 = ((!ie) && (isNS6)) ? 1 : 0;
	this.ns7 = ((!ie) && (isNS7)) ? 1 : 0;
	this.moz = ((!ie) && (isNS) && (isMoz)) ? 1 : 0;
	this.ns = ((!ie) && (isNS) && (!isNS6) && (!isNS7) && (!isMoz) ) ? 1 : 0;
	this.ns6plus = ((!ie) && (isNS) && (!this.ns4) ) ? 1 : 0;
	return this;
}

/*------------------------------------------
Function name  -  sb_getNavRef
Description - looks up a div or layer in the document and returns a reference to it
------------------------------------------*/
function sb_getNavRef(nav)
{
	var navRef;
	if (SB_BROWSER.dom) return document.getElementById(nav);
	if (SB_BROWSER.ns4) {
		navRef = eval(document.layers[nav]);
		return navRef;
	}
}	

/*
------------------------------------------
Function name  - sb_sectionObject
Description - used to create section objects and set its properties 
			  this allows a section to live in a directory that is named something different from the section name
------------------------------------------	
*/
function sb_sectionObject(sectionName, sectionDiv)
{
	this.sectionName = sectionName;
	this.sectionDiv = sectionDiv;
	return this;
}

/*
------------------------------------------
Function name  - sb_nodeObject
Description - used to create a collection of nodes
------------------------------------------	
*/
function sb_nodeObject()
{
	this.nodeCollection = new Array();
	this.nodeCounter = 0;
	return this;
}

/*
------------------------------------------
Function name  - sb_topImageObject
Description - used to create top nav image objects and set its properties 
			  this is used to highlight the image for the section you are in
------------------------------------------	
*/
function sb_topNavImageObject(dirName, imageId, divId, onSrc)
{
	this.dirName = dirName;
	this.imageId = imageId;
	this.divId = divId;
	this.onSrc = onSrc;
	return this;
}

/*
------------------------------------------
Function name  - sb_topNavObject
Description - used to create a collection of Top Nav Images
------------------------------------------	
*/
function sb_topNavObject()
{
	this.imageCollection = new Array();
	this.imageCounter = 0;
	return this;
}


/*------------------------------------------
Function name  -  sb_currentFloat
Description - used to store properties of the current floater
------------------------------------------*/
function sb_currentFloat(navName) { this.navName = navName; }

/*------------------------------------------
Function name  -  sb_currentExpandNav
Description - used to store properties of the current floater
------------------------------------------*/
function sb_currentExpandNav(sourceNav,navName)
{
	this.sourceNav = sourceNav;
	this.navName = navName;
}

/*------------------------------------------
Function name  -  sb_currentRollOver
Description - used to store properties of the current rollover
------------------------------------------*/
function sb_currentRollOver(navName) {	this.navName = navName; }


/*------------------------------------------
Function name  -  sb_currentSectionRollOver
Description - used to store properties of the current rollover
------------------------------------------*/
function sb_currentSectionRollOver(navName) {	this.navName = navName; }

/*------------------------------------------
Function name  -  sb_rollOverObject
Description - used to store the properties of a rollover object
			  the properties include the owner of this object, the on state and the off state
------------------------------------------	*/
function sb_rollOverObject(onClass,offClass)
{
	this.onClass = onClass;
	this.offClass = offClass;
	return this;
}

/*------------------------------------------
Function name  -  sb_navRollOver
Description - used to handle the on and off state of nav items
			  there is no on or off state switch the swtiching is done by querying the rollOver object
------------------------------------------*/
function sb_navRollOver(nav) {
	if (! SB_BROWSER.dom) return;
	if (SB_FLOAT_TIMEOUT)	window.clearTimeout(SB_FLOAT_TIMEOUT);		
	//sb_floatShow();
	var navRef = null;
	navRef = sb_getNavRef(nav);
	if (! navRef) return;
	if((SB_CURRENT_SECTION_ROLLOVER) && (SB_CURRENT_SECTION_ROLLOVER.navName.toString() == nav)) return;	
 	//if (SB_CURRENT_EXPAND_NAV) sb_rollOverClear(SB_CURRENT_EXPAND_NAV.sourceNav);		
	var rollObject = new Array();
	rollObject[0] =  new sb_rollOverObject("navItem1on","navItem1off");
	rollObject[1] =  new sb_rollOverObject("navItem2on","navItem2off");
	rollObject[2] =  new sb_rollOverObject("navItem3on","navItem3off");
	
	//window.status = "navRef.parentNode.parentNode.parentNode.nodeName " + navRef.parentNode.parentNode.parentNode.parentNode.className;
	
	var objChildNodes = navRef.childNodes;
	for (c=0;c<rollObject.length;c++) {	
		var thisObj = rollObject[c];
		for (thisKey in thisObj) {
		
			// Turn off current flyout when rolling over a docked item.
			if ((SB_CURRENT_FLOAT) && (navRef.parentNode.parentNode.parentNode.parentNode.nodeName.toUpperCase() == "TABLE")  && (navRef.parentNode.parentNode.parentNode.parentNode.className == "navbgDockedFlyout")){
				sb_floatHide(10);
			}
		
			// Turn on nav items that are fixed in the left nav
			if ((SB_BROWSER.dom) && (thisObj["offClass"] == navRef.className)) {
				navRef.className = thisObj["onClass"];
				if ((navRef.parentNode) && (navRef.parentNode.nodeName.toUpperCase() == "TD")) navRef.parentNode.className = thisObj["onClass"];				
				if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) navRef.parentNode.parentNode.className = thisObj["onClass"];
				for (c=0; c<objChildNodes.length; c++)
				{
					var tn = objChildNodes[c];
					if(tn.nodeType != document.TEXT_NODE) {
						tn.className = thisObj["onClass"];
					}
				}
				
				return;
			} // End Turn on nav items that are fixed in the left nav
			
			// Turn off nav items that are fixed in the left nav
			if ((SB_BROWSER.dom) && (thisObj["onClass"] == navRef.className)) {
				navRef.className = thisObj["offClass"];
				if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) {
					navRef.parentNode.parentNode.className = thisObj["offClass"];
					navRef.parentNode.className = thisObj["offClass"];
				}
				for (c=0; c<objChildNodes.length; c++) {
					var tn = objChildNodes[c];
					if (tn.nodeType != document.TEXT_NODE) {
						tn.className = thisObj["offClass"];
					}
				}
				return;
			} // End Turn off nav items that are fixed in the left nav

		} // end for
		
		
		// Turn on level 2 flyout items
		if ((SB_BROWSER.dom) && ((navRef.className == "navItem2off") || (navRef.className == "") )) {		
			navRef.className = "navItem2on";
			if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) navRef.parentNode.parentNode.className = "navItem2on";
			for (c=0; c<objChildNodes.length; c++) {
				var tn = objChildNodes[c];
				if (tn.nodeType != document.TEXT_NODE) {
					tn.className = "navItem2on";
				}
			}
			return;
		}  // End Turn on level 2 flyout items
		
		
		// Turn on level 3 flyout items
		if ((SB_BROWSER.dom) && ((navRef.className == "navItem3off") || (navRef.className == "") )) {
			navRef.className = "navItem3on";
			if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) navRef.parentNode.parentNode.className = "navItem3on";
			for (c=0; c<objChildNodes.length; c++) {
				var tn = objChildNodes[c];
				if (tn.nodeType != document.TEXT_NODE) {
					tn.className = "navItem3on";
				}
			}
			return;
		}  // End Turn on level 3 flyout items
	
		// Turn off level 2 flyout items
		if ((SB_BROWSER.dom) && (thisObj["onClass"] == navRef.className)&& ((navRef.className == "navItem2on") || (navRef.className == "") )) {
			navRef.className = "navItem2off";
			if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) {
				navRef.parentNode.parentNode.className = "navItem2off";
			}
			for (c=0; c<objChildNodes.length; c++)
			{
				var tn = objChildNodes[c];
				if (tn.nodeType != document.TEXT_NODE) {
					tn.className = "navItem2off";
				}
			}
			return;
		}  // End Turn off level 2 flyout items
		
		// Turn off level 3 flyout items
		if ((SB_BROWSER.dom) && (thisObj["onClass"] == navRef.className)&& ((navRef.className == "navItem3on") || (navRef.className == "") )) {
			navRef.className = "navItem3off";
			if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) navRef.parentNode.parentNode.className = "navItem3off";
			for (c=0; c<objChildNodes.length; c++)
			{
				var tn = objChildNodes[c];
				if (tn.nodeType != document.TEXT_NODE) {
					tn.className = "navItem3off";
				}
			}
			return;
		}  // End Turn off level 3 flyout items
		
	} // end for
}

/*------------------------------------------
Function name  -  sb_rollOverClear
Description - used to clear a specific rollover
------------------------------------------*/
function sb_rollOverClear(sourceNav)
{
	if (! SB_BROWSER.dom) return;
	//if (SB_CURRENT_EXPAND_NAV && SB_CURRENT_ROLLOVER) alert("SB_CURRENT_ROLLOVER.navName " + SB_CURRENT_ROLLOVER.navName + "\n" + "SB_CURRENT_EXPAND_NAV.navName " + SB_CURRENT_EXPAND_NAV.navName);
	//sb_floatShow();
	//if (SB_FLOAT_TIMEOUT)	window.clearTimeout(SB_FLOAT_TIMEOUT);		
	if (! SB_CURRENT_ROLLOVER.navName) return;
 	if ((SB_CURRENT_EXPAND_NAV) && (SB_CURRENT_ROLLOVER.navName ==  SB_CURRENT_EXPAND_NAV.navName)) return;
	var navRef = null;
	arguments.length ==0 ? 	navRef = sb_getNavRef(SB_CURRENT_ROLLOVER.navName) : 	navRef = sb_getNavRef(sourceNav); 		
	if (! navRef) return;
	var rollObject = new Array();
	rollObject[0] =  new sb_rollOverObject("navItem1on","navItem1off");
	rollObject[1] =  new sb_rollOverObject("navItem2on","navItem2off");
	rollObject[2] =  new sb_rollOverObject("navItem3on","navItem3off");
	var objChildNodes = navRef.childNodes;
	for (c=0;c<rollObject.length;c++)
	{
		var thisObj = rollObject[c];
		for (thisKey in thisObj)
		{
			if ((SB_BROWSER.dom) && (thisObj["onClass"] == navRef.className)) 
			{
				navRef.className = thisObj["offClass"];
				 if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) {
				 	navRef.parentNode.parentNode.className = thisObj["offClass"];
					navRef.parentNode.className = thisObj["offClass"];
				}
				for (c=0; c<objChildNodes.length; c++)
				{
					var tn = objChildNodes[c];
					if (tn.nodeType == "3") continue;					
					tn.className = thisObj["offClass"];
				}
				return;

			}
		}
	}
}



/*------------------------------------------
Function name  -  sb_sectionClear
Description - used to clear a specific section
------------------------------------------*/
function sb_sectionClear(sourceNav) {
	if (! SB_BROWSER.dom) return;
	//if (SB_CURRENT_EXPAND_NAV && SB_CURRENT_ROLLOVER) alert("SB_CURRENT_ROLLOVER.navName " + SB_CURRENT_ROLLOVER.navName + "\n" + "SB_CURRENT_EXPAND_NAV.navName " + SB_CURRENT_EXPAND_NAV.navName);
	if (! SB_CURRENT_SECTION_ROLLOVER.navName) return;
	var navRef = null;
	arguments.length ==0 ? 	navRef = sb_getNavRef(SB_CURRENT_SECTION_ROLLOVER.navName) : 	navRef = sb_getNavRef(sourceNav); 
	if (! navRef) return;
	var rollObject = new Array();
	rollObject[0] =  new sb_rollOverObject("navItem1on","navItem1off");
	rollObject[1] =  new sb_rollOverObject("navItem2on","navItem2off");
	rollObject[2] =  new sb_rollOverObject("navItem3on","navItem3off");
	var objChildNodes = navRef.childNodes;
	for (c=0;c<rollObject.length;c++)
	{
		var thisObj = rollObject[c];
		for (thisKey in thisObj)
		{
			if ((SB_BROWSER.dom) && (thisObj["onClass"] == navRef.className)) 
			{
				navRef.className = thisObj["offClass"];
				 if ((navRef.parentNode.parentNode) && (navRef.parentNode.parentNode.nodeName.toUpperCase() == "TR")) {
				 	navRef.parentNode.parentNode.className = thisObj["offClass"];
					navRef.parentNode.className = thisObj["offClass"];
				}
				for (c=0; c<objChildNodes.length; c++)
				{
					var tn = objChildNodes[c];
					if (tn.nodeType == "3") continue;					
					tn.className = thisObj["offClass"];
				}
				return;

			}
		}
	}
}

/*------------------------------------------
Function name  -  sb_sectionHighLight
Description - used to highlight a section
------------------------------------------*/
function sb_sectionHighLight(nav) {
	if (! SB_BROWSER.dom) return;
	var navRef = null;
	navRef = sb_getNavRef(nav);
	if (! navRef) return;
	
	var rollObject = new Array();
	rollObject[0] =  new sb_rollOverObject("navItem1selected","navItem1off");
	rollObject[1] =  new sb_rollOverObject("navItem2selected","navItem2off");
	rollObject[2] =  new sb_rollOverObject("navItem3selected","navItem3off");

	var objChildNodes = navRef.childNodes;
	for (c=0;c<rollObject.length;c++)
	{
		var thisObj = rollObject[c];
		for (thisKey in thisObj) {
			if ((SB_BROWSER.dom) && (thisObj["offClass"] == navRef.className) || (navRef.className == ""))  {
				navRef.className = thisObj["onClass"];
				//alert(navRef.parentNode.previousSibling.innerHTML + "\n" + navRef.parentNode.previousSibling.className);
				if ((navRef.parentNode) && (navRef.parentNode.nodeName.toUpperCase() == "TD")) navRef.parentNode.className = thisObj["onClass"];				
				if ((navRef.parentNode.previousSibling.parentNode) && (navRef.parentNode.previousSibling.parentNode.nodeName.toUpperCase() == "TR")) navRef.parentNode.previousSibling.parentNode.className = thisObj["onClass"];
				if (navRef.parentNode.previousSibling) navRef.parentNode.previousSibling.className = thisObj["onClass"];
				for (c=0; c<objChildNodes.length; c++) {
					var tn = objChildNodes[c];
					if (tn.nodeType == "3") continue;
					tn.className = thisObj["onClass"];
				}
				return;
			}
		}
	}
}
	
/*------------------------------------------
Function name  - sb_hideCurrentFloat
Description - used to hide the current nav
------------------------------------------	*/
function sb_hideCurrentFloat() { 
	if (! SB_BROWSER.dom) return;
	var navRef = null;
	var sourceNavRef = null;
 	if ((SB_CURRENT_EXPAND_NAV) && (SB_CURRENT_FLOAT) && (SB_CURRENT_FLOAT.navName ==  SB_CURRENT_EXPAND_NAV.navName)) return;	
	if (SB_CURRENT_FLOAT) 
	{
		navRef = sb_getNavRef(SB_CURRENT_FLOAT.navName);
		if (! navRef) return;
		SB_BROWSER.dom ? navRef.style.visibility = "hidden" : navRef.visibility = "hide";
		//sb_floatClear(SB_CURRENT_FLOAT.navName);
	}
}

/*------------------------------------------
Function name  - sb_floatHide
Description - used to hide a float
------------------------------------------	*/
function sb_floatHide(waitTime) 
{ 
	if (! SB_BROWSER.dom) return;
	var wt;
	if (arguments.length > 1) return;
	if (! waitTime) {
		wt = flyoutClosingTime; 
	} else {
		wt = waitTime;
	}
	if (window.setTimeout) {
		if (SB_FLOAT_TIMEOUT)	window.clearTimeout(SB_FLOAT_TIMEOUT);
		SB_FLOAT_TIMEOUT = window.setTimeout('sb_hideCurrentFloat() ; sb_rollOverClear(SB_CURRENT_ROLLOVER.navName)',wt);
	} else {
		sb_hideCurrentFloat()
	}
}

/*------------------------------------------
Function name  - sb_floatShow
Description - used to keep a float afloat
------------------------------------------	*/
function sb_floatShow() { 
	if (! SB_BROWSER.dom) return;
	if (arguments.length > 0) return;	
	if ((window.clearTimeOut) && (SB_FLOAT_TIMEOUT)) window.clearTimeout(SB_FLOAT_TIMEOUT); 
}	
/*------------------------------------------
Function name  - sb_floatClear
Description - used to clear the bgcolor of the float
------------------------------------------	*/
function sb_floatClear(destNav) {
	if (! SB_BROWSER.dom) return;
	if (arguments.length > 1) return;
	var destNavRef = null;
	if (destNav != "") destNavRef = sb_getNavRef(destNav);
	if (! destNavRef) return;
	return;
}
/*------------------------------------------
Function name  - sb_navFloat
Description - used to float a div
------------------------------------------	*/
function sb_navFloat(sourceNav,destNav) {
	if (! SB_BROWSER.dom) return;
	if (arguments.length == 0) return;
	var sourceNavRef = null; 
	var destNavRef = null;
	if (sourceNav != "") sourceNavRef = sb_getNavRef(sourceNav);
	if (destNav != "") destNavRef = sb_getNavRef(destNav);
	if (! sourceNavRef) return;

	if (arguments.length == 1) {
		if (SB_CURRENT_FLOAT) sb_hideCurrentFloat();
		sb_rollOverClear();
		sb_navRollOver(sourceNav);
		return;
	} else if(((SB_CURRENT_SECTION_ROLLOVER) && (SB_CURRENT_SECTION_ROLLOVER.navName.toString() != sourceNav)) || (!SB_CURRENT_SECTION_ROLLOVER)) {
		sb_rollOverClear();
		sb_navRollOver(sourceNav);
		SB_CURRENT_ROLLOVER = new sb_currentRollOver(sourceNav);
	}	
	if (SB_CURRENT_ROLLOVER.navName) sb_rollOverClear();
	sb_navRollOver(sourceNav);
	if (SB_CURRENT_FLOAT) sb_hideCurrentFloat();
	if(destNav != "") SB_CURRENT_FLOAT = new sb_currentFloat(destNav);
	if ((sourceNavRef) && (destNavRef)) {
		if ((SB_CURRENT_EXPAND_NAV) && (SB_CURRENT_EXPAND_NAV.navName == destNav)) return; 
		destNavRef.style.left = "153px";
		if ((SB_BROWSER.ie) && (!SB_BROWSER.iemac)) destNavRef.style.top = (sourceNavRef.offsetParent.offsetTop) + 71;
		if (SB_BROWSER.ns7) destNavRef.style.top = ((sourceNavRef.parentNode.parentNode.offsetTop) + 71);
		if (SB_BROWSER.ns6) destNavRef.style.top = ((sourceNavRef.parentNode.parentNode.offsetTop) - 1);
		if (SB_BROWSER.moz) destNavRef.style.top = ((sourceNavRef.parentNode.parentNode.offsetTop) + 71);
		if (SB_BROWSER.ns) destNavRef.style.top = ((sourceNavRef.parentNode.parentNode.offsetTop) + 72);
		if (SB_BROWSER.iemac) return;
		destNavRef.style.visibility = "visible";
		//destNavRef.parentNode.className = "navfloat";
		//destNavRef.className = "navfloat";
	}
}

/*------------------------------------------
Function name  - sb_navExpand
Description - forwards to a url
------------------------------------------	*/
function sb_navExpand(destUrl) {
	document.location = destUrl;
	return;
}

/*------------------------------------------
Function name  - sb_navExpandItem
Description - used to expand a nav item
------------------------------------------	*/
function sb_navExpandItem(sourceNav,destNav,destUrl){
	if (! SB_BROWSER.dom) return;
	var navRef = null;
	navRef = sb_getNavRef(destNav);
	if (! navRef) return;

	//navRef = document.getElementById(destNav);
 	if ((SB_CURRENT_EXPAND_NAV)) sb_navCollapse(destNav);
	if((sourceNav != "") && (destNav != "")) SB_CURRENT_EXPAND_NAV = new sb_currentExpandNav(sourceNav,destNav);

	// Set style for table containing a Docked Flyout	
	var objChildNodes = navRef.childNodes;
	for (c=0; c<objChildNodes.length; c++) {
		var tn = objChildNodes[c];
		if ((tn.nodeName.toUpperCase() == "TABLE") && (tn.className == "navbgFlyout")) {
			tn.className = "navbgDockedFlyout";
		}
	}
	
	//navRef.parentNode.className = "navexpand";		
	//navRef.className = "navexpand";		
	navRef.style.visibility = "visible";
	navRef.style.position = "static";
	//printObject(navRef.style);
	return;
}

/*------------------------------------------
Function name  - sb_navCollapse
Description - used to collapse a nav item
------------------------------------------	*/
function sb_navCollapse(destNav) { 
	if (! SB_BROWSER.dom) return;
	var navRef = null;	
	if ((SB_CURRENT_EXPAND_NAV) && (SB_CURRENT_EXPAND_NAV.navName !=  "")) {
		//navRef = document.getElementById(SB_CURRENT_EXPAND_NAV.navName);
		navRef = sb_getNavRef(SB_CURRENT_EXPAND_NAV.navName);
		if (! navRef) return;		
		//if (SB_BROWSER.dom) navRef.className = "navcollapse";
		SB_BROWSER.dom ? navRef.style.visibility = "hidden" : navRef.visibility = "hide";
		SB_BROWSER.dom ? navRef.style.position = "absolute" : navRef.position = "absolute";
	}
}
/* ------------------------------------------
Function name  - sb_navDockMenu
Description - Called by sb_setNavState when the page first loads.
			  This function "docks" the specified flyout div in the left hand nav.
------------------------------------------	*/
function sb_navDockMenu(sourceNav) {

	if (!SB_BROWSER.dom) return;
	if ((! sourceNav) || (sourceNav == "")) return;
	
	var sourceNavRef = null;
	var destNavRef = null;
	var clickedNav = null;
	var destNav;
	
	sourceNavRef= sb_getNavRef(sourceNav);
	if (! sourceNavRef) return; 
	//alert("sourceNavRef " + sourceNavRef + "\n" + "sourceNav" + "\n" + sourceNav);
	
	//this block figures out what the parent section div is for a clicked div
	//once it gets the name it will get a reference to it and highlight it	
	var sn = new String(sourceNav);
	var tm = sn.match(/_/gi);
	
	if ((tm) && (tm.length == 1)) {
		clickedNav = sourceNav;	 // added by JW 2003/05/15 - allows the level 1 items to get separate "selected" style
		destNav = sourceNav + "_0";
	} else if ((tm) && (tm.length > 1)) {
		clickedNav = sourceNav;
		sourceNav = sn.match(/([a-zA-Z]+_\d+)/gi);
		destNav = sn.match(/([a-zA-Z]+_\d+_\d+)/gi);
	}
	
	destNavRef = sb_getNavRef(destNav);

	//alert("tm.length " + tm.length + "\n clickedNav " + clickedNav + "\n sourceNavRef " + sourceNavRef + "\n" + "sourceNav" + sourceNav + "\n destNavRef " + destNavRef + "\n" + "destNav" + destNav);	
	if (destNavRef) {
		SB_CURRENT_EXPAND_NAV = new sb_currentExpandNav(sourceNav,destNav);
		sb_navExpandItem(sourceNav,destNav);	
		if (clickedNav && sourceNav) {	
			if (SB_CURRENT_SECTION_ROLLOVER) sb_sectionClear(SB_CURRENT_SECTION_ROLLOVER.navName);
			//sb_navRollOver(clickedNav);		
			sb_sectionHighLight(clickedNav);			
			SB_CURRENT_SECTION_ROLLOVER = new sb_currentSectionRollOver(clickedNav);		
			return;				
		}
		
		if (sourceNav && !clickedNav) {		
			//sb_sectionHighLight(sourceNav);
			sb_navRollOver(sourceNav);		
			SB_CURRENT_SECTION_ROLLOVER = new sb_currentSectionRollOver(sourceNav);								
			return;
		} 
		
	} else {
		sb_navRollOver(sourceNav);
		SB_CURRENT_SECTION_ROLLOVER = new sb_currentSectionRollOver(sourceNav);							
		return;
	}	
}
/* ------------------------------------------
Function name  - sb_getSectionName2
Description - Called by sb_setNavState when the page first loads.
			  This function returns the folder name (or the names of 
			  two consecutive folders) at various depths.
------------------------------------------	*/
function sb_getSectionName2(depth) {
	// MAKE REGEX
	var serverURL = new String(document.location);
	//remove http://
	serverURL = serverURL.substring(7);
	var lBound;
	
	if (serverURL.indexOf("/jsp/") != -1) {
		lBound = serverURL.indexOf("/jsp/") + 5;
	} else if ((typeof baseHTMLDir_FromSiteConfig != 'undefined') && (baseHTMLDir_FromSiteConfig != "") && (serverURL.indexOf(baseHTMLDir_FromSiteConfig+"/") != -1)) {
		lBound = serverURL.indexOf(baseHTMLDir_FromSiteConfig+"/") + baseHTMLDir_FromSiteConfig.length + 1;
	} else if (serverURL.indexOf("/content/") != -1) {
		lBound = serverURL.indexOf("/content/") + 9;
	}
	
	var dest1 = serverURL.substring(lBound);
	var dest2;
	var rBound = dest1.indexOf("/");
	var dirName;	
	
	// Look for a combination of the first folder name and the second
	if (depth == 0) {
		dirName = dest1.substring(0,rBound);
		dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dirName + "___" + dest2.substring(0,rBound);
		
	// Look for a combination of the second folder name and the third
	} else if (depth == 1) {
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dirName + "___" + dest2.substring(0,rBound);
		
	// Look for a combination of the second folder name and the third
	} else if (depth == 2) {
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dirName + "___" + dest2.substring(0,rBound);
		
	// Look for a combination of the third folder name and the fourth
	} else if (depth == 3) {
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dirName + "___" + dest2.substring(0,rBound);
		
	// Look for a combination of the fourth folder name and the fifth
	} else if (depth == 4) {
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dest1 = dest1.substring(rBound+1);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		rBound = dest1.indexOf("/");
		dirName = dest1.substring(0,rBound);
		dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dirName + "___" + dest2.substring(0,rBound);	
		
	// Look for the first folder name 
	} else if (depth == 5) {
		dirName = dest1.substring(0,rBound);

	// Look for the second folder name 
	} else if (depth == 6) {
		var dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dest2.substring(0,rBound);
				
	// Look for the third folder name 
	} else if (depth == 6) {
		var dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dest2.substring(0,rBound);
		
	// Look for the fourth folder name 
	} else if (depth == 7) {
		var dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dest2.substring(0,rBound);
						
	// Look for the fifth folder name 	
	} else {
		var dest2 = dest1.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dest2 = dest2.substring(rBound+1);
		rBound = dest2.indexOf("/");
		dirName = dest2.substring(0,rBound);
	}
	
	return dirName;
}

/*------------------------------------------
Function name  - sb_navShow2
Description - Attempts to find the div
with the id specified by 'nav'. If found,
the div is shown, a "shim" div is hidden,
and the function returns true.  Else it
returns false.
------------------------------------------	*/
function sb_navShow2 (nav) {
	var navRef;
	var shimRef;
 	
	// Get References to Objects
	if (SB_BROWSER.dom) {
		navRef = document.getElementById(nav);
		shimRef = document.getElementById("shimDiv");
	} else {
		navRef = eval(document.layers[nav]);
		shimRef = eval(document.layers["shimDiv"]);
	}
	
	if (! navRef) { // Can't fint objects, so return
		return false; 
	}
	
	// Objects found, show objects
	navRef.style.display = "";// : navRef.visibility = "hide";
	shimRef.style.display = "none";
	return true;
	
}
function sb_getHighlightName() {
	// MAKE REGEX
	var serverURL = new String(document.location);
	// remove http://
	serverURL = serverURL.substring(7);
	
	var lBound;
	if ((typeof baseHTMLDir_FromSiteConfig != 'undefined') && (baseHTMLDir_FromSiteConfig != "")) {
		lBound = serverURL.indexOf(baseHTMLDir_FromSiteConfig+"/");
	} else {
		lBound = serverURL.indexOf("/content/");
	}
	
	var pathName = serverURL.substring(lBound);
	return pathName;
}

/* DUMMY FUNCTION FOR TEMPORARY COMPATIBILITY */ 
function setNavState2()
{
	sb_setNavState();
}

/* ------------------------------------------
Function name  - sb_setNavState
Description - Obsolete
------------------------------------------	*/
function sb_setNavState() {
}

/*------------------------------------------
Function name  - sb_getCurrentPage
Description - used to return the current page
------------------------------------------*/
function sb_getCurrentPage()
{
	if (! SB_BROWSER.dom) return;
	var serverURL = new String(document.location);
	//var serverURL = new String("http://merck-dev/dir1/dir2/dir3/alpha_index.html");
	//var pathMatches = serverURL.match(/\/[a-zA-Z0-9_.]+/gi);
	//var pathMatches = serverURL.match(/\/\/.+/gi);
	//var pathMatches = serverURL.match(/\/\/[a-zA-Z0-9_.]+/gi);	
	var pathMatches  = serverURL.match(/\/\/([a-zA-Z0-9\W][^\/]+)\/([a-zA-Z0-9\W][^\/].+)/gi);
	var currentDir = "";
	window.status = "currentDir " + pathMatches + "length " + pathMatches.length;
	//alert("serverURL " + serverURL + "\n currentDir " + currentDir  + "\n pathMatches " + pathMatches + "\n pathMatches.length  " + pathMatches.length );
	return currentDir;
}

/*------------------------------------------
Function name  - sb_getCurrentDir
Description - used to return the current directory
------------------------------------------*/
function sb_getCurrentDir()
{
	if (! SB_BROWSER.dom) return;
	var serverURL = new String(document.location);
	//var serverURL = new String("http://merck-dev/dir1/dir2/dir3/alpha_index.html");
	var pathMatches = serverURL.match(/\/[a-zA-Z0-9_]+/gi);
	var currentDir = "";
	if (pathMatches.length >  3) 
	{
		var offset = (pathMatches.length -2);
		currentDir = new String(pathMatches[offset]);
		currentDir = currentDir.substr(1,currentDir.length);
	} else {
		currentDir = "home";
	}
	//alert("serverURL " + serverURL + "\n currentDir " + currentDir  + "\n pathMatches " + pathMatches + "\n pathMatches.length  " + pathMatches.length );
	return currentDir;
}
/* ------------------------------------------
Function name  - sb_getSelectedNode
Description - used to return the currently selected node from the URL
------------------------------------------	*/
function sb_getSelectedNode()
{
	if (! SB_BROWSER.dom) return;
	var serverURL = new String(document.location);
	var selectedNode = new String(serverURL.match(/\?SN=\w+/gi));
	if ((selectedNode) &&  (selectedNode != ""))
	{
		selectedNode = 	selectedNode.substr(4,selectedNode.length);
	} 
	return selectedNode;
}
/* ------------------------------------------
Function name  - sb_sitemapObj
Description - used to create a collection of nav items
------------------------------------------	*/
function sb_sitemapObj(){
	this.n = new Array();
	this.nodeCounter = 0;
	return this;
}
/* ------------------------------------------
Function name  - sb_siteAreaObj
Description - used to create a collection of nav items
------------------------------------------	*/
function sb_siteAreaObj(sectionName) {
	this.sectionName = sectionName;
	this.nodeCollection = new Array();
	this.nodeCounter = 0;
	return this;
}

/* ------------------------------------------
Function name  - sb_n (navObj)
Description - used to create nav item objects and set its properties 
			This helps keep the include size down.
------------------------------------------	*/
function sb_n(itemLabel, itemUrl, itemLevel) {
	this.itemLabel = itemLabel;
	this.itemUrl = itemUrl;
	this.itemLevel = itemLevel;
	return this;
}
/* ------------------------------------------
Function name  - sb_writeLeftNav
Description - Writes out the HTML for the left nav for the section.
------------------------------------------	 */
function sb_writeLeftNav(sitemap, navIndex) {
	var nodeRef = new sb_nodeObject();
	var sectionCount = 0;
	var level1Count = 0;
	var level2Count = 0;
	var level3Count = 0;
	var navHtml = "";

	if (navIndex == -1) {
		navHtml += "\n" + '<div id="shimDiv"><img src="/site_images/white_pixel.gif" width="154" height="15" alt="" /></div>';
	} else {
	
		navHtml += "\n" + '<div id="' + sitemap.n[navIndex].sectionName + '">';
		navHtml += "\n" + '<table class="navbgMain" width="154" border="0" cellspacing="0" cellpadding="0">';
		
		sectionLength = sitemap.n[navIndex].nodeCollection.length;
		for (i=0; i < sectionLength; i++) {
			currItem = sitemap.n[navIndex].nodeCollection[i];
			if (currItem.itemLevel == 0) {
				navHtml += "\n" + '<tr class="navSection">';
				navHtml += "\n" +  '<td width="10" height="20" class="navSection"><img src="/site_images/s.gif" width="10" height="1" alt="" border="0" /></td>';
				navHtml += "\n" +  '<td width="144" height="20"  colspan="2" class="navSection"><div class="navSection"><a href="' + currItem.itemUrl + '">' + currItem.itemLabel + '</a></div></td>';
				navHtml += "\n" +  '</tr>';
				
				sectionCount++;
				level1Count = 0;
			} else if (currItem.itemLevel == -1) {
				if (level1Count > 0) { // Space above subsection
					navHtml += "\n" + '<tr>';
					navHtml += "\n" +  '<td colspan="3"><img src="/site_images/s.gif" border="0" width="154" height="19" alt="" /></td>';
					navHtml += "\n" +  '</tr>';
				}
				
				navHtml += "\n" +  '<tr>';
				navHtml += "\n" +  '<td class="navSubsection"><img src="/site_images/s.gif" width="10" height="1" alt="" border="0" /></td>';
				navHtml += "\n" +  '<td colspan="2" class="navSubsection"><div class="navSubsection">' + currItem.itemLabel + '</div></td>';
				navHtml += "\n" +  '</tr>';
			} else if (currItem.itemLevel == 1) {
				nodeRef.sb_add(new sb_sectionObject(currItem.itemUrl,"home_"+level1Count));
				
				navHtml +=  "\n" + '<tr onclick="top.location.href=\'' + currItem.itemUrl + '\'" class="navItem1off">';
				navHtml +=  "\n" + '<td><img src="/site_images/s.gif" width="10" height="1" alt="" border="0" /></td>';
				
				if (((i+1) >= sectionLength) || (sitemap.n[navIndex].nodeCollection[i+1].itemLevel < 2)) {
					navHtml +=  "\n" + '<td colspan="2" valign="top" onMouseOver="sb_navFloat(\'home_'+level1Count+'\')" onMouseOut="sb_navFloat(\'home_'+level1Count+'\')">';
					navHtml +=  "\n" + '<div id="home_'+level1Count+'" class="navItem1off">';
					navHtml +=  "\n" + '<a href="'+currItem.itemUrl+'" class="navItem1">' + currItem.itemLabel + '</a></div></td>';
				} else {
					navHtml +=  "\n" + '<td colspan="2" onMouseOut="sb_floatHide()"  onMouseOver="sb_navFloat(\'home_'+level1Count+'\',\'home_'+level1Count+'_0\')"><div class="navItem1off" id="home_'+level1Count+'"><a ';
					navHtml +=  "\n" + 'href="javascript:sb_navExpand(\''+currItem.itemUrl+'\')" class="navItem1">' + currItem.itemLabel + '</a></div></td>';
				}
				navHtml +=  "\n" + '</tr>';
			
				// If this is not the last item...
				if ((i+1) < sectionLength) {
					// If there are no flyouts, create dummy row and draw bottom rule
					if (sitemap.n[navIndex].nodeCollection[i+1].itemLevel < 2) {
						navHtml +=  "\n" + '<tr><td colspan="3" valign="top">';
						navHtml +=  "\n" + '<div id="dummy_0_'+level1Count+'" style="VISIBILITY: hidden; POSITION: absolute;">';
						navHtml +=  "\n" + '<img src="/site_images/s.gif" border="0" width="10" height="1" alt="" />';
						navHtml +=  "\n" + '</div></td></tr>';
						
						navHtml +=  "\n" + '<tr>';
						navHtml +=  "\n" + '<td width="10" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="10" height="1" alt="" /></td>';
						navHtml +=  "\n" + '<td width="2" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="2" height="1" alt="" /></td>';
						navHtml +=  "\n" + '<td width="140" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="140" height="1" alt="" /></td>';
						navHtml +=  "\n" + '</tr>';
						level1Count++;
						
					// Start flyout
					} else {
						navHtml +=  "\n" + '<tr>';
						navHtml +=  "\n" + '<td colspan="3" valign="top">';
						navHtml +=  "\n" + '<div id="home_'+level1Count+'_0" style="VISIBILITY: hidden; POSITION: absolute;" onMouseOver="sb_floatShow()" onMouseOut="sb_floatHide()">';
						navHtml +=  "\n" + '<table class="navbgFlyout" border="0" cellspacing="0" cellpadding="0" width="153">';
	
					}
				// This is the last item, draw bottom rule
				} else if ((i+1) == sectionLength) {
					navHtml +=  "\n" + '<tr>';
					navHtml +=  "\n" + '<td width="10" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="10" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="2" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="2" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="140" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="140" height="1" alt="" /></td>';
					navHtml +=  "\n" + '</tr>';
					
					level1Count++;
				} // end no flyouts
				
				level2Count = 0;
			} else if (currItem.itemLevel == 2) {
				nodeRef.sb_add(new sb_sectionObject(currItem.itemUrl,"home_"+level1Count+"_0_"+level2Count));
				
				navHtml +=  "\n" + '<tr height="20" onmouseover="sb_navRollOver(\'home_'+level1Count+'_0_'+level2Count+'\')" onmouseout="sb_navRollOver(\'home_'+level1Count+'_0_'+level2Count+'\')" onclick="top.location.href=\'' + currItem.itemUrl + '\'" class="navItem2off">';
				navHtml +=  "\n" + '<td valign="top"><img src="/site_images/s.gif" width="20" height="1" alt="" border="0" /></td>';
				navHtml +=  "\n" + '<td colspan="2">';
				navHtml +=  "\n" + '<div id="home_'+level1Count+'_0_'+level2Count+'" class="navItem2off"><a href="' + currItem.itemUrl + '" class="navItem2">' + currItem.itemLabel + '</a></div>';
				navHtml +=  "\n" + '</td>';
				navHtml +=  "\n" + '</tr>';
				
				// If this is the last Item in the flyout, close the flyout
				if (((i+1) >= sectionLength) || (sitemap.n[navIndex].nodeCollection[i+1].itemLevel < 2)) {
					navHtml +=  "\n" + '</table>';
					navHtml +=  "\n" + '</div>';
					navHtml +=  "\n" + '</td>';
					navHtml +=  "\n" + '</tr>';
					
					navHtml +=  "\n" + '<tr>';
					navHtml +=  "\n" + '<td width="10" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="10" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="2" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="2" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="140" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="140" height="1" alt="" /></td>';
					navHtml +=  "\n" + '</tr>';
				
					level1Count++;
				}
				level2Count++;
			} else if (currItem.itemLevel == 3) {
				nodeRef.sb_add(new sb_sectionObject(currItem.itemUrl,"home_"+level1Count+"_0_"+level2Count+"_"+level3Count));
				
				navHtml +=  "\n" + '<tr height="20" onmouseover="sb_navRollOver(\'home_'+level1Count+'_0_'+level2Count+'_'+level3Count+'\')" onmouseout="sb_navRollOver(\'home_'+level1Count+'_0_'+level2Count+'_'+level3Count+'\')" onclick="top.location.href=\'' + currItem.itemUrl + '\'" class="navItem3off">';
				navHtml +=  "\n" + '<td valign="top"><img src="/site_images/s.gif" width="20" height="1" alt="" border="0" /></td>';
				navHtml +=  "\n" + '<td valign="top"><img src="/site_images/s.gif" width="10" height="1" alt="" border="0" /></td>';
				navHtml +=  "\n" + '<td colspan="1">';
				navHtml +=  "\n" + '<div id="home_'+level1Count+'_0_'+level2Count+'_'+level3Count+'" class="navItem3off"><a href="' + currItem.itemUrl + '" class="navItem3">' + currItem.itemLabel + '</a></div>';
				navHtml +=  "\n" + '</td>';
				navHtml +=  "\n" + '</tr>';
					
					// If this is the last Item in the flyout, close the flyout
				if (((i+1) >= sectionLength) || (sitemap.n[navIndex].nodeCollection[i+1].itemLevel < 2)) {
					navHtml +=  "\n" + '</table>';
					navHtml +=  "\n" + '</div>';
					navHtml +=  "\n" + '</td>';
					navHtml +=  "\n" + '</tr>';
					
					navHtml +=  "\n" + '<tr>';
					navHtml +=  "\n" + '<td width="10" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="10" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="2" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="2" height="1" alt="" /></td>';
					navHtml +=  "\n" + '<td width="140" height="1" class="navRule"><img src="/site_images/s.gif" border="0" width="140" height="1" alt="" /></td>';
					navHtml +=  "\n" + '</tr>';
				
					level1Count++;
				}
				level3Count++;	
			}
		} // end for
		
		navHtml +=  "\n" + '</table>';
		
		if (level1Count > 0) {
			navHtml +=  "\n" + '<table border="0" cellpadding="0" cellspacing="0">';
			navHtml +=  "\n" + '<tr>';
			navHtml +=  "\n" + '<td height="20"><img src="/site_images/s.gif" width="1" height="1" alt="" /></td>';
			navHtml +=  "\n" + '</tr>';
			navHtml +=  "\n" + '</table>';
		}
		
		navHtml +=  "\n" + '</div>';
	}
	//alert(navHtml);
	document.write(navHtml);
	document.close();
	return nodeRef;
}

/* ------------------------------------------
Function name  - sb_genLeftNav
Description - Writes out the correct left nav for the section.
			Takes an array of left navs as an arguement.
------------------------------------------	*/
function sb_genLeftNav(sNav) {
	var sectionName = "";
	var foundNav = false;
	var foundNum = -1;	
	var sitemap = getSitemap();
	var sitemapLength = sitemap.n.length;

	for (i=0; i < 7 && !foundNav; i++) {
		sectionName = sb_getSectionName2(i);
		if (sectionName != "") {
			for (j=0; j < sitemapLength && !foundNav; j++) {
				if (sectionName == sitemap.n[j].sectionName) {
					foundNav = true;
					foundNum =  j;
				}
			}
		}
	}
	
	var pageMappings = sb_writeLeftNav (sitemap, foundNum);
	var currentPage = new String(document.location);
	var linkPath = sb_getHighlightName();

	var linkNode;
	if (SB_BROWSER.dom) {
		linkNode = document.getElementById(linkPath);
	} else {
		linkNode = eval(document.layers[linkPath]);
		if (! linkNode) linkNode = document.layers[SB_CURRENT_NAV.navName].layers[linkPath];
	}

	if (linkNode) {
		if (linkNode.name == "childNode") {
			if (SB_BROWSER.dom)
			{	
				linkNode = document.getElementById(linkNode.parent);
			} else {
				linkNode = eval(document.layers[linkNode.parent]);
				if (! linkNode) linkNode = document.layers[SB_CURRENT_NAV.navName].layers[linkNode.parent];
			}
		}
		sb_navRollOver(linkNode);
		// Show child node if it exists
		sb_navShow2(linkNode.id+"_childNode");
	}

	// Search through the pageMappings for the current page
	// Expand and highlight the correct Div if the current page is found
	for (c=0;c<pageMappings.nodeCollection.length;c++) {
		var pageName = new String(pageMappings.nodeCollection[c].sectionName);
		//alert(pageMappings.nodeCollection[c].sectionName + "\n" + currentPage + "\n" + currentPage.indexOf(pageName));		
		if (currentPage.indexOf(pageName) != -1) {
			sb_navDockMenu(pageMappings.nodeCollection[c].sectionDiv);
			//break;
			return;
		}
	}

	// Search through the pageMappings for the folder path of the current page
	// Expand and highlight the correct Div if one and only one page with the same folder path is found
	var sectionFolder = new String(location.pathname); // Get path of page
	var selectionDiv = "";
	var dupSelection = false;
	if (sectionFolder.indexOf("/htdocs") != -1) { //strip off excess folders
		sectionFolder = sectionFolder.substr(sectionFolder.indexOf("/htdocs") + 7, sectionFolder.length);
	}
	if (sectionFolder.indexOf("/java") != -1) {//strip off excess folders
		sectionFolder = sectionFolder.substr(sectionFolder.indexOf("/java") + 5, sectionFolder.length);
	}
	sectionFolder = sectionFolder.substr(0, sectionFolder.lastIndexOf("/")); //strip off file name
	//alert("sectionFolder  = " + sectionFolder);
	
	for (c=0;c<pageMappings.nodeCollection.length && !dupSelection;c++) {
		pageFolder = pageMappings.nodeCollection[c].sectionName;
		pageFolder = pageFolder.substring(0, pageFolder.lastIndexOf("/"));
		if (pageFolder == sectionFolder) {
			// check for another file with the same path that has already been found
			if (selectionDiv == "") {
				selectionDiv = pageMappings.nodeCollection[c].sectionDiv;
			} else {
				dupSelection = true;
				break;
			}
		}
	}
	if (!dupSelection) {
		sb_navDockMenu(selectionDiv);
	}
}

//load additional script files
document.write("<script language='JavaScript1.2' src='/scripts/sniffer.js'></script>");
document.write("<script language='JavaScript1.2' src='/scripts/dhtml_menus.js'></script>");
document.write("<script language='JavaScript1.2' src='/scripts/dhtml_utilities.js'></script>");
document.write("<link rel='stylesheet' href='/styles/nav.css' type='text/css' />");

