// FUNCTIONS BELOW HANDLE THE DISPLAY OF MENUS FOR THE "NAVIGATE" BUTTON ON SUB/SUB-SUB PAGES OF LFS SITE
// REFERENCES:
// 			SOURCE FOR NAVIGATION ELEMENTS			- incHeader.asp
// 			JAVASCRIPT MENU ARRAYS 					- incArray_sub.asp
// 			STYLESHEET TO CONTROL MENU DISPLAY 		- dhtmlmenu_sub.css
// ******************************************************************************************************
function DebugAlert(strMessage){

	if (event.altKey) {
		
		alert('.'+strMessage)
		
	}
}


// LOCAL VARIABLES:
var objSF;
var objReset = false;
var bObj = false;
var ary = new Array();
var deptHi;
var menuTimeout;
var bOver = false;
var i = 0;
var blnNavigator = false;
var blnQuickLinks = false;
var blnMyTools = false;
var blnSiteTools = false;
var blnLeftNav = false;
var lngMaxLevel = 0;
var blnGoHref = false;
var blnOnLoad = true;
var blnResized = false;
var blnDisableLeftNav;
var lngMaxWidth;

blnDisableLeftNav = WM_readCookie('LeftNavDisabled')
//alert( blnDisableLeftNav );
lngMaxWidth = 130;

function openApplication(app, exe) 
{	
	// launch selected application
	//
	// CJH 5/13/2002
			
	// ASSUMPTIONS
	// 1. must modify IE security setting to allow ActiveX controls for this to work; recommend "prompt"
	//    or... URL must be in an IE security zone which allows ActiveX controls (e.g. http://intranet)
	// 2. Windows Scripting Host must be installed and registered (WScript); by default with IE 5.5
	// 3. apps will only launch if exe resides inside a directory contained in the Windows Path environment variable
			
	var windowStyle = 1;
	var waitOnReturn = false;
	var shell;
			
	try
	{
		shell = new ActiveXObject("WScript.Shell");
		shell.Run(exe, windowStyle, waitOnReturn);
	}
	catch(e)
	{	
		// error + [carriage return, line feed] + error detail
		alert('An error occurred while launching the application. \u000A\u000D\u000A\u000D' + e);
	}
			
}
		
/**********************************************
 *
 * Utility Functions
 *   
 **********************************************/
 
/**********************************************
 *
 * getMenuType -- gets the current menu type 
 *    firing an event
 *   
 *********************************************/
function getMenuType(){
	if (blnNavigator) {
		return 'dept'
	}else if (blnQuickLinks){
		return 'link'
	}else if (blnMyTools){
		return 'link'
	}else if (blnSiteTools){
		return 'link'
	}else if (blnLeftNav){
		return 'left'
	}else{
		return 'dept'
	}

}

/**********************************************
 *
 * IsObject -- returns true if there is an object
 *    with the inputted name
 *   
 *********************************************/

function isObject(strName){
	if (document.all[strName] == null){
		return false
	}else{
		return true
	}
	
}

/**********************************************
 *
 * hideNavigator -- hides the navigator root menu
 *    and shows all form elements.
 *   
 *********************************************/
function hideNavigator(){
	unhighlight(objSF);
	if (blnNavigator) {
		root1.style.visibility = "hidden";
		hideNonRootMenus('dept');
		unhighlightAll(document.all['root1'].firstChild.firstChild.firstChild.firstChild.firstChild.firstChild);
		blnNavigator = false;
		showForm();
		showIForm();
	}
}

/**********************************************
 *
 * hideNavigatorFromIFrame -- hides the navigator root menu
 *    and shows all form elements.
 *   
 *********************************************/
function hideNavigatorFromIFrame(){
	var d=top.parent.document;
	unhighlight(objSF);
	
	d.all['root1'].style.visibility = "hidden";
	hideNonRootMenusIFrame('dept');
	unhighlightAll(d.all['root1'].firstChild.firstChild.firstChild.firstChild.firstChild.firstChild, false);
	showIframeForm();
	//showIForm();
	
}

/**********************************************
 *
 * hideQuickLinks -- hides the quicklinks root menu
 *    and shows all form elements.
 *   
 *********************************************/
function hideQuickLinks(){
	unhighlight(objSF);
	if (blnQuickLinks) {
		root2.style.visibility = "hidden";
		hideNonRootMenus('link');
		unhighlightAll(document.all['root2'].firstChild.firstChild.firstChild.firstChild.firstChild.firstChild, true);
		blnQuickLinks = false;
		showForm();
		showIForm();
	}
}

/**********************************************
 *
 * hideSiteTools -- hides the quicklinks root menu
 *    and shows all form elements.
 *   
 *********************************************/
function hideSiteTools(){
	unhighlight(objSF);
	if (blnSiteTools) {
		root4.style.visibility = "hidden";
		hideNonRootMenus('sitetools');
		unhighlightAll(document.all['root4'].firstChild.firstChild.firstChild.firstChild.firstChild.firstChild, true);
		blnSiteTools = false;
		showForm();
		showIForm();
	}
}

/**********************************************
 *
 * hideMyTools -- hides the quicklinks root menu
 *    and shows all form elements.
 *   
 *********************************************/
