/* 
	Dynamic Menu 4.0

	Written By:  AA
	Created on:  July 14 2000.
	
	Last Modified on:
	
	April 29, 2005		-- Added a better support for contextual CSS on the <a> tag. Must use dhtmlMenu ID, see "menu_style.css"
						   Changed the Menu Structure, there are 5 items in each array, insted of 6.
	April 1, 2004		-- Fixed a bug for extrnal Links. 
	March 30, 2004		-- Added support for subfolders and resolved the issue with menu images not found. 
						   Also, added was the better way to suppor for the hanging menu on <img name="menu".....> property.
	October 9, 2003		-- Added a place holder for the menu. a blank image with name of "menu" must be present in the page.
	May 5, 2003			-- Separated Menu attributes and settings from nav.js
	May 1, 2003			-- Improving the Tooltip positioning.
	April 7, 2003		-- Added more flexibility for design and ToolTip.
	April 2, 2003		-- Added Tooltip Layer capability
	October 23, 2001	-- Added support for Netscape 6.0
*/


// these variables write the proprietary tags for netscape or ie 
 
var whichInclude, whichTag, styley, pos, rel, absol, stat, wid, hei, lef, topp, zInd, vis, hid, vsbl, dis, disblo, disnone, clo, closer 
if (isNav) { 
	whichTag = "<layer name=" 
	styley = ""	 
	pos = "" 
	absol = "" 
	rel = "" 
	stat = ""
	wid = " width=" 
	hei = " height=" 
	lef = " left=" 
	topp = " top=" 
	zInd = " z-index=" 
	vis = " visibility=" 
	hid = "hide" 
	visbl = "show" 
	dis = "" 
	disnone = "" 
	disblo = "" 
	clo = ">" 
	closer = "</layer>" 
} else if(isNS6) { 
	whichTag = "<div id=" 
	styley = " style='" 
	pos = "position:" 
	rel = "relative; " 
	absol = "absolute; " 
	stat = "static; "
	wid = "width:" 
	hei = "; height:" 
	lef = "; left:" 
	topp = "; top:" 
	zInd = "; z-index:" 
	vis = "; visibility:" 
	hid = "hidden" 
	visbl = "visible" 
	dis = "; display:" 
	disnone = "none" 
	disblo = "block" 
	clo = "'>" 
	closer = "</div>" 
}else { 
	whichTag = "<div id=" 
	styley = " style='" 
	pos = "position:" 
	rel = "relative; " 
	absol = "absolute; " 
	stat = "static; "
	wid = "width:" 
	hei = "; height:" 
	lef = "; left:" 
	topp = "; top:" 
	zInd = "; z-index:" 
	vis = "; visibility:" 
	hid = "hidden" 
	visbl = "visible" 
	dis = "; display:" 
	disnone = "none" 
	disblo = "block" 
	clo = "'>" 
	closer = "</div>" 
} 
 
// preloads left navigation's tracking arrows 
arrow = new Image(); arrow.src=progURL+"images/spacer.gif"; 
arrow2 = new Image(); arrow2.src=progURL+"images/spacer.gif"; 
cracker = new Image(); cracker.src=progURL+"images/spacer.gif"; 
 
// creates arrays for netscape's layers 
document.nav = new Object(); 
document.nav.menu = new Object(); 
document.nav.menu.expand = new Array(); 
document.nav.menu.height = new Array(); 
 
var isInitialized = "un-initialized" 
var whichCollapsed = "none"; 
// this function opens and closes the navigation 
function collapse(ditem) { 
	if (isIE) { 
		var theChildLayer = eval("document.all.Links" + ditem + "Child.style"); 
		if (theChildLayer.display == "none") { 
			theChildLayer.display = "block"; 
		} else { 
			theChildLayer.display = "none"; 
		} 
	} else if (isNav) { 
	    if(document.nav.menu.expand[ditem + 1].clip.bottom == 0) { 
	       	document.nav.menu.expand[ditem + 1].clip.bottom = document.nav.menu.height[ditem + 1]; 
	           if(document.nav.menu.expand[ditem].document.images[0]) { 
	        } 
	    } else { 
	       	document.nav.menu.expand[ditem + 1].clip.bottom = 0; 
	           if(document.nav.menu.expand[ditem].document.images[0]) { 
	        } 
	    } 
	    align(); 
	} else if (isNS6) {  //Mozilla 5.0 implimentation goes here.
		var link1 = "Links"+ditem+"Child";
		var theChildLayer = document.getElementById(link1); 
		if (theChildLayer.style.display == "none") { 
			theChildLayer.style.display = "block"; 
		} else { 
			theChildLayer.style.display = "none"; 
		}	
	} 
	if (whichCollapsed != "none") {collapse2(whichCollapsed)} 
	if (isInitialized == "initialized") {whichCollapsed = ditem} 
} 


