// Copyright 1999-2001 by Northern Trust Corporation 801 South Canal Street, Chicago IL 60611 USA
// All rights reserved
//
var currentDropdown = "";
var previousDropdown = new Array();
var previousBackground = new Array();
var strCurrentDropdown = "";
var leftMenu = "";
var weAreHere = document.location.pathname;
var lastPassportRadioOn = "";
var lastPassportRadioClick = "";
var lastPassportRadioClickNumber = -1;
var pixSignonEnabled   = false;
var pixEnrollEnabled   = false;
var pixMoreinfoEnabled = false;
var regexpAmp          = / & /g
var strMenuWanted	   = "";
var strCurrentRegion = "";
var strCurrentRegionTitle = "";
var lastDDMenuDot       = new Array();
var states				= new Array();
var iUniqueLinkNumber	= 0;
var frmSearchForm = "";

var blnIsSecondLevelPage = false;
var strSelectedSubSection = "";
var blnHasRSRegionalSelection = false;

var imgWhiteBall = new Image();
var imgBlueBall  = new Image();
var imgGreenBall = new Image();

imgWhiteBall.src = "/images/bulletWhite.gif";
imgBlueBall.src  = "/images/bulletBlue.gif";
imgGreenBall.src = "/images/bulletGreen.gif";

// if this page has been replaced by ecms - redirect the user accordingly.

if (typeof cobbledPages != "undefined") {
	if (typeof cobbledPages[document.location.pathname] != "undefined") {
		document.location.href = "/migrated.html?to=" + cobbledPages[document.location.pathname];
	}
}

// prevent northerntrust.com and force www.northerntrust.com

if (location.href.toLowerCase().indexOf("//northerntrust.com") >= 0) {
	var ntregex = /\/\/northerntrust.com/i;
	tempLocation = location.href;
	tempLocation = tempLocation.replace(ntregex,"//www.northerntrust.com");
	location.href = tempLocation;
}

// redirect to secure pages to secure server if not already on a secure server.

//var secPgs = /email\.html|enroll\.html|signon\.html|questionnaire\.html/gi;
//if ( secPgs.test(location.href) ) {		// if it is a secure page
//	if (location.href.indexOf("//web-") < 0) {  // are we testing or really production?
//		if (location.protocol!='https:') {
//			location.href = 'https://'+location.host+location.pathname;	// make sure it's on a secure server
//		}
//	}
//}




function submitSearchForm() {

	if (browserType() == "netscape")
		document.searchForm.document.frm2.submit();
	else
		document.frm2.submit();

}

function browserType() {
	if (navigator.appName == "Netscape")
		return "netscape";
	else
		return "IE";
}


function storeWhichMenu(whichMenuWanted) {
		strMenuWanted = whichMenuWanted;
}

function buildLeftMenu() {
	displayMenu(strMenuWanted);
}


function makeSecure() {
//	alert("in makeSecure: " + window.location.href);
//	if (window.location.href.indexOf("http://") >= 0) {
//		if (window.location.href.indexOf("http://web-") < 0)
//			window.location.href =  "https://" + window.location.href.substr(7);
//	}
}

function verifyPopUp() {
	alert(window.toolbar);
}

///////////////////////////////////////////////////////////////////////////////
// Function:	targetPopup
// Description:	Opens a URL in a new window with the given params.
//
///////////////////////////////////////////////////////////////////////////////
function targetPopup( targetURL, windowName, scrollbars, resizable, status, toolbar, menubar, width, height ) {
	var popupParams = '';

	popupParams += 'scrollbars=' + scrollbars + ', ';
	popupParams += 'resizable=' + resizable + ', ';
	popupParams += 'status=' + status + ', ';
	popupParams += 'toolbar=' + toolbar + ', ';
	popupParams += 'menubar=' + menubar + ', ';
	popupParams += 'width=' + width + ', ';
	popupParams += 'height=' + height;

	window.open( targetURL, windowName, popupParams );
}

function popUp(urlPageToPopUp,strPopUpType,bolNoPrint) {
	// DESCRIPTION: pops up content in a new window
	//						 use this instead of framePopUp or displayPopUp
	// UPDATED: May 02, 2002
	// USAGE:: <a href="url" onClick="return popUp( this.href , [ type | windowOpenParams ] );">
	// REQUIRED:
	//	urlPageToPopUp - the url of the page to be opened in the popup window
	// OPTIONAL:
	//	strPopUpType - one of the types listed in the switch/case statement below
	//	or override standard types with window.open settings string
	// bolNoPrint - set to true if page should not be printable
	// NOTE: if you wish to set bolNoPrint to true, strPopUpType must be set -- at the very least -- to '' (nothing)
	// e.g. - onClick="return popUp(this.href,'',true);"

	var strWindowSettings = 'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width=580,height=480,screenX=10,screenY=10,left=10,top=10';
	var strPopUpURL;
	var rightNow = new Date();
	var iUnique = rightNow.getTime();

	if (bolNoPrint) {
		strPopUpURL = '/popups/popup_noprint.html?';
	} else {
		strPopUpURL = '/popups/popup.html?';
	}

	if ( (strPopUpType == '') || (typeof(strPopUpType) == 'undefined') ) {
		var strToSearch = urlPageToPopUp.toLowerCase();															// convert the URL to popup to lowercase
		var strExt = strToSearch.substr(strToSearch.lastIndexOf('.')+1,3);								// find the 3 char ext. for the page being called
		if ( (strExt == 'pdf') || (strExt == 'doc') || (strExt == 'xls') || (strExt == 'ppt') ) { 	// if a standard pop exists for this extension then use it
//			strPopUpType = strExt;  // popUp MS Office documents and PDFs the same way for now.  Otherwise uncomment and define options for each.
				strPopUpType = 'pdf';
		} else {
			strPopUpType = 'standard';																													// otherwise use the default
		}
	}

	switch (strPopUpType) {
		case 'pdf':
			// any changes to strPopUpURL or strWindowSettings for a PDF would go here
			break;
		case 'tour':
			// any changes to strPopUpURL or strWindowSettings for a TOUR would go here
			strWindowSettings = 'toolbar=no,menubar=no,resizable=no,scrollbars=no,width=690,height=495,screenX=5,screenY=5,left=5,top=5';
			strPopUpURL = '';
			break;
		case 'tools':
			// any changes to strPopUpURL or strWindowSettings for a TOOLS page would go here
			strPopUpURL = '';
			break;
		case 'offsite':
			// any changes to strPopUpURL or strWindowSettings for an OFFSITE site would go here
			strPopUpURL = '';
			strWindowSettings = 'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width=750,height=500,screenX=10,screenY=10,left=10,top=10';
			break;
		case 'secure':
			// any changes to strPopUpURL or strWindowSettings for a SECURE page would go here
			var pathURLPageToPopUp = urlPageToPopUp.substr(urlPageToPopUp.indexOf('/',9));
			strPopUpURL = 'https://' + location.host +strPopUpURL + 'https://'+location.host + pathURLPageToPopUp;
			urlPageToPopUp = '';
			break;
		case 'calculator':
			//  use the calculator settings if no strPopUpType is specified
			// this case uses the version of the popup layout that contains only the logo image - no print or close button
			strPopUpURL = '/popups/popup_noprint.html?';
			break;
		case 'standard':
			//  use the standard settings if no strPopUpType is specified	(DEFAULTS)
			break;
		default:
			// using a non-standard type of popup if strPopUpType doesn't fit any of the above types (OVERRIDE)
			strWindowSettings = strPopUpType;
	}

	strPopUpURL = strPopUpURL + urlPageToPopUp;
	var popupWindow = window.open(strPopUpURL, 'popupWin'+iUnique, strWindowSettings);
	popupWindow.focus();
	return false;
}

function displayPopUp(docName,x,y,w,h) {
	var rightNow = new Date();
	iUnique = rightNow.getTime();
	if (docName.indexOf("/servlet/getNewsStory") >= 0) {
	   fullPath = new String(location.pathname);
	   cleanPath = new String(fullPath.substr(0,fullPath.lastIndexOf('/')));
	   newWindow = window.open('/popups/paper.html?content=' + docName, 'upWindow'+iUnique,'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width=580,height=480,screenX=0,screenY=0,left=0,top=0');
	} else {
		if (w + h + y + x > 0) {
			newWindow = window.open(docName,'puWindow'+iUnique,'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width='+ w+ ',height='+ h+ ',screenX='+ x+ ',screenY='+ y+ ',left='+ x+ ',top='+ y);
		} else {
			newWindow = window.open(docName,'puWindow'+iUnique,'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width=580,height=480');
		}
	}
	newWindow.focus();
	return false;

}