function hideMyTools(){
	unhighlight(objSF);
	if (blnMyTools) {
		root3.style.visibility = "hidden";
		hideNonRootMenus('mytools');
		unhighlightAll(document.all['root3'].firstChild.firstChild.firstChild.firstChild.firstChild.firstChild, true);
		blnMyTools = false;
		showForm();
		showIForm();
	}
}

/**********************************************
 *
 * showMenu -- shows the Navigator or Quick Link
 *   root menu (hiding form elements and the left nav)
 *   
 *********************************************/	
function showMenu(strMenuType){
	if(top.blnNavLoaded)
	{

		hideMyTools();
		hideSiteTools();
		hideQuickLinks();
		hideNavigator();
		hidingFrom();
//alert('showMenu');
		if(strMenuType == 'dept'){
			blnNavigator = true;
			checkWidth(root1)
			root1.style.visibility = "visible";
		} else if (strMenuType == 'link') {
			blnQuickLinks = true;
			checkWidth(root2)
			root2.style.visibility = "visible";
		} else if (strMenuType == 'mytools') {
			blnMyTools = true;
			checkWidth(root3)
			root3.style.visibility = "visible";
		} else if (strMenuType == 'sitetools') {
			blnSiteTools = true;
			checkWidth(root4)
			root4.style.visibility = "visible";
		}

		if(blnLeftNav){
			hideLeftMenus();
		}
		return false;
	}
}

/**********************************************
 *
 * hideMenus -- OnLoad, it resizes the left Nav 
 *   table cell if it exists.  If there is a type of menu
 *   open (left nav, top nav, quick links), it hides them.
 *   
 *********************************************/	
function hideMenus(){
	checkForm();
	var strMenuType = getMenuType();
	if (blnOnLoad && document.all['NavMain']){
		blnOnLoad = false
		if (!blnDisableLeftNav || (blnDisableLeftNav == "false")){
			resizePageBottom()
		}
	}

	if (strMenuType != '') {
		hideNavigator();
		hideSiteTools();
		hideMyTools();
		hideQuickLinks();
		//if coming from IFrame we need to hide navigator
		try
		{
			var d=top.parent.document;
			hideNavigatorFromIFrame();
		}
		catch(er){
		// do nothing
		}

		for(var i = 0; i < ary.length; i++){
			if (isObject(strMenuType+i)){
				document.all[strMenuType+i].visibility = "hidden";
			}
		}
	}
}

/*************************************************
 *
 * This function resizes the bottom of the page 
 * 
 *************************************************/
function resizePageBottom(){
	if (!blnResized){
		document.all['NavMain'].style.height=getHeight(document.all['root']);
		blnResized = true;	
	}
}

/**********************************************
 *
 * hideNonRootMenus -- Hides All expanded menus
 *   of a given type except for the root menus
 *   (this is used for the Navigator and QuickLinks
 *    only).
 *   
 *********************************************/	
function hideNonRootMenus(strMenuType){
	//if (!bOver){
		if(isObject(objSF)){
			unhighlight(objSF);
		}
		for(var lngCount = 0; lngCount <= lngMaxLevel; lngCount++){
			document.all[strMenuType+lngCount].style.visibility="hidden";
		}
		lngMaxLevel = 0;
	//}
}
/**********************************************
 *
 * hideNonRootMenusIFrame -- Hides All expanded menus
 *   of a given type except for the root menus
 *   (this is used for the Navigator and QuickLinks
 *    only).
 *   
 *********************************************/	
function hideNonRootMenusIFrame(strMenuType){
	var d=top.parent.document;
	lngMaxLevel = 4;
	if(isObject(objSF)){
		unhighlight(objSF);
	}
	for(var lngCount = 0; lngCount <= lngMaxLevel; lngCount++){
		d.all[strMenuType+lngCount].style.visibility="hidden";
	}
	lngMaxLevel = 0;
}
// FUNCTIONS TO CONTROL HIDE/DISPLAY OF MENUS WHEN CURSOR IS OFF THE MENU AREAS:
/**********************************************
 *
 * menuHit -- 
 *   
 *********************************************/	
function menuHit(){
	bOver = true;
}

/**********************************************
 *
 * noMenuHit -- 
 *   
 *********************************************/	
function noMenuHit(){
	bOver = false;
}

/**********************************************
 *
 * arrowOn -- turns an arrow section of a menu on
 *   
 *********************************************/	
function arrowOn(strImageName) {
	if(document.all[strImageName+'on'].style != null && document.all[strImageName+'off'].style != null){
		if (document.all[strImageName+'on'].parentNode.parentNode.className != "arrow") {
			document.all[strImageName+'off'].parentNode.parentNode.className='leftArrowHi';
		}
		document.all[strImageName+'off'].style.display = 'none';
		document.all[strImageName+'on'].style.display  = 'inline';
	}
}

/**********************************************
 *
 * arrowOff -- turns an arrow section of a menu off
 *   
 *********************************************/	
function arrowOff(strImageName) {
	if(document.all[strImageName+'on'].style != null && document.all[strImageName+'off'].style != null){
		document.all[strImageName+'on'].style.display  = 'none';
		document.all[strImageName+'off'].style.display = 'inline';
		if (document.all[strImageName+'on'].parentNode.parentNode.className != "arrow") {
			document.all[strImageName+'off'].parentNode.parentNode.className='leftArrowLo';
		}
	}
}

/**********************************************
 *
 * unhighlight -- unhighlights a menu object
 *   
 *********************************************/	