function collapse2(ditem) { 
	if (isIE) { 
		var theChildLayer = eval("document.all.Links" + ditem + "Child.style"); 
		if (theChildLayer.display == "none") { 
			theChildLayer.display = "block"; 
		} else { 
			theChildLayer.display = "none"; 
		} 
	} else if (isNav) { 
	    if(document.nav.menu.expand[ditem + 1].clip.bottom == 0) { 
	       	document.nav.menu.expand[ditem + 1].clip.bottom = document.nav.menu.height[ditem + 1]; 
	           if(document.nav.menu.expand[ditem].document.images[0]) { 
	        } 
	    } else { 
	       	document.nav.menu.expand[ditem + 1].clip.bottom = 0; 
	           if(document.nav.menu.expand[ditem].document.images[0]) { 
	        } 
	    } 
	    align(); 
	} else if (isNS6) {  //Mozilla 5.0 implimentation goes here.
		var link2 = "Links"+ditem+"Child";
		var theChildLayer = document.getElementById(link2);
		if (theChildLayer.style.display == "none") { 
			theChildLayer.style.display = "block"; 
		} else { 
			theChildLayer.style.display = "none"; 
		}	
	} 

} 
 
// this function takes the navigation layers from the array (loaded in InitializeToolbar and positions them 
function align() { 
	var i,j,stupid_netscape_array_infinate_loop_error; 
    stupid_netscape_array_infinate_loop_error = document.nav.menu.expand.length; 
    for(i=0; i<stupid_netscape_array_infinate_loop_error; i++) { 
    	j = i + 1; 
        if(document.nav.menu.expand[j]) { 
            document.nav.menu.expand[j].top = document.nav.menu.expand[i].top + document.nav.menu.expand[i].clip.bottom; 
        } 
    } 
} 
 
// this function loads all the layers within the "container" layer into an array to be used for positioning in the align function 
function initializeToolbar() { 
	if (isIE) { 
		document.all.container.style.visibility = "visible" 
	} else if (isNav) { 
		for(i=0; i<document.layers['container'].document.layers.length; i++) { 
	    	document.nav.menu.expand[i] = document.layers['container'].document.layers[i]; 
		    document.nav.menu.height[i] = document.nav.menu.expand[i].clip.bottom; 
	  	} 
	  	for (p=0;p<document.nav.menu.expand.length;p=p+2) { 
	    	collapse(p); 
	    } 
		document.layers['container'].visibility = 'visible'; 
	} else if (isNS6) {
		document.getElementById('container').style.visibility="visible";
	}
	isInitialized = "initialized" 
} 
 
// these variables track which arrow is highlighted 
var oldHead = "none" 
var oldSub = 0 
 
// this function tracks the mouseOvers on the navigation and highlights accordingly 
function arrowChange(whichHead,whichSub) { 
	if (oldHead != "none") { 
		var theOldImg = eval("fixImg2('Links" + oldHead + "Img','container','Links" + oldHead + "Parent')") 
		theOldImg.src=cracker.src 
	} 
	if (whichHead != "allOff") { 
		var theImg = eval("fixImg2('Links" + whichHead + "Img','container','Links" + whichHead + "Parent')") 
		theImg.src=arrow.src 
	} 
	if (oldSub != 0) { 
		var theOldImg2 = eval("fixImg2('Links" + oldHead + "Img" + oldSub + "','container','Links" + oldHead + "Child')") 
		theOldImg2.src=cracker.src 
	} 
	if (whichSub != 0 && whichHead != "allOff") { 
		var theImg2 = eval("fixImg2('Links" + whichHead + "Img" + whichSub + "','container','Links" + whichHead + "Child')") 
		theImg2.src=arrow2.src 
	}  
	if (whichHead != "allOff") { 
		oldHead = whichHead; 
		oldSub = whichSub; 
	} else { 
		oldHead = "none"; 
		oldSub = 0 
	} 
}