function framePopUp(what) {
   if (what.indexOf("://") < 0) {
	   fullPath = new String(location.pathname);
	   cleanPath = new String(fullPath.substr(0,fullPath.lastIndexOf('/')));
	   cleanPath += "/";
   } else
       cleanPath = "";

   displayPopUp('http://www.northerntrust.com/popups/paper.html?content=' + cleanPath  + what,100,100,580,480);
}

function displayPDF(docName) {
	var rightNow = new Date();

	iUnique = rightNow.getTime();

	newWindow = window.open(docName,'PDFWindow'+iUnique,'toolbar=no,menubar=no,resizable=yes');
	newWindow.focus();
	return false;
}

function displayPDFFromMenu(docName) {
	var rightNow = new Date();

	iUnique = rightNow.getTime();

	newWindow = window.open(docName,'PDFWindow'+iUnique,'toolbar=no,menubar=no,resizable=yes,width=580,height=480');
	newWindow.focus();
}

function displayHTMLFromMenu(docName) {
	var rightNow = new Date();

	iUnique = rightNow.getTime();

	newWindow = window.open(docName,'HTMLWindow'+iUnique,'toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=580,height=480');
	newWindow.focus();
}
function displayAnnual(docName) {
	var rightNow = new Date();

	iUnique = rightNow.getTime();

	newWindow = window.open(docName,'HTMLWindow'+iUnique,'toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=670,height=500');
	newWindow.focus();
}

function newStates(abbr,fullname) {
	this.abbr = abbr;
	this.fullname = fullname;
}

states[states.length] = new newStates('az','Arizona');
states[states.length] = new newStates('ca','California');
states[states.length] = new newStates('co','Colorado');
states[states.length] = new newStates('ct','Connecticut');
states[states.length] = new newStates('fl','Florida');
states[states.length] = new newStates('ga','Georgia');
states[states.length] = new newStates('il','Illinois');
states[states.length] = new newStates('ma','Massachusetts');
states[states.length] = new newStates('mo','Missouri');
states[states.length] = new newStates('mi','Michigan');
states[states.length] = new newStates('nv','Nevada');
states[states.length] = new newStates('ny','New York');
states[states.length] = new newStates('oh','Ohio');
states[states.length] = new newStates('tx','Texas');
states[states.length] = new newStates('wa','Washington');
states[states.length] = new newStates('wi','Wisconsin');
states[states.length] = new newStates('can','Canada');
states[states.length] = new newStates('cay','Cayman Islands');
states[states.length] = new newStates('lx','Luxembourg');
states[states.length] = new newStates('sg','Singapore');
states[states.length] = new newStates('hk','Hong Kong');
states[states.length] = new newStates('jp','Japan');
states[states.length] = new newStates('gb','United Kingdom');
states[states.length] = new newStates('ie','Ireland');
states[states.length] = new newStates('af','Affiliate Offices');

states[states.length] = new newStates('canada','Canada');
states[states.length] = new newStates('caymanislands','Cayman Islands');
states[states.length] = new newStates('luxembourg','Luxembourg');
states[states.length] = new newStates('singapore','Singapore');
states[states.length] = new newStates('hongkong','Hong Kong');
states[states.length] = new newStates('japan','Japan');
states[states.length] = new newStates('unitedkingdom','United Kingdom');
states[states.length] = new newStates('ireland','Ireland');

states[states.length] = new newStates('atm','ATM Locations');

function removeDropDown() {
	removeMenuDot();
	for (i = 0; i < previousDropdown.length; i++) {
		if (browserType() == "netscape") {
			previousDropdown[i].visibility = "hidden";
			previousBackground[i].visibility = "hidden";
			document.transparentbackground.visibility = "hidden";
			if (document.symbolForm != null)
				document.symbolForm.visibility = "show";

		} else {
			previousDropdown[i].style.visibility = "hidden";
			previousBackground[i].style.visibility = "hidden";
			transparentbackground.style.visibility = "hidden";

			// Show the account access select field.
			showLayer(getLayer('accounts'));

			// Show the regional drop down if it exists
			if( blnHasRSRegionalSelection == true )
				showLayer( getLayer( 'regions' ) );
		}
	}
	previousDropdown.length = 0;
	previousBackground.length = 0;


}

function displayDropDown(Nwhat,IEwhat,Nback, IEback) {
	if (browserType() == "netscape") {

//	Removed all main navbar drop down functionality for all Netscape browsers.
//	SL, 10-22-2002

//		Nwhat.visibility = "show";
//		Nback.visibility = "show";
//		document.transparentbackground.visibility = "show";
		currentDropdown = Nwhat;
		currentBackground = Nback;

		whatsHidden1 = "";
		whatsHidden2 = "";

//		if (Nwhat.left > 450) {
//			document.searchForm.visibility = 'hidden';
//		}
//		if ( (Nwhat.left > 300) && (Nwhat.left < 450) ) {
//			if (document.symbolForm != null)
//				document.symbolForm.visibility = 'hidden';
//		}
	} else {
		IEwhat.style.visibility = "visible";
		IEback.style.visibility = "visible";
		transparentbackground.style.visibility = "visible";
		currentDropdown = IEwhat;
		currentBackground = IEback;

// commented out by SRS2 for new design 01/06/04

		// Hide the account access select field
		//if ( IEwhat.name != "feedbackdropdown" && IEwhat.name != "aboutusdropdown" )
			//hideLayer(getLayer('accounts'));

		// Hide the regional selection box if it exists, and if the selected menu is "Resources"
		if ( blnHasRSRegionalSelection == true && IEwhat.name == "librarydropdown" )
			hideLayer( getLayer( 'regions' ) );
	}
	previousDropdown[previousDropdown.length] = currentDropdown;
	previousBackground[previousBackground.length] = currentBackground;


}




function putListLinkCallout(anchorParms,text) {
	if (browserType() == "netscape")
		putListLink(anchorParms,"<font class=cls10pixels>" + text + "</font>");
	else
		putListLink(anchorParms,"<font class=cls9pixels>" + text + "</font>");
}

function putListLink3(anchorParms, text, whichClass) {
	putListLink(anchorParms,"<font class=" + whichClass + ">" + text + "</font>");
}



function putListLink(anchorParms,text) {
	outHTML =  "<tr valign=middle><td><img src='/images/transparent.gif' id='linkBullet" + iUniqueLinkNumber + "' name='linkBullet" + iUniqueLinkNumber + "' width='4' height='4' class='clsPutListBullet'>&nbsp;</td><td id=longlist>";
	outHTML += "<a " + anchorParms;
	if (browserType() == "netscape") {
		outHTML += " onMouseOver='document.linkBullet" + iUniqueLinkNumber + ".src = \"/images/bulletBlue.gif\";'";
		outHTML += " onMouseOut ='document.linkBullet" + iUniqueLinkNumber + ".src = \"/images/transparent.gif\";'";

	} else {
		outHTML += " onMouseOver='linkBullet" + iUniqueLinkNumber + ".src = \"/images/bulletBlue.gif\";'";
		outHTML += " onMouseOut ='linkBullet" + iUniqueLinkNumber + ".src = \"/images/transparent.gif\";'";
	}
	outHTML += ">" + text + "<\a></td></tr>";

	document.write(outHTML);

	iUniqueLinkNumber++;
}



function removeMenuDot() {
	if (lastDDMenuDot.length > 0) {
		for (i=0; i<lastDDMenuDot.length; i++) {
			lastDDMenuDot[i].src = "/images/transparent.gif";
		}
		lastDDMenuDot.length = 0;
	}
}
function setImage(whatIE, whatN, strImage) {
var	whichImage = new Image();

	removeMenuDot();

	if (browserType() == "netscape") {
		whichImage = whatN;
		lastDDMenuDot[lastDDMenuDot.length] = whatN;
	} else {
		whichImage = whatIE;
		lastDDMenuDot[lastDDMenuDot.length] = whatIE;
	}


	if (strImage == "/images/bulletWhite.gif")
		whichImage.src = imgWhiteBall.src;
	else if (strImage == "/images/bulletGreen.gif")
		whichImage.src = imgGreenBall.src;
	else if (strImage == "/images/bulletBlue.gif")
		whichImage.src = imgBlueBall.src;
	else
		whichImage.src = strImage;
}