function unhighlight(objOldSource){
	if (bObj) {
		arrowOff(objOldSource.child)
		objOldSource.style.backgroundColor='#CCCCCC';
		objOldSource.style.color='#333333';
		objOldSource.style.textDecoration='';	
		objOldSource.parentElement.style.cursor='';

	}
}

/**********************************************
 *
 * highlightEventSource -- highlights the source
 *    of the mouseover event
 *   
 *********************************************/	
function highlightEventSource(){
	
	// unhighlight last menu option
	var objOldSource = objSF;
	var strParentID;
	var objParentTable;
		
	//if the source element is not the TD
	if(window.event.srcElement.tagName == "TD"){
		objSF = window.event.srcElement;
	}else{
		objSF = window.event.srcElement.parentElement;
	}
	if (bObj){
		if (objOldSource.child+'Child' != objSF.parentElement.parentElement.parentElement.id){
			unhighlight(objOldSource);
			if (objOldSource.parentElement.parentElement.parentElement.id != objSF.parentElement.parentElement.parentElement.id){
				if(objSF.parentElement.parentElement.parentElement.name == 'QuickLinksRoot'){
					unhighlightAll(objSF.parentElement.parentElement, true);
				}else{
					unhighlightAll(objSF.parentElement.parentElement, false);
				}
			}
		}
	}
		
	
	bObj = true;
	
	arrowOn(objSF.child)
	
	// highlight menu option
	objSF.style.backgroundColor='#ffffff';
	objSF.style.color='#000000';
	if(objSF.href != ''){
		objSF.style.textDecoration='underline';
		objSF.parentElement.style.cursor='hand'
	}else{
		objSF.parentElement.style.cursor='default';
	}
}
/**********************************************
 *
 * unhighlightAll -- unhighlights all of the elements in the table 
 *    of a menu (knows to skip the 3rd element of the
 *    quicklinks menu because it is not a normal element. . .
 *    it is just a white line).
 *   
 *********************************************/	
function unhighlightAll(objTable, blnQuickLinks){
	for(var intCount=1; intCount < objTable.children.length; intCount++){
		if (!(intCount == 3 && blnQuickLinks)){
			unhighlight(objTable.children(intCount).firstChild)
		}
	}
}
/**********************************************
 *
 * hideExtraMenus -- hides any extra menus
 *   
 *********************************************/	
function hideExtraMenus(lngLevel, strMenuType){
	//hide all of the extra levels of menus 
	//except for the child of the item you are on
	if(lngMaxLevel > lngLevel){
		for(var lngCount=lngMaxLevel; lngCount>lngLevel; lngCount--){
			document.all[strMenuType+lngCount].style.visibility="hidden";
		}
	}
	
	lngMaxLevel = lngLevel	
}

/**********************************************
 *
 * genOver -- the mouseover function for the navigator
 *    and the quick links
 *   
 *********************************************/	
function genOver(objDiv){

	var lngLevel
	var strMenuType
	var strParentID

	highlightEventSource();
	
		lngLevel = parseInt(objDiv.id.charAt(4))
		strMenuType = objDiv.id.charAt(0)+objDiv.id.charAt(1)+objDiv.id.charAt(2)+objDiv.id.charAt(3);

		hideExtraMenus(lngLevel, strMenuType)
	
		//if there is a child menu
		//then show it
		if (objSF.child.indexOf('a') >=0) {
			
			objDiv.style.visibility = "hidden";
			objDiv.innerHTML = ary[objSF.child];

			if (checkWidth(objDiv)) {
				ary[objSF.child] = objDiv.innerHTML
			}
			
			var bodyClientHeight = document.body.clientHeight;
			var bodyScrollTop = document.body.scrollTop;
			var dept1OffsetHeight = objDiv.offsetHeight;
	
			//if the menu won't go off of the screen 
			if ((bodyClientHeight - (objSF.offsetTop - bodyScrollTop)) > dept1OffsetHeight) {
				objDiv.style.top = getPageTop(objSF) - (document.all['topBar'].offsetHeight +1);
			}
			else {
				objDiv.style.top = bodyClientHeight - dept1OffsetHeight - 1 + bodyScrollTop;
			}
			
			objDiv.style.left = getPageLeft(objSF.parentElement) + getWidth(objSF.parentElement) -3
			
			objDiv.style.visibility = "visible";
			menuHit();
			
		}else{
		//if there isn't a child menu
		//make sure to hide the child menu div
			objDiv.style.visibility = "hidden";
		}
	
}

/**********************************************
 *
 * checkWidth -- is called on display of a child
 *    menu, and checks it's width.  If it is greater 
 *    than 250 px, then it goes through the menu elements
 *    and shortens any one longer than 240 (10 px are 
 *    for the arrow image on the right).
 *   
 *********************************************/	
