if (top.document.location.href.indexOf("TYPE=iras") > 0)
	document.location.replace("http://www.northerntrust.com/pws/jsp/display2.jsp?XML=pages/nt/0308/28515344_2708.xml");
var menuHeight = 0;
var menuHeightL1 = 47;
var menuHeightL2 = 25;


function highlighton(theDivID) {
	var obj = document.getElementById(theDivID)
	obj.style.backgroundColor = "#A6BD88"
	for (var i=0; i < obj.childNodes.length; i++) {
		if( obj.childNodes.item(i).nodeName == 'A' ) {
			obj.childNodes.item(i).style.color = '#FFFFFF';
		} 
	}
	imgObj = document.getElementById('menubullet_' + theDivID)
	imgObj.src = '/iras/images/orangeBullet.gif'
}
function highlightoff(theDivID) {
	var obj = document.getElementById(theDivID)
	obj.style.backgroundColor = "#6B8B97"
	for (var j=0; j < obj.childNodes.length; j++) {
		if( obj.childNodes.item(j).nodeName == 'A' ) {
			obj.childNodes.item(j).style.color = '#CFEDF9';
		} 
	}
	//obj.style.color = "#CFEDF9"
	imgObj = document.getElementById('menubullet_' + theDivID)
	imgObj.src = '/images/transparent.gif'
}
function textchangeon(obj) {
	obj.style.color = "#C4E2EE"
}
function textchangeoff(obj) {
	obj.style.color = 	"#F0F4F5"
}
function goSearch() {
	//window.document.searchfrm.server.value = "web-xa2g-pws"
	//window.document.searchfrm.serverPort.value = "80"
	window.document.searchfrm.xsl.value = "http://" + location.hostname + ":" + getPort() + "/xsl/searchTsegs.xsl"
	window.document.searchfrm.submit();
}
function popNewWindow( theUrl ) {
	newWindow = window.open(theUrl);
	newWindow.focus();
	return false;
}
function jumpPage(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value

	if (newPage != "") {
		newWindow = window.open(newPage);
		newWindow.focus();
	}
}
function goChild(href) {
	window.location.href= href;
}
function cursorToHand(thisdiv) {
	if( document.all ) 
		thisdiv.style.cursor = 'hand';    // Explorer 4-6 Windows, Opera, Explorer 5 Mac, Safari 1.2+
	else 
		thisdiv.style.cursor = 'pointer'; // Explorer 6 Windows, Mozilla, Opera, Explorer 5 Mac, Safari 1.0+
}
function findLeftColumnHeight() {
	var mainBoxPadding = 24;
	var ppBoxHeight = 170;
	var contactBoxHeight;
	var boxSpacing;
	if( pageCode == 'contactUs' )	boxSpacing = 12; else boxSpacing = 21;
	var leftColumnHeight = document.getElementById('main').offsetHeight - mainBoxPadding - boxSpacing;
	if( pageCode == 'contactUs' )	contactBoxHeight = 0; else 	contactBoxHeight = 120;
	var ppBackHeight = leftColumnHeight - ppBoxHeight - contactBoxHeight - menuHeight;
	//alert("leftColumnHeight is " + leftColumnHeight + "\nmenuHeight is " + menuHeight + "\ncontactBoxHeight is " + contactBoxHeight + "\nppBoxHeight is " + ppBoxHeight + "\nppBackHeight is " + ppBackHeight );
	if( ppBackHeight > 0 ) 	document.getElementById('passport_back').style.height = ppBackHeight+'px';
}
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 = '/iras/popups/popup_noprint.html?';
	} else {
		strPopUpURL = '/iras/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 'screenshot':
			strWindowSettings = 'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,width=630,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 = '/iras/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) {
	if( docName == 'http://www.northerntrust.com/tools/') 
		docName = '/iras/incs/tools.html'
	var rightNow = new Date();
	iUnique = rightNow.getTime();
	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 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");
}

// the rest of this code is . . .

// Copyright © 2001 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.

