var newLineChar = String.fromCharCode(10);var char34 = String.fromCharCode(34);var LastGLOBALMenu = "";var LastLOCALMenu = "";var CurLOCALMenu = "";var IsGLOBALMenu = false;var IsMenuDropDown = true;var HTMLStr;var TBLStr;var x = 0;var y = 0;// Positions for the dropdown menusvar menu1XPos = 0;var menu1YPos = 2;var menu2YPos = 66;var menu2XPos = 0;var x2 = 0;var y2 = 0;var x3 = 0;var GLOBALMenuWidth;var ToolbarMinWidth;var ToolbarMenu;var ToolbarBGColor;var ToolbarLoaded = false;var aDefGLOBALColor  = new Array(3);var aDefLOCALColor = new Array(3);var aCurGLOBALColor  = new Array(3);var aCurLOCALColor = new Array(3);var GLOBALFont;var LOCALFont;var GLOBALFTFont;var LOCALFTFont;var logoBG;var MaxMenu = 30;var TotalMenu = 0;var defSubMenuWidth = 200; // default submenu widthvar arrMenuInfo = new Array(30);var bFstLOCALTBMenu = true;var bFstLOCALFTMenu = true;var bUType = true; // comment out if you want to hide top menu for non-users/* If you want to hide the top menuif( document.forms[0].UserType.value == 'none' ){bUType = false;  } else {bUType = true; }*/// Setup colors and fonts for all menusToolbarBGColor	= "white";	GLOBALFont  = "11px Arial";LOCALFont = "Bold 11px Arial";	aDefGLOBALColor[0]	= aCurGLOBALColor[0]  = "#EEEEEE";	// bgcolor;aDefGLOBALColor[1]	= aCurGLOBALColor[1]  = "#234234";	// text font coloraDefGLOBALColor[2]  = aCurGLOBALColor[2]  = "red";		// mouseover font color	aDefLOCALColor[0]	= aCurLOCALColor[0] = "#EEEEEE";	// bgcolor;aDefLOCALColor[1] = aCurLOCALColor[1] = "#234234";	// text font coloraDefLOCALColor[2] = aCurLOCALColor[2] = "red";		// mouseover font colorlogoBG = "white";var webPath = document.forms[0].WebPath.value;var resourcePath = document.forms[0].WebPath.value + document.forms[0].CurrentDb.value + ".nsf/";// Output style sheet and toolbar IDdocument.write("<SPAN ID='StartMenu' STYLE='display:none;'></SPAN>");// Build toolbar templateHTMLStr = "";if( bUType ) {  // Whether to use the global menu or notHTMLStr = "<td><DIV ID='idToolbar' STYLE='text-align:right;background-color:transparent'>";HTMLStr += "<Table vertical-align=bottom border=1 style='border-style:none;background-color:transparent;text-align:right;margin-left:0px;margin-top:0px;padding-left:0px;'  cellpadding='0'; cellspacing='0'>";HTMLStr += "<tr>";HTMLStr += 		"<td style='border-style:none;'><img src='" + resourcePath + "topbarlft.jpg?OpenImageResource' height='20' width='40'></td>";HTMLStr +=  		"<td style='background-color:" + aDefGLOBALColor[0] + ";border-color:gray;border-top-width:0px;border-bottom-width:1px;border-right-width:0px;border-left-width:0px;'>"HTMLStr += 			"<DIV ID='idRow1' STYLE='position:relative;height:12px;'>";	HTMLStr += 				"<DIV ID='idGLOBALMenuPane' style='margin: 0px 0px 0px 0px;' NOWRAP><!--GLOBAL_MENU_TITLES--></DIV>";HTMLStr += 			"</DIV></DIV>";HTMLStr += 		"</td>";HTMLStr +=  			"<td vertical-align=bottom style='border-style:none;'><img src='" + resourcePath + "topbarrt.jpg?OpenImageResource' height='20' width='30'></td>";HTMLStr +=  "</tr>";HTMLStr +=  "</table>";}// Logo tableHTMLStr += "<table width='100%'  border='0' cellpadding='0' cellspacing='0'>";HTMLStr += "<tr>";HTMLStr += "<td align='left'><a href=" + webPath + "gp.nsf/viewsub?openform&page=home;app=gp;'><img border=0 src='" + resourcePath + "LogoLeft.jpg?OpenImageResource'></a></td>";HTMLStr += "<td align='center'><img src='" + resourcePath + "LogoMiddle.jpg?OpenImageResource'></td>";HTMLStr += "<td align='right' style='padding-right:5px'><img src='" + resourcePath + "LogoRight.jpg?OpenImageResource''></td>";HTMLStr += "</tr>";HTMLStr += "</table>";if( document.forms[0].CurrentDb.value == "wshome" ) {	// offline object	var DolsStr;	DolsStr = "<OBJECT ID=\"LotusDOLSControl\" CLASSID=\"CLSID:5BDBA960-6534-11D3-97C7-00500422B550\" width=" + Width + " height =" + Height + " CODEBASE=" + NewUrl + ">";	DolsStr += '<PARAM NAME=\"FullUrl\"                      VALUE=\"' +  FullUrl           +  '\">'; 	DolsStr += '<PARAM NAME=\"AbbrevUserName\"    VALUE=\"' + AbbrevName + '\">';	DolsStr += '<PARAM NAME=\"ApplicationName\"     VALUE=\"' +  AppName     + '\">';	DolsStr += '<PARAM NAME=\"Mode\"                       VALUE=\"' +  Mode           + '\">';	DolsStr += '<PARAM NAME=\"Language\"                VALUE=\"' +  Language    + '\">';	DolsStr += '</OBJECT>';	// Bottom menu	HTMLStr += "<Table style='background-color:" +  aDefLOCALColor[0] + ";margin-left:0px;margin-top:0px;padding-left:0px;' border='0' cellpadding='0'; cellspacing='0'>";	HTMLStr += "<tr>";	//HTMLStr += 		"<td><img src='" + resourcePath + "topbarlft.jpg?OpenImageResource' height='18' width='40'></td>";	// Adjust the height of the menu	HTMLStr +=  	"<td>";	HTMLStr +=  			"<DIV ID='idRow3' style='line-height:20px;'>";	HTMLStr += 			"<DIV ID='idLOCALMenuPane' style='padding-left:10px;' NOWRAP><!--LOCAL_MENU_TITLES--></DIV>";	HTMLStr += 			"</DIV>";	HTMLStr += 	"</td>";	HTMLStr +=  	"<td>" + DolsStr + "</td>";	HTMLStr +=  "</tr>";	HTMLStr +=  "</table>";} else {	// Bottom menu	HTMLStr += "<Table style='background-color:" +  aDefLOCALColor[0] + ";margin-left:0px;margin-top:0px;padding-left:0px;' border='0' cellpadding='0'; cellspacing='0'>";	HTMLStr += "<tr>";	//HTMLStr += 		"<td><img src='" + resourcePath + "topbarlft.jpg?OpenImageResource' height='18' width='40'></td>";	// Adjust the height of the menu		HTMLStr +=  	"<td><DIV ID='idRow3' style='line-height:20px;'>";	HTMLStr += 			"<DIV ID='idLOCALMenuPane' style='padding-left:0px;' NOWRAP><!--LOCAL_MENU_TITLES--></DIV>";	HTMLStr += 			"</DIV>";	HTMLStr += 		"</td>";	//HTMLStr +=  	"<td><img src='" + resourcePath + "topbarrt.jpg?OpenImageResource' height='18' width='40'></td>";	HTMLStr +=  "</tr>";	HTMLStr +=  "</table>";}HTMLStr += 	"<SCRIPT TYPE='text/javascript'>var ToolbarMenu = StartMenu;</" + "SCRIPT><DIV WIDTH=100%>";window.onresize  = resizeToolbar;function drawToolbar(){	HTMLStr += "</DIV>";	document.write(HTMLStr);	ToolbarLoaded = true;	if( bUType ) {		GLOBALMenuWidth     = Math.max(idGLOBALMenuPane.offsetWidth, (200+112));		ToolbarMinWidth = (250+18) + GLOBALMenuWidth;		idToolbar.style.backgroundColor     = ToolbarBGColor;		idGLOBALMenuPane.style.backgroundColor  = aDefGLOBALColor[0];	}	idLOCALMenuPane.style.backgroundColor = aDefLOCALColor[0];		resizeToolbar();	for (i = 0; i < TotalMenu; i++) 	{		thisMenu = document.all(arrMenuInfo[i].IDStr);		if (thisMenu != null)		{			if (arrMenuInfo[i].IDStr == LastGLOBALMenu && arrMenuInfo[i].type == "R")			{				//Last GLOBALMenu has to be absolute width				arrMenuInfo[i].type = "A";				arrMenuInfo[i].unit = 200;			}			if (arrMenuInfo[i].type == "A")				thisMenu.style.width = arrMenuInfo[i].unit + 'px';			else 				thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';		}	}}function resizeToolbar(){	if( bUType ) {			w = Math.max(ToolbarMinWidth, document.body.clientWidth) - ToolbarMinWidth;		msw = Math.max(GLOBALMenuWidth, document.body.clientWidth) - GLOBALMenuWidth;		//idGLOBALMenuPane.style.width  = document.body.clientWidth - 30 + 'px';	}	idLOCALMenuPane.style.width = document.body.clientWidth + 'px';			}function setToolbarBGColor(color){		ToolbarBGColor = color;	if (ToolbarLoaded == true)		idToolbar.style.backgroundColor = ToolbarBGColor;}	function setGLOBALMenuFont(sFont){		GLOBALFont = sFont;}function setLOCALMenuFont(sFont){		LOCALFont = sFont;}function setDefaultGLOBALMenuColor(bgColor, fontColor, mouseoverColor){		if (bgColor   != "")	  aDefGLOBALColor[0] = bgColor;	if (fontColor != "")	  aDefGLOBALColor[1] = fontColor;	if (mouseoverColor != "") aDefGLOBALColor[2] = mouseoverColor;}function setDefaultLOCALMenuColor(bgColor, fontColor, mouseoverColor){		if (bgColor   != "")	  aDefLOCALColor[0] = bgColor;	if (fontColor != "")	  aDefLOCALColor[1] = fontColor;	if (mouseoverColor != "") aDefLOCALColor[2] = mouseoverColor;}function setLOCALSubMenuWidth(MenuIDStr, WidthType, WidthUnit){	tempID = "LOCAL_" + MenuIDStr;	setSubMenuWidth(tempID, WidthType, WidthUnit);}function setGLOBALSubMenuWidth(MenuIDStr, WidthType, WidthUnit){	tempID = "GLOBAL_" + MenuIDStr;	setSubMenuWidth(tempID, WidthType, WidthUnit);}function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit){	var fFound = false;	if (TotalMenu == MaxMenu)	{		alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");		return;	}		for (i = 0; i < TotalMenu; i++)		if (arrMenuInfo[i].IDStr == MenuIDStr)		{			fFound = true;			break;		}	if (!fFound)	{		arrMenuInfo[i] = new menuInfo(MenuIDStr);		TotalMenu += 1;	}	if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)	{		arrMenuInfo[i].type = "A";		arrMenuInfo[i].unit = defSubMenuWidth;	}	else	{		arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";		arrMenuInfo[i].unit = WidthUnit;	}}// This function creates a menuInfo object instance.function menuInfo(MenuIDStr){	this.IDStr = MenuIDStr;	this.type  = "";	this.unit  = 0;	this.width = 0;	this.count = 0;}function updateSubMenuWidth(MenuIDStr){	for (i = 0; i < TotalMenu; i++)		if (arrMenuInfo[i].IDStr == MenuIDStr)		{			if (arrMenuInfo[i].width < MenuIDStr.length) 				arrMenuInfo[i].width = MenuIDStr.length;			arrMenuInfo[i].count = arrMenuInfo[i].count + 1;			break;		}}function addLOCALMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr){ 		if (addLOCALMenu.arguments.length > 4)		TargetStr = addLOCALMenu.arguments[4];	else		TargetStr = "_top";	tempID = "LOCAL_" + MenuIDStr;	addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true); 	bFstLOCALTBMenu=false;		}function addGLOBALMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr){		TargetStr = "_top";	tempID = "GLOBAL_" + MenuIDStr;	addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, false); 	LastGLOBALMenu = tempID;}function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bLOCALMenu){	cFont   = bLOCALMenu? LOCALFont : GLOBALFont;	cColor0 = bLOCALMenu? aDefLOCALColor[0] : aDefGLOBALColor[0];	cColor1 = bLOCALMenu? aDefLOCALColor[1] : aDefGLOBALColor[1];	cColor2 = bLOCALMenu? aDefLOCALColor[2] : aDefGLOBALColor[2];	tagStr  = bLOCALMenu? "<!--LOCAL_MENU_TITLES-->" : "<!--GLOBAL_MENU_TITLES-->";		MenuStr = newLineChar;	if ((bLOCALMenu == false && LastGLOBALMenu != "") || (bLOCALMenu == true && bFstLOCALTBMenu==false))		MenuStr += "<SPAN STYLE='vertical-align:middle;font:" + cFont + ";color:" + cColor1 + "'>|&nbsp;</SPAN>"; 		MenuStr += "<A TARGET='" + TargetStr + "' TITLE='" + MenuHelpStr + "'" +			"   ID='AM_" + MenuIDStr + "'" +			"   STYLE='vertical-align:middle;text-decoration:none;cursor:hand;font:" + cFont + ";background-color:" + 				cColor0 + ";color:" + cColor1 + ";'";	if (MenuURLStr != "")	{		if (bLOCALMenu)			MenuStr += " HREF='" + MenuURLStr + "'";		else			MenuStr += " HREF='" + MenuURLStr + "'";	}	else		MenuStr += "";	MenuStr += 	" onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr + "'); hideMenu();" + char34 + 				" onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "'); doMenu('"+ MenuIDStr + "');" + char34 + ">" +				"&nbsp;" + MenuDisplayStr + "&nbsp;</a>";	MenuStr += tagStr;	HTMLStr = HTMLStr.replace(tagStr, MenuStr);		setSubMenuWidth(MenuIDStr,"default",0);}function addLOCALSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, strFirstCat){		if (addLOCALSubMenu.arguments.length > 3)		TargetStr = addLOCALSubMenu.arguments[3];	else		TargetStr = "_top";	tempID = "LOCAL_" + MenuIDStr;	addSubMenu(tempID,SubMenuStr,SubMenuURLStr,"_parent", true, strFirstCat); }function addGLOBALSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, Target){		if( Target == "" ) {		TargetStr = "_top";	} else {		TargetStr = Target;	}	tempID = "GLOBAL_" + MenuIDStr;	addSubMenu(tempID,SubMenuStr,SubMenuURLStr, TargetStr, false); }function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bLOCALMenu, strFirstCat){	cFont   = bLOCALMenu? LOCALFont : GLOBALFont;	cColor0 = bLOCALMenu? aDefLOCALColor[0] : aDefGLOBALColor[0];	cColor1 = bLOCALMenu? aDefLOCALColor[1] : aDefGLOBALColor[1];	cColor2 = bLOCALMenu? aDefLOCALColor[2] : aDefGLOBALColor[2];		var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");	if (MenuPos == -1) { MenuPos = MenuIDStr.length; }	InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;	URLStr        = SubMenuURLStr;	var LookUpTag  = "<!--" + MenuIDStr + "-->";	var sPos = HTMLStr.indexOf(LookUpTag);	if (sPos <= 0)	{		HTMLStr += newLineChar + newLineChar +		"<SPAN ID='" + MenuIDStr + "'";		HTMLStr += 	" STYLE='text-align:left;display:none;position:absolute;width:160px;background-color:" + cColor0 + ";padding-top:3px;padding-left:3px;padding-bottom:4px;z-index:9px;'";//		HTMLStr += 	" STYLE='display:none;position:absolute;width:160px;background-color:transparent;padding-top:3px;padding-left:3px;padding-bottom:4px;z-index:9px;'";		HTMLStr += "onmouseout='hideMenu();'>";				if( strFirstCat != null  ) {			HTMLStr += newLineChar + "<Label STYLE='text-decoration:none;cursor:hand;font:" + 		cFont + ";color:" + cColor1 +  "'>" + strFirstCat + "</Label><BR>"		}}	TempStr = newLineChar +				"<A ID='AS_" + MenuIDStr + "'" +				"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +				"   HREF='" + URLStr + "' TARGET='" + TargetStr + "'" +				" onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr + "');" + char34 + 				" onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "');" + char34 + ">" +				"&nbsp;" + SubMenuStr + "</A><BR>" + LookUpTag;	if (sPos <= 0)		HTMLStr += TempStr + "</DIV></SPAN>";	else		HTMLStr = HTMLStr.replace(LookUpTag, TempStr);		updateSubMenuWidth(MenuIDStr);	}function addLOCALSubMenuLine(MenuIDStr){		tempID = "LOCAL_" + MenuIDStr;	addSubMenuLine(tempID,true);}function addGLOBALSubMenuLine(MenuIDStr){		tempID = "GLOBAL_" + MenuIDStr;	addSubMenuLine(tempID,false);}function addSubMenuLine(MenuIDStr, bLOCALMenu){	var LookUpTag = "<!--" + MenuIDStr + "-->";	var sPos = HTMLStr.indexOf(LookUpTag);	if (sPos > 0)	{		cColor  = bLOCALMenu? aDefLOCALColor[1] : aDefGLOBALColor[1];		TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;		HTMLStr = HTMLStr.replace(LookUpTag, TempStr);	}}function addLOCALSubMenuCategory(MenuIDStr, strCategory){		tempID = "LOCAL_" + MenuIDStr;	addSubMenuCategory(tempID, strCategory, true);}function addSubMenuCategory(MenuIDStr, strCategory, bLOCALMenu  ){	var LookUpTag = "<!--" + MenuIDStr + "-->";	var sPos = HTMLStr.indexOf(LookUpTag);	if (sPos > 0)	{		cColor  = bLOCALMenu? aDefLOCALColor[1] : aDefGLOBALColor[1];		cFont   = bLOCALMenu? LOCALFont : GLOBALFont;		//TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;		TempStr = newLineChar + "<Label STYLE='text-decoration:none;cursor:hand;font:" + 		cFont + ";color:" + cColor +  "'>" + strCategory + "</Label><BR>" + LookUpTag;		HTMLStr = HTMLStr.replace(LookUpTag, TempStr);	}}function mouseMenu(id, MenuIDStr) {	IsGLOBALMenu   = (MenuIDStr.toUpperCase().indexOf("GLOBAL_") != -1);	IsMouseout = (id.toUpperCase().indexOf("OUT") != -1);	if (IsMouseout)	{		color = IsGLOBALMenu? aDefGLOBALColor[1] : aDefLOCALColor[1];		if (MenuIDStr == CurLOCALMenu && aCurLOCALColor[1] != "") 			color = aCurLOCALColor[1];	}	else	{		color = IsGLOBALMenu? aDefGLOBALColor[2] : aDefLOCALColor[2];		if (MenuIDStr == CurLOCALMenu && aCurLOCALColor[2] != "") 			color = aCurLOCALColor[2];	}	window.event.srcElement.style.color = color;}function doMenu(MenuIDStr) {	var thisMenu = document.all(MenuIDStr);	if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) 	{		window.event.cancelBubble = true;		return false;	}	// Reset dropdown menu	window.event.cancelBubble = true;	ToolbarMenu.style.display = "none";	showElement("SELECT");	showElement("OBJECT");	ToolbarMenu = thisMenu;	IsGLOBALMenu = (MenuIDStr.toUpperCase().indexOf("GLOBAL_") != -1);	// Set dropdown menu display position	if(IsGLOBALMenu) {	 		x = window.event.srcElement.offsetLeft +	 	window.event.srcElement.offsetParent.offsetLeft + menu1XPos;	} else {		x = window.event.srcElement.offsetLeft +	 	window.event.srcElement.offsetParent.offsetLeft + menu2XPos;	}			x2 = x + window.event.srcElement.offsetWidth;	if( bUType ) {			y  = (IsGLOBALMenu)? 			(idRow1.offsetHeight + menu1YPos) :			(idRow1.offsetHeight + idRow3.offsetHeight + menu2YPos);	} else {			y  = (IsGLOBALMenu)? 			(idRow1.offsetHeight) : 			(idRow3.offsetHeight + menu2YPos);	}	thisMenu.style.top  = y;	thisMenu.style.left = x;	thisMenu.style.clip = "rect(0 0 0 0)";	thisMenu.style.display = "block";	thisMenu.style.zIndex = 102;	// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set	window.setTimeout("showMenu()", 2);	return true;}function showMenu() {	if (ToolbarMenu != null) 	{ 		y2 = y + ToolbarMenu.offsetHeight;		ToolbarMenu.style.clip = "rect(auto auto auto auto)";		hideElement("SELECT");		hideElement("OBJECT");		x2 = x + ToolbarMenu.offsetWidth;		hideElement("IFRAME"); 	}}function hideMenu(){	if (ToolbarMenu != null && ToolbarMenu != StartMenu) 	{		// Don't hide the menu if the mouse move between the menu and submenus				cY = event.clientY + document.body.scrollTop;		cX = event.clientX;    		if ( (cX >= (x+5) && cX <= x2) && cY > (y-10) && cY <= y2)      		{			window.event.cancelBubble = true;			return; 		}		ToolbarMenu.style.display = "none";		ToolbarMenu = StartMenu;		window.event.cancelBubble = true;		showElement("SELECT");		showElement("OBJECT");		showElement("IFRAME"); 	}}function hideElement(elmID){	for (i = 0; i < document.all.tags(elmID).length; i++)	{		obj = document.all.tags(elmID)[i];		if (! obj || ! obj.offsetParent)			continue;		// Find the element's offsetTop and offsetLeft relative to the BODY tag.		objLeft   = obj.offsetLeft;		objTop    = obj.offsetTop;		objParent = obj.offsetParent;		while (objParent.tagName.toUpperCase() != "BODY")		{			objLeft  += objParent.offsetLeft;			objTop   += objParent.offsetTop;			objParent = objParent.offsetParent;		}		// Adjust the element's offsetTop relative to the dropdown menu		objTop = objTop - y;		if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))			;		else if (objTop > ToolbarMenu.offsetHeight)			;		else if (IsGLOBALMenu && (y + ToolbarMenu.offsetHeight) <= 80)			;		else			obj.style.visibility = "hidden";	}}function showElement(elmID){	for (i = 0; i < document.all.tags(elmID).length; i++)	{		obj = document.all.tags(elmID)[i];		if (! obj || ! obj.offsetParent)			continue;		obj.style.visibility = "";	}}