function checkWidth(objDiv){
	var objTableRows
	var objSpan
	var strText
	var lngLength
	var lngCount
	var strTemp
	var intMaxLength
	var blnChangedSize
	
	blnChangedSize = false
	
	if (blnNavigator){
		intMaxLength = 250
	}else{
		intMaxLength = 350
	}
	if(objDiv.offsetWidth > intMaxLength){
		objTableRows = objDiv.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild.children
		for(var i=0; i<objTableRows.length; i++){
			objSpan = objTableRows(i).firstChild.firstChild
			if(objSpan.tagName == "SPAN" && objSpan.offsetWidth > (intMaxLength - 10)){
				strText = objSpan.innerHTML
				lngLength = strText.length
				lngCount = 0
				while (objSpan.offsetWidth > (intMaxLength - 10)){
					if (objSpan.offsetWidth > ((intMaxLength - 10) + 50)){
						lngCount = lngCount + 10
						objSpan.innerHTML = strText.substr(0, lngLength - lngCount) + "..."
					}else{
						lngCount++
						objSpan.innerHTML = strText.substr(0, lngLength - lngCount) + "..."						
					}
				}
				blnChangedSize = true
			}
		}

	}
	return blnChangedSize
}


function genOut( objTD ){
	//alert("in genOut of node " + objTD.id);
	noMenuHit();
	
}
// onMouseOut Events:
function sfOut(){
	noMenuHit();
}



// GLOBAL FUNCTIONS TO HANDLE LINKS FOR EACH NAVIGATION ELEMENTS:
// regular <a href> links:
// ***********************
function  goHref(strLink){
	if(strLink != ''){
		hideMenus();
		showForm();
		showIForm();
		blnGoHref=true;
		//document.body.style.cursor='wait';
		//window.event.srcElement.style.cursor='wait';
		document.location = strLink;
	}
}

function goHrefInNew(strLink)
{
	if( strLink != '')
	{
		//open in a new window
		hideMenus();
		showForm();
		showIForm();
		blnGoHref=true;
		window.open( strLink );
	}
}

// links to create pop-ups:
// ************************
function  goHrefNew(){
	window.open(window.event.srcElement.href);
}




//####################################################################################################################
//
// FUNCTIONS BELOW HANDLE THE DISPLAY OF MENUS FOR THE "LEFT-SIDE NAVIGATION" SYSTEM ON SUB/SUB-SUB PAGES OF LFS SITE
// REFERENCES:
// 			SOURCE FOR NAVIGATION ELEMENTS			- incHeader.asp
// 			JAVASCRIPT MENU ARRAYS 					- incLeftNavArray_sub.asp
// 			STYLESHEET TO CONTROL MENU DISPLAY 		- dhtmlmenu_sub.css
// ******************************************************************************************************

// LOCAL VARIABLES:
var objLEFT;
var cObj = false;
var aryLeft = new Array();
var rootHi;
var leftTimeout;
var bOver = false;


// FUNCTIONS TO CONTROL HIDE/DISPLAY OF MENUS WHEN CURSOR IS OFF THE MENU AREAS:
function menuOn(){
	window.clearTimeout(leftTimeout);
	bOver = true;
}

function nomenuOn(){
	bOver = false;
	leftTimeout = window.setTimeout("hideLeftMenus()",500);
}


// FUNCTIONS TO HIDE ALL MENUS:
function hideLeftMenus(){
	if (!bOver){
		for(var lngCount = 0; lngCount <= lngMaxLevel; lngCount++){
			document.all[strMenuType+lngCount].style.visibility="hidden";
		}
		lngMaxLevel = 0;
	}
	showForm();
	showIForm();
	blnLeftNav = false;
}

function hideLeftMenu(){
	bOver = false;
	subroot1.style.visibility = "hidden";
}


function leftOver(blnCurrentItem)
{
	if (!blnDisableLeftNav || (blnDisableLeftNav == "false"))
	{
		hideMenus();
		//hidingFrom();
		menuOn();
		blnLeftNav = true;
		objLEFT = window.event.srcElement;
		if(blnCurrentItem){
			objLEFT.style.textDecoration = 'underline'
			//objLEFT.className = "navLo";
		}else{
			if(objLEFT.href == ""){
				objLEFT.style.cursor='default';	
			}
			objLEFT.className = "navHi";	
		}
	}
}

function leftOut(blnCurrentItem)
{
	if(!blnDisableLeftNav || (blnDisableLeftNav == "false")){
		if(!blnNavigator && !blnQuickLinks){
			if(blnCurrentItem){
				objLEFT.style.textDecoration = ''
				//window.event.srcElement.className = "navHi";
			}else{
				window.event.srcElement.className = "navLo";
			}
			//nomenuOn();
		}	
	}
}
// FUNCTIONS TO CONTROL ONMOUSEOVER/ONMOUSEOUT EVENTS FOR LEFT NAVIGATION MENU ITEMS (ROOT):
// onMouseOver Event:
function onA(objDiv, blnCurrentItem){
	if (!blnDisableLeftNav || (blnDisableLeftNav == "false")){
	if(!blnNavigator && !blnQuickLinks){
	hideMenus();
	hidingFrom();
	menuOn();
	
	blnLeftNav = true;
	
	lngLevel = parseInt(objDiv.id.charAt(4))
	strMenuType = objDiv.id.charAt(0)+objDiv.id.charAt(1)+objDiv.id.charAt(2)+objDiv.id.charAt(3);
	
	hideExtraMenus(lngLevel, strMenuType)
	objLEFT = window.event.srcElement;
	if(blnCurrentItem){
		objLEFT.style.textDecoration = 'underline'
		//objLEFT.className = "navLo";
	}else{
		if(objLEFT.href == ""){
			objLEFT.style.cursor='default';	
		}
		objLEFT.className = "navHi";
		arrowOn(objLEFT.child);		
	}
	
	if (aryLeft[objLEFT.child]) {
		objDiv.innerHTML = aryLeft[objLEFT.child];
		
		objDiv.parent = objLEFT.id;
		
		//objDiv.style.left = getPageLeft(objLeft.parentElement) + getWidth(objLeft.parentElement) -3
		objDiv.style.left = getPageLeft(objLEFT.parentElement) + getWidth(objLEFT.parentElement);
			
		var bodyClientHeight = document.body.clientHeight;
		var bodyScrollTop = document.body.scrollTop;
		var subroot1OffsetHeight = objDiv.offsetHeight;
		
		
		if ((bodyClientHeight - (objLEFT.offsetTop - bodyScrollTop)) > subroot1OffsetHeight) {
			objDiv.style.visibility = "visible";

			objDiv.style.top = (getPageTop(objLEFT) - 3) - getPageTop(document.all['root']) ;
		}else {
			objDiv.style.top = bodyClientHeight - subroot1OffsetHeight - 1 + bodyScrollTop;
		}
				
		objDiv.style.visibility = "visible";
		menuOn();
	}
	else {
		objDiv.style.visibility = "hidden";
	}
	}
	}

}