function getQuote(frmWhichForm) {

//	alert("http://ddb.ntrs.com:7001/getQuote?ticker="+frmWhichForm.ticker.value);
	displayPopUp("/servlet/getQuote?ticker="+frmWhichForm.ticker0.value,0,0,0,0);
}

function buildDropDown(what,where) {
	iPos = what.indexOf("dropdown")
	strArea = what.substr(0,iPos);

	outHTML = "";
	eval("iTransparentWidth = i" + strArea + "Width");
	eval("iBoxWidth = i" + strArea + "BoxWidth");

	outHTML += "<table border=0 width=" + iBoxWidth + " class=clsNoBackground cellspacing=0 cellpadding=0><tr class=clsNoBackground><td align=left class=clsNoBackground>";


// put a transparent box at the top and make it hot for the main index page of that area.
	if (strArea == "feedback") {
		outHTML += "<a href=# onClick='return false;' onMouseOver='removeDropDown()'><IMG border='0' src='/images/transparent.gif' width='" + (iBoxWidth - iTransparentWidth) + "' height='16'></a>";
		outHTML += "<a href=/feedback/index.html><img border='0' src='/images/transparent.gif' height='16' width='" + iTransparentWidth + "' alt='Contact Us'></a>";
	} else {
		strAltText = strArea;
		if (strAltText == "aboutus") {
			strAltText = "About Us";
		}
		else if ( strAltText == "library" ) {
			strAltText = "Resources";
		}
		else if ( strAltText == "personal" ) {
			strAltText = "Personal";
		}
		else if ( strAltText == "corporate" ) {
			strAltText = "Corporate";
		}
	  	outHTML += "<a href=/" + strArea + "/index.html><img border='0' src='/images/transparent.gif' height='16' width='" + iTransparentWidth + "' alt='" + strAltText + "'></a>";
	}
//		outHTML += "<a href=# onClick='return false;' onMouseOver='removeDropDown()'><IMG  style='border-style:solid; border-width:1; border-color:cyan;' border='0' src='/images/transparent.gif' width='" + (iBoxWidth - iTransparentWidth) + "' height='16'></a>";


// put a transparent box at the top to the right of the button transparent box (see next img) to remove the dropdown when we leave the box.
	if (iTransparentWidth < iBoxWidth)
	  if (strArea != "feedback")
			outHTML += "<a href=# onClick='return false;' onMouseOver='removeDropDown()'><IMG border='0' src='/images/transparent.gif' width='" + (iBoxWidth - iTransparentWidth) + "' height='16'></a>";

//style='border-color:red; border-width:1; border-style:solid;'

	outHTML += "<br>";

	if (browserType() == "netscape")
		outHTML += "<img src='/images/transparent.gif' height='8' width='90'>";
	else
		outHTML += "<font size=1>&nbsp;<br></font>";

// *****************************
// * build dropdown as a table
// *****************************
	outHTML += "<table cellspacing=0 cellpadding=0 border=0>"
	for (i=0; i<menuItem.length; i++) {
		if ( ( (menuItem[i].cat + "dropdown") == what) && (menuItem[i].level == 0) && (menuItem[i].title != "") ) {
			outHTML += "<tr height=17>";
			outHTML += "<td width=16 align=center><img src='/images/transparent.gif' width='8' height='7' name='ddBall" + i + "'></td>";
			outHTML += "<td align=left><a href='" + menuItem[i].link + "' onMouseOver=\"setImage(ddBall" + i + ",document.ddBall" + i + ",'/images/bulletWhite.gif')\"><font class=clsDDLink>" + menuItem[i].title + "&nbsp;</font></a></td>";
			outHTML += "</tr>";
		}
	}
	outHTML += "</table>";

	outHTML += "<p>&nbsp;</p><p>&nbsp;</p></td></tr></table>";
	if (outHTML != "") {  //Corporate & Institutional Library
//		outHTML = outHTML.replace(/Corporate & Institutional Library/,"<font class=clsFontSize11>Corporate & Institutional Library</font>");
		outHTML = outHTML.replace(regexpAmp,"<font face=Verdana size=-2> & </font>");
		where.write(outHTML);
	}
}


//************************************************
//* menu stuff
//************************************************

var menuItem = new Array();
var category = "";
var ipersonalWidth = 0;
var icorporateWidth = 0;
var ilibraryWidth = 0;
var iaboutusWidth = 0;
var ifeedbackWidth = 0;


iaboutusWidth = 76;
iaboutusBoxWidth = 154;

icorporateWidth = 152;
icorporateBoxWidth = 190;

ilibraryWidth = 74;
ilibraryBoxWidth = 230;

ipersonalWidth = 76;
ipersonalBoxWidth = 190;

function newMenuItem(cat,level,title,link) {
	this.cat   = cat;
	this.level = level;
	this.title = title;
	this.link  = link;
	this.open  = false;
	this.bgcolor = "";
	this.graphic = "";
	this.overGraphic = "";
	this.normalGraphic = "";

	if (typeof cobbledPages != "undefined") {
		if (typeof cobbledPages[link] != "undefined") {
			this.link = "/pws/jsp/display.jsp?XML=" + cobbledPages[link];
		}
	}
}
//these probably could be removed - but TEST first
menuItem[menuItem.length] = new newMenuItem("FIRSTMENUITEM!",-1,"FIRST MENU ITEM NEVER DISPLAYED!","#");
menuItem[menuItem.length] = new newMenuItem("aboutus",0,"Northern Trust News","/aboutus/news/index.html");
menuItem[menuItem.length] = new newMenuItem("LAST MENU ITEM",-1,"LAST MENU ITEM","LAST MENU ITEM");

ifeedbackWidth = 76;
ifeedbackBoxWidth=84;

category = window.location.pathname.substr(1);
firstSlash = category.indexOf("/");
category = category.substr(0,firstSlash);



function getCookie(strWhich) {

	var arg = strWhich + "=";
	var strCookie = document.cookie + ";";

	var iPos = strCookie.indexOf(arg);

	if (iPos < 0)
		return "";

	iPos = iPos + arg.length;

	strReturn = strCookie.substr(iPos);
	iPos = strReturn.indexOf(";");
	strReturn = strReturn.substring(0,iPos);

	return strReturn;
}

function enableEditMode() {
	if (browserType() == "IE") {
		if (getCookie("PublicEditName") != "") {
			document.write("<div id=divEditButton class=clsEditContent>");
			document.write("<a href=# onClick='editContent()'><img src='/images/editContent.gif' width=24 height=10></a>");
			document.write("</div>");
		}
	}
}