// ugly workaround for missing support for selectorText in Netscape6/Mozilla
// call onLoad() or before you need to do anything you would have otherwise used
// selectorText for.
var ugly_selectorText_workaround_flag = false;
var allStyleRules;
// code developed using the following workaround (CVS v1.15) as an example.
// http://lxr.mozilla.org/seamonkey/source/extensions/xmlterm/ui/content/XMLTermCommands.js
function ugly_selectorText_workaround() {
	if((navigator.userAgent.indexOf("Gecko") == -1) ||
	   (ugly_selectorText_workaround_flag)) {
		return; // we've already been here or shouldn't be here
	}
	var styleElements = document.getElementsByTagName("style");
	
	for(var i = 0; i < styleElements.length; i++) {
		var styleText = styleElements[i].firstChild.data;
		// this should be using match(/\b[\w-.]+(?=\s*\{)/g but ?= causes an
		// error in IE5, so we include the open brace and then strip it
		allStyleRules = styleText.match(/\b[\w-.]+(\s*\{)/g);
	}

	for(var i = 0; i < allStyleRules.length; i++) {
		// probably insufficient for people who like random gobs of 
		// whitespace in their styles
		allStyleRules[i] = allStyleRules[i].substr(0, (allStyleRules[i].length - 2));
	}
	ugly_selectorText_workaround_flag = true;
}


// setStyleById: given an element id, style property and 
// value, apply the style.
// args:
//  i - element id
//  p - property
//  v - value
//
function setStyleById(i, p, v) {
	var n = document.getElementById(i);
	n.style[p] = v;
}

// getStyleById: given an element ID and style property
// return the current setting for that property, or null.
// args:
//  i - element id
//  p - property
function getStyleById(i, p) {
	var n = document.getElementById(i);
	var s = eval("n.style." + p);

	// try inline
	if((s != "") && (s != null)) {
		return s;
	}

	// try currentStyle
	if(n.currentStyle) {
		var s = eval("n.currentStyle." + p);
		if((s != "") && (s != null)) {
			return s;
		}
	}
	
	// try styleSheets
	var sheets = document.styleSheets;
	if(sheets.length > 0) {
		// loop over each sheet
		for(var x = 0; x < sheets.length; x++) {
			// grab stylesheet rules
			var rules = sheets[x].cssRules;
			if(rules.length > 0) {
				// check each rule
				for(var y = 0; y < rules.length; y++) {
					var z = rules[y].style;
					// selectorText broken in NS 6/Mozilla: see
					// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
					ugly_selectorText_workaround();
					if(allStyleRules) {
						if(allStyleRules[y] == i) {
							return z[p];
						}			
					} else {
						// use the native selectorText and style stuff
						if(((z[p] != "") && (z[p] != null)) ||
						   (rules[y].selectorText == i)) {
							return z[p];
						}
					}
				}
			}
		}
	}
	return null;
}


// setStyleByClass: given an element type and a class selector,
// style property and value, apply the style.
// args:
//  t - type of tag to check for (e.g., SPAN)
//  c - class name
//  p - CSS property
//  v - value
var ie = (document.all) ? true : false;

function setStyleByClass(t,c,p,v){
	var elements;
	if(t == '*') {
		// '*' not supported by IE/Win 5.5 and below
		elements = (ie) ? document.all : document.getElementsByTagName('*');
	} else {
		elements = document.getElementsByTagName(t);
	}
	for(var i = 0; i < elements.length; i++){
		var node = elements.item(i);
		for(var j = 0; j < node.attributes.length; j++) {
			if(node.attributes.item(j).nodeName == 'class') {
				if(node.attributes.item(j).nodeValue == c) {
					eval('node.style.' + p + " = '" +v + "'");
				}
			}
		}
	}
}

// getStyleByClass: given an element type, a class selector and a property,
// return the value of the property for that element type.
// args:
//  t - element type
//  c - class identifier
//  p - CSS property
function getStyleByClass(t, c, p) {
	// first loop over elements, because if they've been modified they
	// will contain style data more recent than that in the stylesheet
	var elements;
	if(t == '*') {
		// '*' not supported by IE/Win 5.5 and below
		elements = (ie) ? document.all : document.getElementsByTagName('*');
	} else {
		elements = document.getElementsByTagName(t);
	}
	for(var i = 0; i < elements.length; i++){
		var node = elements.item(i);
		for(var j = 0; j < node.attributes.length; j++) {
			if(node.attributes.item(j).nodeName == 'class') {
				if(node.attributes.item(j).nodeValue == c) {
					var theStyle = eval('node.style.' + p);
					if((theStyle != "") && (theStyle != null)) {
						return theStyle;
					}
				}
			}
		}		
	}
	// if we got here it's because we didn't find anything
	// try styleSheets
	var sheets = document.styleSheets;
	if(sheets.length > 0) {
		// loop over each sheet
		for(var x = 0; x < sheets.length; x++) {
			// grab stylesheet rules
			var rules = sheets[x].cssRules;
			if(rules.length > 0) {
				// check each rule
				for(var y = 0; y < rules.length; y++) {
					var z = rules[y].style;
					// selectorText broken in NS 6/Mozilla: see
					// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
					ugly_selectorText_workaround();
					if(allStyleRules) {
						if((allStyleRules[y] == c) ||
						   (allStyleRules[y] == (t + "." + c))) {
							return z[p];
						}			
					} else {
						// use the native selectorText and style stuff
						if(((z[p] != "") && (z[p] != null)) &&
						   ((rules[y].selectorText == c) ||
						    (rules[y].selectorText == (t + "." + c)))) {
							return z[p];
						}
					}
				}
			}
		}
	}

	return null;
}

// setStyleByTag: given an element type, style property and 
// value, and whether the property should override inline styles or
// just global stylesheet preferences, apply the style.
// args:
//  e - element type or id
//  p - property
//  v - value
//  g - boolean 0: modify global only; 1: modify all elements in document
function setStyleByTag(e, p, v, g) {
	if(g) {
		var elements = document.getElementsByTagName(e);
		for(var i = 0; i < elements.length; i++) {
			elements.item(i).style[p] = v;
		}
	} else {
		var sheets = document.styleSheets;
		if(sheets.length > 0) {
			for(var i = 0; i < sheets.length; i++) {
				var rules = sheets[i].cssRules;
				if(rules.length > 0) {
					for(var j = 0; j < rules.length; j++) {
						var s = rules[j].style;
						// selectorText broken in NS 6/Mozilla: see
						// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
						ugly_selectorText_workaround();
						if(allStyleRules) {
							if(allStyleRules[j] == e) {
								s[p] = v;
							}			
						} else {
							// use the native selectorText and style stuff
							if(((s[p] != "") && (s[p] != null)) &&
							   (rules[j].selectorText == e)) {
								s[p] = v;
							}
						}

					}
				}
			}
		}
	}
}

// getStyleByTag: given an element type and style property, return
// the property's value
// args:
//  e - element type
//  p - property
function getStyleByTag(e, p) {
	var sheets = document.styleSheets;
	if(sheets.length > 0) {
		for(var i = 0; i < sheets.length; i++) {
			var rules = sheets[i].cssRules;
			if(rules.length > 0) {
				for(var j = 0; j < rules.length; j++) {
					var s = rules[j].style;
					// selectorText broken in NS 6/Mozilla: see
					// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
					ugly_selectorText_workaround();
					if(allStyleRules) {
						if(allStyleRules[j] == e) {
							return s[p];
						}			
					} else {
						// use the native selectorText and style stuff
						if(((s[p] != "") && (s[p] != null)) &&
						   (rules[j].selectorText == e)) {
							return s[p];
						}
					}

				}
			}
		}
	}

	// if we don't find any style sheets, return the value for the first
	// element of this type we encounter without a CLASS or STYLE attribute
	var elements = document.getElementsByTagName(e);
	var sawClassOrStyleAttribute = false;
	for(var i = 0; i < elements.length; i++) {
		var node = elements.item(i);
		for(var j = 0; j < node.attributes.length; j++) {
			if((node.attributes.item(j).nodeName == 'class') ||
			   (node.attributes.item(j).nodeName == 'style')){
			   sawClassOrStyleAttribute = true;
			}
		}
		if(! sawClassOrStyleAttribute) {
			return elements.item(i).style[p];
		}
	}
}