// onMouseOut Event:
function offA(blnCurrentItem){
	if(!blnDisableLeftNav || (blnDisableLeftNav == "false")){
	if(!blnNavigator && !blnQuickLinks){
		if(blnCurrentItem){
			objLEFT.style.textDecoration = ''
			//window.event.srcElement.className = "navHi";
		}else{
			window.event.srcElement.className = "navLo";
			arrowOff(window.event.srcElement.child);
		}
		nomenuOn();
	}	
	}	
}


// FUNCTIONS TO CONTROL ONMOUSEOVER/ONMOUSEOUT EVENTS FOR SUB-ROOT MENU ITEMS:
function onB(){
	window.event.srcElement.className = "subnavHi";
	menuOn();
}

function offB(){
	window.event.srcElement.className = "subnavLo";
	noMenuOn();
}

function highlightSectionHead(objDiv){
	objDiv.style.cursor='hand';
	objDiv.style.textDecoration='underline';
}
function unhighlightSectionHead(objDiv){
	objDiv.style.cursor='';
	objDiv.style.textDecoration='';
}
function highlightSection(objDiv){
	//objDiv.style.cursor='hand';
	//objDiv.style.textDecoration='underline';
	objDiv.className='sectionNavHi';
}
function unhighlightSection(objDiv){
	//objDiv.style.cursor='';
	//objDiv.style.textDecoration='';
	objDiv.className='sectionNavLo';
}

function highlightTogNav(objDiv){
	objDiv.style.cursor='hand'
}

function unhighlightTogNav(objDiv){
	objDiv.style.cursor=''
}


function toggleLeftNav(){
	if(!blnGoHref){
		if(!blnDisableLeftNav || (blnDisableLeftNav == "false")){
			// Need to check the position of the Left Nav in case Back button was used to navigate to page...
			// RS -- 6/4/02
			var outerRight  = getRight(document.all['NavMain']) 
			if( outerRight > 20 ) {		// Menu is visible so run hideLeftNav
				hideLeftNav(lngMaxWidth);
				setLeftNavDisabled();
			}else{
				showLeftNav(20);
				setLeftNavEnabled();
			}
		}else{
			var outerRight  = getRight(document.all['NavMain']) 
			if( outerRight == 20 ) {	// Menu is hidden so run showLeftNav
				showLeftNav(20);
				setLeftNavEnabled();
			}else{
				hideLeftNav(lngMaxWidth);
				setLeftNavDisabled();
			}
		}
	}		
}

function setLeftNavDisabled(){
	blnDisableLeftNav = true;
	WM_setCookie('LeftNavDisabled', 'true', 360*24, '/', null, null )
}

function setLeftNavEnabled(){
	blnDisableLeftNav = false;
	WM_setCookie('LeftNavDisabled', 'false', 360*24, '/', null, null)
}

function hideLeftNav(lngWidth){
	
	var lngWidth;
	if(lngWidth > 20){
		var outerLeft   = getLeft(document.all['NavMain']) 
		var outerRight  = getRight(document.all['NavMain']) //+ (lngMaxWidth - lngWidth)
		var outerTop    = getTop(document.all['NavMain'])
		var outerBottom = getBottom(document.all['NavMain'])
	
		var x = document.all['root'].style.width
		moveLayerBy(document.all['root'], -10,0)
		document.all['NavMain'].style.width=lngWidth - 10;
		//clipLayer(document.all['root'], outerLeft, outerTop, outerRight, outerBottom)
		setTimeout('hideLeftNav('+lngWidth+'-10)', 1)
	}else{
		blnDisableLeftNav = true;
		document.all['HideNav'].style.display='inline';
		moveLayerTo(document.all['HideNav'], 0, 2)
		document.all['root'].style.display='none';
		
	}
}