function editContent() {

	var strName = getCookie("PublicEditName");
	var strExt  = getCookie("PublicEditExt");

	var now = new Date();
	month = now.getMonth() + 1;
	if (month < 10)
	 	month = "0" + month;

	dayofmonth = now.getDate() + 1;
	if (dayofmonth < 10)
	 	dayofmonth = "0" + dayofmonth;

	rqnum =  now.getYear().toString().substr(2) + month + dayofmonth + now.getHours() + now.getMinutes() + now.getSeconds();

	tempfile = document.location.pathname;

	iPos = tempfile.indexOf(".html");
	if (iPos < 0){
		tempfile += "index";
	} else {
		tempfile = tempfile.substr(0,iPos);
	}

	tempfile += "." + rqnum + ".html";

	mc = maincontenthere.innerHTML.replace(/&/g,"&amp;");
//	alert (mc);

	editwin = window.open("","editwindow","");
//	editwin.document.writeln("<html><body><form name=formEdit action='/cgi-bin/formmail.pl' method='post'>");
	editwin.document.writeln("<html><body><form name=formEdit action='/pws/servlet/SendMail' method='post'>");
	editwin.document.writeln("<input type=hidden name=sort value='order:name,passcode,extension,when,page,content,relatedlinks'>");
	editwin.document.writeln("<input type=hidden name=recipient value='ddb@ntrs.com'>");
	editwin.document.writeln("<input type=hidden name=subject value='*** Update Requested ***'>");
	editwin.document.writeln("<table>");
	editwin.document.writeln("<tr><td align=right><b>Name:</b></td><td><input type=hidden name=name value='" + strName + "'>" + strName + "</td><td align=right><b>Extension:</b></td><td><input type=hidden name=extension value='" + strExt + "'>" + strExt + "</td></tr>");
	editwin.document.writeln("<tr><td align=right><b>Code:</b></td><td><input type=text   name=passcode value=''></td><td align=right><b>Date/time<br>to make change:</b></td><td><input type=text name=when></td></tr>");
	editwin.document.writeln("<tr><td align=right><b>Page:</b></td><td colspan=3><input type=hidden name=page value='j:\webroot" + document.location.pathname.replace(/\//g,"\\") + "'>" + document.location.pathname.replace(/\//g,"\\") + "</td></tr>");
	editwin.document.writeln("</table>");
	editwin.document.writeln("<b>Content area</b><br>");
	editwin.document.writeln("<textarea name=content rows=20 cols=80>");
	if (typeof document.all["maincontenthere"] == "undefined")
		editwin.document.writeln("<!-- No main content -->");
	else
		editwin.document.writeln(mc);
	editwin.document.writeln("</textarea><br>");
	editwin.document.writeln("<b>Related Links</b><br>");
	editwin.document.writeln("<textarea name=relatedlinks rows=10 cols=80>");
	if (typeof document.all["tdRelatedLinks"] == "undefined")
		editwin.document.writeln("<!-- No related links -->");
	else
		editwin.document.writeln(tdRelatedLinks.innerHTML);
	editwin.document.writeln("</textarea>");
	editwin.document.writeln("<center><input type=submit value='Send Changes' onClick='return validateChanges()'>&nbsp;&nbsp;&nbsp;<input type=Reset>&nbsp;&nbsp;&nbsp;<input type=button value=Preview onclick='editPreview()'></center>");
	editwin.document.writeln("</form>");
	editwin.document.writeln("<scr" + "ipt>");
	editwin.document.writeln("function editPreview() {");
	editwin.document.writeln(" previewWin = window.open(document.location.href,'previewwindow',' ');");
	editwin.document.writeln(" setTimeout('updateWithChanges()',1000);");
	editwin.document.writeln(" previewWin.focus();");
	editwin.document.writeln("}");

	editwin.document.writeln("function updateWithChanges() {");
	if (typeof document.all["tdRelatedLinks"] != "undefined")
		editwin.document.writeln("	previewWin.tdRelatedLinks.innerHTML = document.formEdit.relatedlinks.value;");
	if (typeof document.all["maincontenthere"] != "undefined")
		editwin.document.writeln("	previewWin.maincontenthere.innerHTML = document.formEdit.content.value;");
//	editwin.document.writeln("	outHTML = '';");
//	editwin.document.writeln("  outHTML += '<form action=/cgi-bin/requestedupdate.pl method=post>';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=sort value=\"order:name,passcode,extension,when,page,content,relatedlinks\">';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=recipient value=\"WPT@notes.ntrs.com\">';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=subject value=\"Public site change request\">';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=requestnum value=\"" + rqnum + "\">';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=tempfile value=\"" + tempfile + "\">';");
//	editwin.document.writeln("	outHTML += '<input type=hidden name=bodytext value=\"[empty]\">';");
//	editwin.document.writeln("	outHTML += '<input type=submit value=\"Request Update\" onclick=\"return submitRequest(bodytext);\">';");
//	editwin.document.writeln("	outHTML += '</form >'");
//	editwin.document.writeln("	previewWin.updateFormHere.innerHTML += outHTML;");
	editwin.document.writeln("}");

	editwin.document.writeln("function validateChanges() {");
	editwin.document.writeln("  if (document.formEdit.passcode.value.length == 0) {");
	editwin.document.writeln("		alert('You must supply your code to submit changes.');");
	editwin.document.writeln("		return false;");
	editwin.document.writeln("	}");
	editwin.document.writeln("}");
	editwin.document.writeln("</scr" + "ipt>");
	editwin.document.writeln("</body></html>");
	editwin.focus();
}
function submitRequest(hfBodyText) {
	alert(document.documentElement.innerHTML);
	iPosStart = document.documentElement.innerHTML.indexOf("<span id=updateFormHere>");
	iPosEnd   = document.documentElement.innerHTML.indexOf("</span>",iPosStart);
	alert(iPosStart + " " + iPosEnd);
	hfBodyText.value = document.documentElement.innerHTML.substr(0,iPosStart+24) + document.documentElement.innerHTML.substr(iPosEnd);
	alert(hfBodyText.value);
	return false;
}
enableEditMode();

function displayClicked() {
	dateSI = document.riskUniverse.date.selectedIndex;
	dateValue = document.riskUniverse.date[dateSI].value;

	planTypeSI = document.riskUniverse.plantype.selectedIndex;
	planTypeValue = document.riskUniverse.plantype[planTypeSI].value;

	displaySI = document.riskUniverse.display.selectedIndex;
	displayValue = document.riskUniverse.display[displaySI].value;

	docu = dateValue + "/" + planTypeValue + "_" + displayValue + ".pdf";
	winnam = dateValue + planTypeValue + displayValue;
	var alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	for (var i = 0; i < winnam.length; i++) {
		if (alphanumeric.indexOf(winnam.substr(i,1)) < 0) {
			winnam = winnam.substr(0,i) + "x" + winnam.substr(i+1);
		}
	}
	window.open(docu,winnam,"toolbar=no,menubar=no,status=yes,resizable=yes");
}


///////////////////////////////////////////////////////////////////////////////
// Function:	getCurrentCategory()
// Description:	Pulls the name of the currently selected section/category
//		from the URL.
//
///////////////////////////////////////////////////////////////////////////////
function getCurrentCategory( activeItem ) {

	weAreHere = document.location.pathname;
	if (activeItem == -1) {
		iPos = weAreHere.substr(1).indexOf("/");
		currentCategory = weAreHere.substr(1,iPos).toLowerCase();
		strCurrentMenuItem = weAreHere.substr(iPos);
	} else {
		iPos = activeItem.indexOf("|");
		if (iPos < 0)
			iPos = activeItem.length;

		currentCategory = activeItem.substr(0,iPos);
		strCurrentMenuItem = activeItem.substr(iPos + 1);
	}

	if (currentCategory == "about")
		currentCategory = "aboutus";

	if ( currentCategory == '')
		currentCategory = "home";

	return currentCategory;
}


///////////////////////////////////////////////////////////////////////////////
// Function:	setCurrentRegion()
// Description:	Maps a region name to a human-readable region title.
//
///////////////////////////////////////////////////////////////////////////////
function setCurrentRegion( strSelectedRegion ) {
	strCurrentRegion = strSelectedRegion;

	if ( strCurrentRegion != "" && strCurrentRegion != "none" ) {
		switch( strCurrentRegion ) {
			case( "us" ):
				strCurrentRegionTitle = "United States";
				break;
			//case( "uk" ):
				//strCurrentRegionTitle = "United Kingdom";
				//break;
			case( "europe" ):
				strCurrentRegionTitle = "Europe";
				break;
			case( "canada" ):
				strCurrentRegionTitle = "Canada";
				break;
			case( "asia_pacific" ):
				strCurrentRegionTitle = "Asia-Pacific";
				break;
			case( "africa" ):
				strCurrentRegionTitle = "Africa";
				break;
			case( "middle_east" ):
				strCurrentRegionTitle = "Middle East";
				break;
			case( "latin_america" ):
				strCurrentRegionTitle = "Latin America";
				break;
		}
	}
}

///////////////////////////////////////////////////////////////////////////////
// Function:	writeRegionalInclude()
// Description:	Based on the value of the global variable strCurrentRegion,
//		writes out a client-side javascript include statement.
//
///////////////////////////////////////////////////////////////////////////////
function writeRegionalInclude() {

//	if ( strCurrentRegion != "" && strCurrentRegion != "none" ) {
//		document.write( "<script src='\/incs\/menuItems_corporate_regional_" + strCurrentRegion + ".js'><\/script>" );
//	}
}


///////////////////////////////////////////////////////////////////////////////
// Function:	writeRSRegionSelector()
// Description:	Writes out the drop-down options for the right-side region
//		selector.
//
///////////////////////////////////////////////////////////////////////////////
function writeRSRegionSelector() {
	document.write( '<option value="regional_us"' + ( strCurrentRegion == 'us' ? 'selected' : ' ' ) + '>United States</option>' );
	//document.write( '<option value="regional_uk"' + ( strCurrentRegion == 'uk' ? 'selected' : ' ' ) + '>United Kingdom</option>' );
	document.write( '<option value="regional_europe"' + ( strCurrentRegion == 'europe' ? 'selected' : ' ' ) + '>Europe</option>' );
	document.write( '<option value="regional_canada"' + ( strCurrentRegion == 'canada' ? 'selected' : ' ' ) + '>Canada</option>' );
	document.write( '<option value="regional_asia_pacific"' + ( strCurrentRegion == 'asia_pacific' ? 'selected' : ' ' ) + '>Asia-Pacific</option>' );
	document.write( '<option value="regional_africa"' + ( strCurrentRegion == 'africa' ? 'selected' : ' ' ) + '>Africa</option>' );
	document.write( '<option value="regional_mid_east"' + ( strCurrentRegion == 'middle_east' ? 'selected' : ' ' ) + '>Middle East</option>' );
	document.write( '<option value="regional_lat_america"' + ( strCurrentRegion == 'latin_america' ? 'selected' : ' ' ) + '>Latin America</option>' );
}


///////////////////////////////////////////////////////////////////////////////
// Function: 	changeRegion()
// Description:	Based on the region name passed in, redirects the browser to
// 		the selected region.
//
///////////////////////////////////////////////////////////////////////////////
function changeRegion( regionName ) {
	if( regionName == "regional_us" )
		document.location='/corporate/index_us.html';
	else
		document.location='/corporate/' + regionName + '/index.html';
}

///////////////////////////////////////////////////////////////////////////////
// Function:	writeHeadingText()
// Description:	Writes the HTML for the page heading. This more complex than
//		simply writing out the value specified in the DCR, because we
//		are now adding the sub-section name to the heading if the user
//		is viewing a page that is level 2 or deeper. We track what to
//		display in the "displayMenu" function below, and set a couple
// 		global variables there.
///////////////////////////////////////////////////////////////////////////////
function writeHeadingText( strDCRHeading ) {

	// Start by setting up the style
	document.write( '<span class="clsHeadline">' );

	// Only display the subsection name if user is viewing
	// a second-level page or deeper.
	if ( blnIsSecondLevelPage )
		document.write( strSelectedSubSection + ": " );

	// Display teh heading value set in the DCR
	document.write( strDCRHeading );

	// Finally, close out the style and write a carriage return.
	document.write( '<br /><img src="/images/universal/spacer.gif" width="1" height="8" border="0"><br /></span>' );
}

function displayMenu(activeItem) {
	var foundItem = false;
	var iFirstMenuItem = true;
	var strSelectedSection = ""

	outHTML = ""

	if (strMenuWanted == "none") {
		document.write("&nbsp;");
		return;
	}

	menuItem[menuItem.length] = new newMenuItem("LASTMENUITEM!",-1,"LAST MENU ITEM NEVER DISPLAYED!","#");


// * * * * * * *
// * Determine which menu item is active from which area
// * * * * * * *
	currentCategory = getCurrentCategory( activeItem );

// * * * * * * *
// * put in the country or state if we are in locations
// * * * * * * *

for (i=0;i<menuItem.length;i++) {

	if(menuItem[i].title == "Locations") {
		iLocation = i + 1;
	}

}

//	iPos = document.location.href.indexOf("/aboutus/locations/us/");
	iPos = document.location.href.indexOf("TYPE=locations_index");
	iPos2 = document.location.href.indexOf("aboutus/locations");
	if (iPos > 0 || iPos2 > 0) {


//					menuItem[iLocation].graphic = "<img name=pixLeftMenu" + i + " src='/images/L" + menuItem[i].level + "sel.gif' border=0 width=" + iPixWidth + " height=" + iPixHeight +">";
//					menuItem[iLocation].normalGraphic = "/images/L" + menuItem[i].level + "sel.gif";
//					menuItem[iLocation].overGraphic   = "/images/L" + menuItem[i].level + "sel.gif";

//		if (document.location.href.substr(iPos+24,1) == "_") {
//			whichState = document.location.href.substr(iPos+22,2);
//			for (i=0; (i < states.length) && (states[i].abbr != whichState); i++);
//			if (i < states.length) {
//				menuItem[iLocation].title = "Locations";
//				menuItem[iLocation].link  = "/pws/jsp/display2.jsp?XML=xsl/empty.xml&amp;TYPE=locations_index";

				//strCurrentMenuItem = "Locations";
//			}
//		}
	}


// added for ECMS Locations - TJM
///ddb///
///ddb///	var strHREF = document.location.href;
///ddb///	var iStateStart = strHREF.lastIndexOf("TYPE2=") + 6;
///ddb///	// this works for US only...
///ddb///	//var strState = strHREF.substr(iStateStart,2);
///ddb///
///ddb///	var iStateEnd = strHREF.lastIndexOf("&TYPE3=");
///ddb///
///ddb///	var strState="";
///ddb///
///ddb///	if (iStateEnd > 0) {
///ddb///		var eEnd = iStateEnd - iStateStart;
///ddb///		strState = strHREF.substr(iStateStart,iStateEnd - iStateStart)
///ddb///	} else {
///ddb///		strState = strHREF.substr(iStateStart,strHREF.length - iStateStart)
///ddb///	}
///ddb///
///ddb///
///ddb///// new
///ddb///
///ddb///var iLocIndex1 = strHREF.lastIndexOf("TYPE=locations_index");
///ddb///var iLocIndex2 = strHREF.lastIndexOf("/aboutus/locations/");
///ddb///
///ddb///// new
///ddb///
///ddb///
///ddb///	for (i=0; (i < states.length) && (states[i].abbr != strState); i++);
///ddb///
///ddb///	if (i < states.length) {
///ddb///		menuItem[iLocation].title = states[i].fullname;
///ddb///		menuItem[iLocation].link  = "/pws/jsp/display2.jsp?XML=xsl/empty.xml&TYPE=locations_index&TYPE2=" + strState;
///ddb///		strCurrentMenuItem = states[i].fullname;
///ddb///	}
///ddb///
///ddb///else if (iLocIndex1 > 0 || iLocIndex2 > 0) {
///ddb/////	strCurrentMenuItem = "Arizona";
///ddb/////	menuItem[iLocation].title = "Arizona";
///ddb///} else {
///ddb///}


/*

//  This is the "old"  Locations code


	if(menuItem[i].title == "United States Offices") {
		iLocationUS = i + 1;
	}
	if(menuItem[i].title == "International Offices") {
		iLocationIntl = i + 1;
	}
	menuItem[iLocationUS].title = "";
	menuItem[iLocationIntl].title = "";


	iPos = document.location.href.indexOf("/aboutus/locations/us/");
	if (iPos > 0) {
		if (document.location.href.substr(iPos+24,1) == "_") {
			whichState = document.location.href.substr(iPos+22,2);
			for (i=0; (i < states.length) && (states[i].abbr != whichState); i++);
			if (i < states.length) {
				menuItem[iLocationUS].title = states[i].fullname;
				menuItem[iLocationUS].link  = "/aboutus/locations/us/" + whichState + "_index.html";
				strCurrentMenuItem = states[i].fullname;
			}
		}
	}

	iPos = document.location.href.indexOf("/aboutus/locations/intl/");
	if (iPos > 0) {
		var strHREF = document.location.href;
		var iCountryEnd = strHREF.lastIndexOf("/");
		var iCountryStart = strHREF.lastIndexOf("/",iCountryEnd-1) + 1;
		var strCountry = strHREF.substr(iCountryStart,iCountryEnd-iCountryStart)
		for (i=0; (i < states.length) && (states[i].abbr != strCountry); i++);
		if (i < states.length) {
			menuItem[iLocationIntl].title = states[i].fullname;
			menuItem[iLocationIntl].link  = "/aboutus/locations/intl/" + strCountry + "/index.html";
			strCurrentMenuItem = states[i].fullname;
		}
	}

alert(strCurrentMenuItem);

// added for ECMS Locations - TJM

	var strHREF = document.location.href;
	var iCountryStart = strHREF.lastIndexOf("TYPE2=") + 6;
	var iCountryEnd = strHREF.lastIndexOf("&");

	var strCountry = strHREF.substr(iCountryStart,iCountryEnd-iCountryStart)

*/

//	alert(strCountry + " -- " + strCountry.length);

/*
	for (i=0; (i < states.length) && (states[i].abbr != strCountry); i++);
	if (i < states.length && strCountry.length > 2) {
		var urlLen = strHREF.length;
		var urlRemainder = strHREF.lastIndexOf("TYPE3=");
		var urlEnd = strHREF.substr(urlRemainder,urlLen-urlRemainder)

		menuItem[iLocationIntl].title = states[i].fullname;
		menuItem[iLocationIntl].link  = "/pws/jsp/display2.jsp?XML=xsl/empty.xml&TYPE=locations_index&TYPE2=" + strState;
		strCurrentMenuItem = states[i].fullname;

	}

*/
// * * * * * * *
// * Find which menu item(s) is/are open
// * * * * * * *

	for (i=0; i< menuItem.length; i++)
		menuItem[i].bgcolor = "#ffffff";

	iPixWidthL0  = 15
	iPixHeightL0 = 15
	iPixWidthL1  = 11
	iPixHeightL1 = 11
	iPixWidthL2  = 5
	iPixHeightL2 = 8

	iPixWidthL0  = 8
	iPixHeightL0 = 7
	iPixWidthL1  = 8
	iPixHeightL1 = 7
	iPixWidthL2  = 8
	iPixHeightL2 = 7

	iCurrentLevel = 0;

	for (var i=0; (i < menuItem.length); i++) {
		// Added an extra conditional here to include the C&IS regional items if a region was actually selected.
		if (currentCategory == menuItem[i].cat || ( menuItem[i].cat.indexOf( "corporate_regional" ) != -1 && strCurrentRegion != "" ) ) {
			menuItem[i].open = false;								// menu items are closed by default.
			menuItem[i].graphic = "";								// by default - no graphic rext to the text
			if (menuItem[i].level > 2)
				alert("menuItem["+i+"].title: " + menuItem[i].title + " (" + menuItem[i].level + ")");
			eval("iPixWidth  = iPixWidthL"  + menuItem[i].level);	// How big is the graphic if there was one?
			eval("iPixHeight = iPixHeightL" + menuItem[i].level);
			if (strCurrentMenuItem == menuItem[i].title) {			// 'stored menu item' equal to this title?

				menuItem[i].open = true;
				if ( ( (menuItem[i].level < menuItem[i + 1].level)  && (menuItem[i+1].title != "") ) ||  (menuItem[i].title == "Locations") ) {  //sub menu items exist
					menuItem[i].graphic = "<img name=pixLeftMenu" + i + " src='/images/L" + menuItem[i].level + "sel.gif' border=0 width=" + iPixWidth + " height=" + iPixHeight +">";
					menuItem[i].normalGraphic = "/images/L" + menuItem[i].level + "sel.gif";
					menuItem[i].overGraphic   = "/images/L" + menuItem[i].level + "sel.gif";
				} else {  // no sub menu item number
					menuItem[i].graphic = "<img name=pixLeftMenu" + i + " src='/images/bulletWhiteL" + menuItem[i].level + ".gif' border=0 width=" + iPixWidth + " height=" + iPixHeight +">";
					menuItem[i].normalGraphic = "/images/bulletWhiteL" + menuItem[i].level + ".gif";
					menuItem[i].overGraphic   = "/images/bulletWhiteL" + menuItem[i].level + ".gif";
				}  //let's move to the new level of this menu item
				iCurrentLevel = menuItem[i].level;

				for (j=i; j >= 0; j--) {  // put up the graphics and open the menu items
					if (menuItem[j].level >= 0) {
						eval("iPixWidth  = iPixWidthL"  + menuItem[j].level);
						eval("iPixHeight = iPixHeightL" + menuItem[j].level);
						if (menuItem[j].level < iCurrentLevel) {
							menuItem[j].open = true;
							menuItem[j].graphic = "<img name=pixLeftMenu" + j + " src='/images/L" + menuItem[j].level + "sel.gif' border=0 width=" + iPixWidth + " height=" + iPixHeight +">";
							menuItem[j].normalGraphic = "/images/L" + menuItem[j].level + "sel.gif";
							menuItem[j].overGraphic = "/images/L" + menuItem[j].level + "sel.gif";
							iCurrentLevel = menuItem[j].level;
						}
					}
				}
				// Put the green bar down the left side
				// up first (to the preceeding level 0 - unless already on a 0)
				for (j=i; menuItem[j].level > 0; j--){

					if (menuItem[j].overGraphic != "/images/L" + menuItem[j].level + "sel.gif")  // if there's an error - leave it
						menuItem[j].overGraphic = "/images/bulletWhite.gif";
				}
				// down next (set everything until the next 0 level)
				for (j=i+1; (j < menuItem.length) && (menuItem[j].level > 0) && (currentCategory == menuItem[j].cat); j++);
			}
			menuItem[i].overGraphic = menuItem[i].normalGraphic;

			if (menuItem[i].graphic == "") {
				eval("iPixWidth  = iPixWidthL"  + menuItem[i].level);
				eval("iPixHeight = iPixHeightL" + menuItem[i].level);
				menuItem[i].graphic = "<img name=pixLeftMenu" + i + " src='/images/transparent.gif' border=0  width=" + iPixWidth + " height=" + iPixHeight +">";
				if (menuItem[i].bgcolor == "#006633")
					menuItem[i].overGraphic = "/images/bulletWhiteL" + menuItem[i].level + ".gif";
				else
					menuItem[i].overGraphic = "/images/bulletGreenL" + menuItem[i].level + ".gif";
				menuItem[i].normalGraphic = "/images/transparent.gif";
			}
		}
	}

// * * * * * * *
// *  build menu
// * * * * * * *
//	outHTML += "<br>&nbsp;<br>";

//
//Determine which button the selected and change the category description to long form for header
//

//
//determine category and set up special header appropriately
//
category=""
strSelectedSection = currentCategory;

switch (currentCategory) {

	case "aboutus":
		category=currentCategory
		break
	case "personal":
		category=currentCategory
		break
	case "corporate":
		// Here, we decide if we are to display a regional menu. If so, choose
		// which one. Otherwise, use the global menu.
		category=currentCategory
		if ( strCurrentRegion != "" && strCurrentRegion != "none" )
			strSelectedSection = "corporate_regional_" + strCurrentRegion;
		break
	case "library":
		category=currentCategory
		break
	case "feedback":
		category=currentCategory
		break
	case "online":
		category="passport"
		break
	}

	outHTML += "<img src='/images/universal/spacer.gif' width='1' height='35' border='0'><br />";

	outHTML += "<!-- Note the background image for the following table - we set it to '' to fix a bug with Netscape 4.x -->";
	outHTML += "<table border=0 width=154 cellpadding=0 cellspacing=0 background=''>";


	iCurrentLevel = 0;
	htmlGoingIn = outHTML;

	// If we are in the corporate section, display the current region that the user has selected.
	if( category == "corporate" ) {
		outHTML += "<tr><td colspan=2><img src='/images/greenDotHorizontal.gif' border='0' height='3' width='154'></td></tr>";
		outHTML += "<tr><td colspan='2'><img src='/images/transparent.gif' height='2' width='1'></td></tr>";
		outHTML += "<tr valign=bottom>";
		outHTML += "<td align=center valign=middle width=8 ><img src='/images/transparent.gif' width='8' height='7'></td>";
		outHTML += "<td align=left>";
		outHTML += "<div class=clsIndentL0>";

		if ( strCurrentRegion == "" || strCurrentRegion == "none" )
			outHTML += "<font class='regionMenuHeader'>Select a Region:</font>";
		else
			outHTML += "<font class='regionMenuHeader'>Region: " + strCurrentRegionTitle + "</font>";

		outHTML += "</div>";
		outHTML += "</td>";
		outHTML += "</tr>";
		outHTML += "<tr><td width=8 colspan='2'><img src='/images/transparent.gif' height='2' width='5'></td></tr>";
	}

	for (i=0; i < menuItem.length; i++) {


		if ((menuItem[i].cat == strSelectedSection) && (menuItem[i].title != "") ) {
			strOnMouseEvents = " onMouseOver=\"pixLeftMenu" + i + ".src='" + menuItem[i].overGraphic + "';\" onMouseOut=\"pixLeftMenu" + i + ".src='" + menuItem[i].normalGraphic + "';\" "



// green dots divide level 0 items
			if (menuItem[i].level == 0) {
 				outHTML += "<tr><td colspan=2><img src='/images/greenDotHorizontal.gif' border='0' height='3' width='154'></td></tr>";
			}

			if ( menuItem[i].link.indexOf("northernfunds.com")>=0) { strTarget = ' target="_blank"';} else { strTarget = ''; }

			if (menuItem[i].level == iCurrentLevel) {

				outHTML += "<tr><td colspan='2'><img src='/images/transparent.gif' height='2' width='1'></td></tr>";
				outHTML += "<tr valign=middle>";
				if (menuItem[i].open) { // this item should be marked as open
					outHTML += "<td align=center ";
					if (menuItem[i].level == 0) {
						outHTML += "  bgcolor=#006633 height='16' valign='middle'";
						strSelectedSubSection = menuItem[i].title;
					}
					else {
						outHTML += " valign='middle'";

						// Added the follow for building the page headers for all level 1+
						// pages. Essentially, we will add the section name to the beginning
						// of the heading if we are in a "sub-sub" page.
						blnIsSecondLevelPage = true;
					}
					outHTML += "><a href='" + menuItem[i].link + "' " + strOnMouseEvents + " class=clsNoUnderline" + strTarget + ">" + menuItem[i].graphic + "</a></td>";
					outHTML += "<td width=140 class='clsSelectedMenuItemL" + menuItem[i].level + "'>";
					outHTML += "<div class=clsIndentL" + menuItem[i].level+ ">";
					outHTML += "<a href='" + menuItem[i].link + "' " + strOnMouseEvents + " class=clsNoUnderline" + strTarget + "><font class='clsSelectedMenuItemL" + menuItem[i].level + "'>" + menuItem[i].title + "</font></a>";
					outHTML += "</div>";
					outHTML += "</td>";

					iCurrentLevel = menuItem[i].level + 1;
				} else {
					outHTML += "<td align=center width=8>" + menuItem[i].graphic + "</td>";
					outHTML += "<td align=left>";
					outHTML += "<div class=clsIndentL" + menuItem[i].level+ ">";
					outHTML += "<a href='" + menuItem[i].link + "' " + strOnMouseEvents + " class=clsNoUnderline" + strTarget + ">";
					outHTML += "<font class='clsUnselectedMenuItemL" + menuItem[i].level + "'>" + menuItem[i].title + "</font></a>";
					outHTML += "</div>";
					outHTML += "</td>";

				}
				outHTML += "</tr>";
				outHTML += "<tr><td width=8 colspan='2'><img src='/images/transparent.gif' height='2' width='5'></td></tr>";
			} else {
				if (menuItem[i].level < iCurrentLevel) {
					outHTML += "<tr valign=bottom>";
					outHTML += "<td align=center valign=middle width=8 >" + menuItem[i].graphic + "</td>";
					iCurrentLevel = menuItem[i].level;
					outHTML += "<td align=left>";
					outHTML += "<div class=clsIndentL" + menuItem[i].level+ ">";
					outHTML += "<a href='" + menuItem[i].link + "' " + strOnMouseEvents + " class=clsNoUnderline" + strTarget + ">";
					outHTML += "<font class='clsUnselectedMenuItemL" + menuItem[i].level + "'>" + menuItem[i].title + "</font></a>";
					outHTML += "</div>";
					outHTML += "</td>";
					outHTML += "</tr>";
					outHTML += "<tr><td width=8 colspan='2'><img src='/images/transparent.gif' height='2' width='5'></td></tr>";
				}
			}
		}
	}
	htmlComingOut = outHTML;
	outHTML += "<tr><td colspan=2><img src='/images/greenDotHorizontal.gif' border='0' height='3' width='154'></td></tr>";
	outHTML += "</table>";

	outHTML = outHTML.replace(regexpAmp,"<font face=Verdana> & </font>");
	if (htmlGoingIn != htmlComingOut) {
		if (browserType() == "netscape") {
			if(document.layers) {
				document.write(outHTML);
				if ( ( currentCategory != "") && (currentCategory != "online") ) {
					eval("document.dropdownlayout.document.pic" + currentCategory + ".src = '/images/row1" + currentCategory + "_active.gif';");
				}
			} else {
				document.write(outHTML);
				if ( ( currentCategory != "") && (currentCategory != "online") ) {
					eval("document.pic" + currentCategory + ".src = '/images/row1" + currentCategory + "_active.gif';");
				}
			}
		} else {
			if (strMenuWanted == "") {
				divMenu.innerHTML = outHTML;
				alert("Warning!!! Menu is not built correctly");
			} else {
				document.write(outHTML);
			}
			if ( ( currentCategory != "") && (currentCategory != "online") ) {
				eval("document.pic" + currentCategory + ".src = '/images/row1" + currentCategory + "_active.gif';");
			}
		}
	}
	if (document.location.href.indexOf("DEBUG=yes") > 0) {
		tempMenuWindow = window.open("_BLANK","tmpmenuwindow","resizable=yes,menubar=yes,scrollbars=yes");
		outText = "<pre>";
		for (i = 0; i < menuItem.length; i++)
			outText += menuItem[i].title + " " + menuItem[i].link + "\n";
		outText += "</pre>";
		tempMenuWindow.document.write(outText);
	}

}



// * * * * * * *
// *  Function for showing/hiding layers
// * * * * * * *
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;

function getLayer(name) {
  if (isMinNS4)
    return findLayer(name, document);
  if (isMinIE4)
    return eval('document.all.' + name);
  return null;
}

function findLayer(name, doc) {

  var i, layer;

  for (i = 0; i < doc.layers.length; i++) {
    layer = doc.layers[i];
    if (layer.name == name)
      return layer;
    if (layer.document.layers.length > 0) {
      layer = findLayer(name, layer.document);
      if (layer != null)
        return layer;
    }
  } return null;
}

function showLayer(layer) {
  if (isMinNS4)
    layer.visibility = "show";
  if (isMinIE4)
    layer.style.visibility = "visible";
}

function hideLayer(layer) {
  if (isMinNS4)
    layer.visibility = "hide";
  if (isMinIE4)
    layer.style.visibility = "hidden";
}




// * * * * * * *
// *  This is for the inceptor project
// * * * * * * *


function newInceptor (ppage, pimage)
{
     this.page = ppage;
     this.image = pimage;
     return this;
}



var inceptor = new Array();
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/correspondent/asset_survey.html","http://www.i.northerntrust.com/marketing/trust_cis_correspondent_services_dcs_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/correspondent/asset_survey.html","https://www.i.northerntrust.com/marketing/trust_cis_correspondent_services_dcs_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/correspondent/survey.html","http://www.i.northerntrust.com/marketing/Trust_CIS_Correspondent_Services_TR_NonSecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/correspondent/survey.html","https://www.i.northerntrust.com/marketing/trust_cis_correspondent_services_tr_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/investments/commissionrecapcontactus.html","http://www.i.northerntrust.com/marketing/Trust_CIS_Investments_Commission_Recapture_NonSecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/investments/commissionrecapcontactus.html","https://www.i.northerntrust.com/marketing/trust_cis_investments_commission_recapture_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/investments/asset_class/hedgefunds_questionnaire.html","http://www.i.northerntrust.com/marketing/trust_cis_investments_hedge_funds_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/investments/asset_class/hedgefunds_questionnaire.html","https://www.i.northerntrust.com/marketing/trust_cis_investments_hedge_funds_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/investments/contactus_questionnaire.html","http://www.i.northerntrust.com/marketing/trust_cis_investments_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/investments/contactus_questionnaire.html","https://www.i.northerntrust.com/marketing/trust_cis_investments_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/investments/asset_class/manager_questionnaire.html","http://www.i.northerntrust.com/marketing/trust_cis_investments_ntga_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/investments/asset_class/manager_questionnaire.html","https://www.i.northerntrust.com/marketing/trust_cis_investments_ntga_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/participant/retirement/questionnaire.html","http://www.i.northerntrust.com/marketing/trust-cis_retirement_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/participant/retirement/questionnaire.html","https://www.i.northerntrust.com/marketing/trust_cis_retirement_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/corporate/investments/asset_class/privateequity_questionnaire.html","http://www.i.northerntrust.com/marketing/trust_cis_investments_private_equity_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/corporate/investments/asset_class/privateequity_questionnaire.html","https://www.i.northerntrust.com/marketing/trust_cis_investments_private_equity_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/investor/annual/index.html","http://www.i.northerntrust.com/marketing/trust_ir_annual_report_nonsecure3?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/investor/annual/index.html","https://www.i.northerntrust.com/marketing/trust_ir_annual_report_secure3?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/investor/faq.html","http://www.i.northerntrust.com/marketing/trust_ir_faq_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/investor/faq.html","https://www.i.northerntrust.com/marketing/trust_ir_faq_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/news/02Q2.html","http://www.i.northerntrust.com/marketing/trust_ir_financial_earnings_2_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/news/02Q2.html","https://www.i.northerntrust.com/marketing/trust_ir_financial_earnings_2_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/news/financial_releases.html","http://www.i.northerntrust.com/marketing/trust_ir_financial_earnings_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/news/financial_releases.html","https://www.i.northerntrust.com/marketing/trust_ir_financial_earnings_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/investor/investor_literature_request.html","http://www.i.northerntrust.com/marketing/trust_ir_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/investor/investor_literature_request.html","https://www.i.northerntrust.com/marketing/trust_ir_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northernfunds.com/resources/prospectuses/index.html","http://www.i.northerntrust.com/marketing/trust_mutual_funds_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northernfunds.com/resources/prospectuses/index.html","https://www.i.northerntrust.com/marketing/trust_mutual_funds_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/banking/brochure_email.html","http://www.i.northerntrust.com/marketing/trust_pfs_banking_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/banking/brochure_email.html","https://www.i.northerntrust.com/marketing/trust_pfs_banking_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/financialplanning/email.html","http://www.i.northerntrust.com/marketing/Trust_PFS_Financial_Planning_NonSecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/financialplanning/email.html","https://www.i.northerntrust.com/marketing/trust_pfs_financial_planning_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/investments/contactus.html","http://www.i.northerntrust.com/marketing/trust_pfs_investments_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/investments/contactus.html","https://www.i.northerntrust.com/marketing/trust_pfs_financial_planning_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/aboutus/locations/index.html","http://www.i.northerntrust.com/marketing/trust_pfs_locations_nonsecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/aboutus/locations/index.html","https://www.i.northerntrust.com/marketing/Trust_pfs_locations_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/library/multimedia/presentations/index.html","http://www.i.northerntrust.com/marketing/Trust_PFS_Market_Updates_2_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/library/multimedia/presentations/index.html","https://www.i.northerntrust.com/marketing/trust_pfs_market_updates_2_secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/library/multimedia/audio/index.html","http://www.i.northerntrust.com/marketing/Trust_PFS_Market_Updates_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/library/multimedia/audio/index.html","https://www.i.northerntrust.com/marketing/Trust_PFS_Market_Updates_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/banking/quantum.html","http://www.i.northerntrust.com/marketing/Trust_PFS_MBNA_Credit_Card_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/banking/quantum.html","https://www.i.northerntrust.com/marketing/Trust_pfs_mbna_credit_card_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/onlineservices/brokerage/accountMenu.html","http://www.i.northerntrust.com/marketing/Trust_PFS_Online_Brokerage_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/onlineservices/brokerage/accountMenu.html","https://www.i.northerntrust.com/marketing/trust_pfs_online_brokerage_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/onlineservices/index.html","http://www.i.northerntrust.com/marketing/Trust_PFS_Private_Passport_2_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/onlineservices/index.html","https://www.i.northerntrust.com/marketing/Trust_PFS_Private_Passport_2_Secure2?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/personal/onlineservices/private/enroll.html","http://www.i.northerntrust.com/marketing/_Trust_PFS_Private_Passport_NonSecure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/personal/onlineservices/private/enroll.html","https://www.i.northerntrust.com/marketing/Trust_PFS_Private_Passport_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("http://www.northerntrust.com/library/multimedia/tours/index.html","http://www.i.northerntrust.com/marketing/trust_Various_Passport_Non_Secure?ts=")
inceptor[inceptor.length] = new newInceptor("https://www.northerntrust.com/library/multimedia/tours/index.html","https://www.i.northerntrust.com/marketing/trust_various_passport_Secure?ts=")

for (i=0; i < inceptor.length; i++)
{
    if (inceptor[i].page == document.location.href)
     {

          var d = new Date();
          document.write('<div style="position:absolute; top:0; left:0; visibility:hidden;"><IMG HEIGHT="1" WIDTH="1" SRC="' + inceptor[i].image);
          document.write(escape(d.getTime()));
          var r = Math.random();
          document.write("&r=");
          document.write(escape(r));
          document.write("\"></div>");

     }
}

///////////////////////////////////////////////////////////////////////////////
//Author: ARC World Wide

//Date: 10/10/2004

//Modified Date: 11/30/2004

//Purpose:

//Set a new cookie on User's computer if the cookie doesnot exist.
//Read the cookie and cookieid if cookie file does exist
//Set a date when the cookie will expire and new cookie will be set

//Code Version:2.0

//For questions or comments on this code please contact
//Debbie Hawickhorst, Client Partner
//312.220.3843 | fax 312.220.1995
//Arc Worldwide

///////////////////////////////////////////////////////////////////////////////


function arcww_readID()
	{
		var expDays = 10*365; // number of days the cookie should last
		var expDate = new Date();
		//This is where actual expire date is set
		expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays));

		var id = arcww_GetCookie('trackarc'); //Check if the cookie exist or not
		if (id == null || id == "no id")
		{
			var randomnumber=Math.floor((Number(new Date())-Math.floor(Math.random()*999999999999)))+'-'+Math.floor(Math.random()*99999999999)+'-'+Math.floor(Number(new Date())) // Unique random number which will be used a cookie id

				//the first parameter is the name of the cookieid used in iPlanet webserver to caputer the id value
				//the second parameter is the actual random cookieid that gets generated when users visits the page for the first time
				//the third parameter is the expiry date when the cookie will expire
			arcww_SetCookie('trackarc', randomnumber, expDate);
		}
	}