function showLeftNav(lngWidth){
	
	var lngWidth;
	if(lngWidth == 20){
		document.all['HideNav'].style.display='none';
		document.all['root'].style.display='inline';
		resizePageBottom();
	}
	if(lngWidth < 130){
		var outerLeft   = getLeft(document.all['NavMain']) 
		var outerRight  = getRight(document.all['NavMain']) //+ (lngMaxWidth - lngWidth)
		var outerTop    = getTop(document.all['NavMain'])
		var outerBottom = getBottom(document.all['NavMain'])
	
		var x = document.all['root'].style.width
		moveLayerBy(document.all['root'], +10,0)
		document.all['NavMain'].style.width=lngWidth + 10;
		//clipLayer(document.all['root'], outerLeft, outerTop, outerRight, outerBottom)
		setTimeout('showLeftNav('+lngWidth+'+10)', 1)
	}else{
		blnDisableLeftNav = false;
	}
}

////////////////////////////////////////
//////////////////////////////////////////
//////////////////////////////////////////
//
// here is the form select box replace functions
//
//////////////////////////////////////////


var formExist;
var blnHiddenSelects = false;
var blnHiddenSelectsIFrame = false;
var strLastHTML;
var h = 0;
var arrSelects = new Array();
strLastHTML = '';

//called on load of the page
function checkForm(){
	if (document.forms.length != 0){
		for(i=1;i<document.forms.length;++i){
			if(document.forms(i).onSubmit){
				document.forms(i).onSubmit = "showForms();" + document.forms(i).onSubmit
			}else{
				document.forms(i).onSubmit = "showForms();"
			}
			for(n=0;n<document.forms[i].elements.length;++n){
				var type = document.forms[i].elements[n];
				if (type.type == "select-one" || type.type == "select-multiple"){
					formExist = 1;
					}
				}
			}
		}
	else{
		formExist = 0;
		}			
	}

function hidingFrom_old(){
	if (!blnHiddenSelects){
		if (true){
			var divsArray = document.all.tags("div");
			for (var k = 0; k < divsArray.length; k++){
			
				if (divsArray[k].className && (divsArray[k].className == "selectHide" || divsArray[k].className == "selectHide2")){
					
					var layerName = divsArray[k].id;
					var strSelectName = divsArray[k].firstChild.name;
					//hideForm(layerName, strSelectName);
					divsArray[k].style.display = 'none';
					
	
				}
			}
			blnHiddenSelects = true;		
		}
	}
}

function hidingFrom(){

//	var divsArray = document.all.tags("div");
//	for (var k = 0; k < divsArray.length; k++){
//	
//		if (divsArray[k].className && (divsArray[k].className == "selectHide" || divsArray[k].className == "selectHide2")){
//			
//			var layerName = divsArray[k].id;
//			var strSelectName = divsArray[k].firstChild.name;
//			//hideForm(layerName, strSelectName);
//			divsArray[k].style.display = 'none';
//			

//		}
//	}
}

function showingFrom(){
	
//			var divsArray = document.all.tags("div");
//			for (var k = 0; k < divsArray.length; k++){
//			
//				if (divsArray[k].className && (divsArray[k].className == "selectHide" || divsArray[k].className == "selectHide2")){
//					
//					var layerName = divsArray[k].id;
//					var strSelectName = divsArray[k].firstChild.name;
//					//hideForm(layerName, strSelectName);
//					divsArray[k].style.display = 'inline';
//					
//	
//				}
//			}
//			
}

function hidingIForm(){
	try {
		var d=frames["fr"].document;
		if (!blnHiddenSelectsIFrame){	
			if (formExist == 1){
				var divsArray = d.all.tags("div");
				for (var k = 0; k < divsArray.length; k++) {
					if (divsArray[k].className && (divsArray[k].className == "selectHide" || divsArray[k].className == "selectHide2")) {
						var layerName = divsArray[k].id;
						var strSelectName = d.all[layerName].firstChild.name;
						hideIForm(layerName, strSelectName);
					}
				}
				blnHiddenSelectsIFrame = true;		
			}
		}
	}
	catch(er){
	// do nothing
	}
}


function hideIForm(divName, strName) {
	var intWidth, intHeight, objFormDiv, strHTML, strSelected, intSelected, blnTemp, strSelectID
	var d=frames["fr"].document;

	//alert('bryan ' + d[divName].id);
	//alert(d.all[divName].id);
	intWidth = d.all[divName].firstChild.offsetWidth
	intHeight = d.all[divName].firstChild.offsetHeight
	objFormDiv = d.all[divName]
	//alert('bryan');	
	if(d.all[divName].firstChild.type == "select-one")
	{
		if (d.all[divName].firstChild.selectedIndex)
		{
			intSelected = d.all[divName].firstChild.selectedIndex
			strSelected = d.all[divName].firstChild.options(intSelected).innerHTML
		}
		else
		{
			//intSelected = document.all[divName].firstChild.selectedIndex
			strSelected = d.all[divName].firstChild.options(0).innerHTML
			if (strSelected == "") 
			{
				strSelected = "&nbsp;"
			}
		}
		//get the html of the drop down list
		strLastHTML = objFormDiv.innerHTML
		arrSelects[strName] = strLastHTML
			
		//draw the HTML of the drop down showing the SELECTED item within the drop down list
		strHTML = '<table border="0" cellpadding="0" cellspacing="0" height=21><tr><td rowspan=2 bgcolor="808080"><img src="/img/spacer.gif" width=1 height=1 border=0 ></td><td colspan=2 bgcolor="808080"><img src="/img/spacer.gif" width=1 height=1 border=0 ></td><tr>'
		strHTML += '<td style="'
		strHTML += 'width:'+(parseInt(intWidth) - 20)+'px;'
		strHTML += 'height:'+ (parseInt(intHeight)-1)+'px;"'
		strHTML += 'class="hideSelect" onFocus="showIForm();">'
		strHTML += strSelected
		strHTML += '</td><td onFocus="showIForm();" '
		strHTML += 'style="background-color:#ffffff;'
		strHTML += 'border-right:1px inset #cccccc;border-bottom:2px inset #ffffff;">'
		strHTML += '<img src="/img/select.gif" width=16 ></td></tr></table>'

		objFormDiv.children(1).innerHTML = strHTML
		objFormDiv.children(0).style.display='none';
		objFormDiv.children(1).style.display='inline';
	}
	else if(d.all[divName].firstChild.type == "select-multiple")
	{		

		intWidth = parseInt(intWidth)-6
		intHeight = parseInt(intHeight)-6

		strSelected = "&nbsp;"
		
		strLastHTML = objFormDiv.innerHTML
		arrSelects[strName] = strLastHTML
		
		strHTML = '<table cellpadding=0 cellspacing=0 border=0><tr><td><img src="/img/multiSelectTL.gif" width=3 height=3></td><td background=/img/multiSelectTop.gif><img src="/img/spacer.gif" width=' + intWidth + ' height=3></td><td><img src="/img/multiSelectTR.gif" width=3 height=3></td></tr><tr><td background="/img/multiSelectLeft.gif"><img src="/img/spacer.gif" width=3 height=' + intHeight + '></td><td><img src="/img/spacer.gif" width=' + intWidth + ' height=' + intHeight + '></td><td background="/img/multiSelectRight.gif"><img src="/img/spacer.gif" width=3 height=' + intHeight + '></td></tr><tr><td><img src="/img/multiSelectBL.gif" width=3 height=3></td><td background="/img/multiSelectBottom.gif"><img src="/img/spacer.gif" width=' + intWidth + ' height=3></td><td><img src="/img/multiSelectBR.gif" width=3 height=3></td></tr></table>'

		objFormDiv.children(1).innerHTML = strHTML
		objFormDiv.children(0).style.display='none';
		objFormDiv.children(1).style.display='inline';

	}

}
function hideForm(divName, strName) {
	var intWidth, intHeight, objFormDiv, strHTML, strSelected, intSelected, blnTemp, strSelectID
	intWidth = document.all[divName].firstChild.offsetWidth
	intHeight = document.all[divName].firstChild.offsetHeight
	objFormDiv = document.all[divName]
	
	//alert(objFormDiv.children.length);
	if(document.all[divName].firstChild.type == "select-one")
	{
		if (document.all[divName].firstChild.selectedIndex)
		{
			intSelected = document.all[divName].firstChild.selectedIndex
			strSelected = document.all[divName].firstChild.options(intSelected).innerHTML
		}
		else
		{
			//intSelected = document.all[divName].firstChild.selectedIndex
			strSelected = document.all[divName].firstChild.options(0).innerHTML
			if (strSelected == "") 
			{
				strSelected = "&nbsp;"
			}
		}
		
		strLastHTML = objFormDiv.innerHTML
		arrSelects[strName] = strLastHTML
			
			
		strHTML = '<table  style="display:inline;margin:0px 0px 8px 0px;padding:0px;border:0px #FFFFFF;"   cellpadding="0" cellspacing="0" height=16>'
		strHTML += '<tr><td style="'
		strHTML += 'width:'+(parseInt(intWidth) - 20)+'px;'
		strHTML += 'height:'+ (parseInt(intHeight)-16)+'px;border-top:1px inset #cccccc;border-left:1px inset #cccccc;bottom-bottom;1px #cccccc"'
		strHTML += ' onFocus="showForm();">'
		strHTML += strSelected
		strHTML += '</td><td onFocus="showForm();" '
		strHTML += 'valign="top" align="left">'
		strHTML += '<img src="/FCWSite/Img/icons/select.gif" ></td></tr></table>'

		
		objFormDiv.children(1).innerHTML = strHTML;
		objFormDiv.children(0).style.display='none';
		objFormDiv.children(1).style.display='inline';
		objFormDiv.children(1).style.margin.top = 0;
		
		
	
	}
	else if(document.all[divName].firstChild.type == "select-multiple")
	{		

		intWidth = parseInt(intWidth)-6
		intHeight = parseInt(intHeight)-6

		strSelected = "&nbsp;"
		
		strLastHTML = objFormDiv.innerHTML
		arrSelects[strName] = strLastHTML
		
		strHTML = '<table cellpadding=0 cellspacing=0 border=0><tr><td><img src="/img/multiSelectTL.gif" width=3 height=3></td><td background=/img/multiSelectTop.gif><img src="/img/spacer.gif" width=' + intWidth + ' height=3></td><td><img src="/img/multiSelectTR.gif" width=3 height=3></td></tr><tr><td background="/img/multiSelectLeft.gif"><img src="/img/spacer.gif" width=3 height=' + intHeight + '></td><td><img src="/img/spacer.gif" width=' + intWidth + ' height=' + intHeight + '></td><td background="/img/multiSelectRight.gif"><img src="/img/spacer.gif" width=3 height=' + intHeight + '></td></tr><tr><td><img src="/img/multiSelectBL.gif" width=3 height=3></td><td background="/img/multiSelectBottom.gif"><img src="/img/spacer.gif" width=' + intWidth + ' height=3></td><td><img src="/img/multiSelectBR.gif" width=3 height=3></td></tr></table>'

		objFormDiv.children(1).innerHTML = strHTML
		objFormDiv.children(0).style.display='none';
		objFormDiv.children(1).style.display='inline';

	}

}