//////////////////////////////////////////////////////
//Get the value of the cookie id
//////////////////////////////////////////////////////
function arcww_getCookieVal (offset)
	{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
//////////////////////////////////////////////////////////////////////////////////////
//Read the cookie and make sure it matches the name of the cookie
//It accepts the "name" parameter which is basically the name of the cookieid("trackarc")
//////////////////////////////////////////////////////////////////////////////////////
function arcww_GetCookie (name)
	{
		var arg = name + "=";
		var alen = arg.length;  //This is the length of name of the cookieid
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen)
		{
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
			return arcww_getCookieVal (j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
			return null;
	}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Set the new cookie
//the first parameter is the name of the cookieid used in iPlanet webserver to caputer the id value
//the second parameter is the actual random cookieid that gets generated when users visits the page for the first time
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	function arcww_SetCookie (name, value)
	{
		var argv = arcww_SetCookie.arguments;
		var argc = arcww_SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		//the path is set as same on all the pages so that every page can share the same cookie
		("; path=" + "/") +
		//currently the way its setup cookie will take the default the name of the domain
		//ideally we would to set one domain for NT NF NIF so that all three sites can share the same cookie
		// we are not sure if this is possible or not consdering how the domains are set up and what kind
		// of security issues would come because of that
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
	}
    arcww_readID();
	