function showIframeForm() {
	var strHTML, objFormDiv;
	try {
			
			hideNavigator();
			hideQuickLinks();
			hideSiteTools();
			hideMyTools();
			//var divsArray = d.all.tags("div");
			var divs = document.all.tags("div");
			for(var k=0;k<divs.length;k++){
				if (divs[k].className && (divs[k].className == "selectHide" || divs[k].className == "selectHide2")){
					//var divName = divs[k].id;
					strHTML = arrSelects[divs[k].selectName]
					//objFormDiv = eval("document.all." + divName)
					objFormDiv = divs[k]
					objFormDiv.children(0).style.display='inline';
					objFormDiv.children(1).style.display='none';
				}
			}
		
	}
	catch(er){
	// do nothing
	}
}
function showIForm() {
	var strHTML, objFormDiv;
	try {
		var d=frames["fr"].document;
		if(blnHiddenSelectsIFrame){
			blnHiddenSelectsIFrame = false;
			hideNavigator();
			hideQuickLinks();
			hideSiteTools();
			hideMyTools();
			//var divsArray = d.all.tags("div");
			var divs = d.all.tags("div");
			for(var k=0;k<divs.length;k++){
				if (divs[k].className && (divs[k].className == "selectHide" || divs[k].className == "selectHide2")){
					//var divName = divs[k].id;
					strHTML = arrSelects[divs[k].selectName]
					//objFormDiv = eval("document.all." + divName)
					objFormDiv = divs[k]
					objFormDiv.children(0).style.display='inline';
					objFormDiv.children(1).style.display='none';
				}
			}
		}
	}
	catch(er){
	// do nothing
	}
}

function showForm() {
	var strHTML, objFormDiv;
	if(blnHiddenSelects){
		blnHiddenSelects = false;
		hideNavigator();
		hideQuickLinks();
		hideSiteTools();
		hideMyTools();
		var divs = document.all.tags("div");
		for(var k=0;k<divs.length;k++){
			if (divs[k].className && (divs[k].className == "selectHide" || divs[k].className == "selectHide2")){
				//var divName = divs[k].id;
				strHTML = arrSelects[divs[k].selectName]
				//objFormDiv = eval("document.all." + divName)
				objFormDiv = divs[k]
				objFormDiv.children(0).style.display='inline';
				objFormDiv.children(1).style.display='none';
			}
		}
	}
}



/*
WM_setCookie(), WM_readCookie(), WM_killCookie()
A set of functions that eases the pain of using cookies.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com
*/


// This next little bit of code tests whether the user accepts cookies.
var WM_acceptsCookies = false;
if(document.cookie == '') {
    document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
    if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
	WM_acceptsCookies = true; 
    }// If it succeeds, set variable
} else { // there was already a cookie
  WM_acceptsCookies = true;
}


function WM_setCookie (name, value, hours, path, domain, secure) {
    if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
	var not_NN2 = (navigator && navigator.appName 
		       && (navigator.appName == 'Netscape') 
		       && navigator.appVersion 
		       && (parseInt(navigator.appVersion) == 2))?false:true;

	if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
		var numHours = hours;
	    } else if (typeof(hours) == 'number') { // calculate Date from number of hours
		var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
	    }
	}
	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
    }
} // WM_setCookie


function WM_readCookie(name) {
    if(document.cookie == '') { // there's no cookie, so go no further
	return false; 
    } else { // there is a cookie
	var firstChar, lastChar;
	var theBigCookie = document.cookie;
	firstChar = theBigCookie.indexOf(name);	// find the start of 'name'
	var NN2Hack = firstChar + name.length;
	if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
	    firstChar += name.length + 1; // skip 'name' and '='
	    lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
	    if(lastChar == -1) lastChar = theBigCookie.length;
	    return unescape(theBigCookie.substring(firstChar, lastChar));
	} else { // If there was no cookie of that name, return false.
	    return false;
	}
    }	
} // WM_readCookie

function WM_killCookie(name, path, domain) {
  var theValue = WM_readCookie(name); // We need the value to kill the cookie
  if(theValue) {
      document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
  }
} // WM_killCookie

/**********************************************
 *
 * addQuickLink -- gets the title and submits the 
 *    form to add a quick link.
 *   
 *********************************************/
 function addQuickLink(){
	QuickLinks.elements['title'].value = document.title;
	QuickLinks.submit();
 }
 
 /**********************************************
 *
 * manageQuickLinks -- gets the title and submits the 
 *    form to changes the action and submits the form.
 *    to manage quick links
 *********************************************/
 function manageQuickLinks(){
	window.open('/managequicklinks.asp','ManageQuickLinks','height=200,width=600, resizable');
	QuickLinks.elements['title'].value = document.title;
	QuickLinks.action = '/managequicklinks.asp';
	QuickLinks.target = 'ManageQuickLinks'
	QuickLinks.submit();
 }

 /**********************************************
 *
 * closeAndRedirect --  used on DeleteQuickLink.asp
 *    
 *    
 *********************************************/
 function closeAndRedirect() {
	window.opener.location.reload();
	window.close();
}

