var selectedSearch = "";

// Check to see if this is a Netscape-based browser:
var NS4 = false;
if (navigator.appName == "Netscape") {
    NS4 = true;
}

if (NS4) document.captureEvents(Event.KEYPRESS);
  document.onkeypress = doKey;
function doKey(e)
{
  var whichASC = (NS4) ? e.which : event.keyCode;
  if (whichASC == 13)
  {

    if (selectedSearch == "globalsearch")
    {
      globalSearch();
    }

  }
}

function globalSearch()
{
	if(doGlobalSearch())
	{
		document.forms[0].method='get';
		document.forms[0].submit()
	};
}


function doGlobalSearch()
{
  var temp = "/global--searches--searchresults";
  if(!NS4){
     if(document.forms[0].HiddenAgentURL != null){
			if(document.forms[0].HiddenAgentURL.value != ""){
			   temp = document.forms[0].HiddenAgentURL.value + temp;
			}else{
			   temp = "/tn"  + temp;
			}
		  }else{
			 temp = "/tn"  + temp;
		  }
	  document.forms[0].SearchText.value = document.forms[0].GlobalSearchText.value;
	  document.forms[0].SearchType.value = 'searchcomponent';
	  //for Netscape navigator the model_trigger comes through as ++ instead of "" like it should
	  //if this is a problem the form can be submitted with enter in Netscape in other ways.
	 // document.forms[0].model_trigger.value = '';
	  document.forms[0].action = temp;
	  return true;
  }


  if(NS4)
  {
   //for FR sites




		 if (document.forms[0].HiddenAgentURL)
		 {
			 temp = document.forms[0].HiddenAgentURL.value + temp;
		   	 document.forms[0].SearchText.value = document.forms[0].GlobalSearchText.value;

		 }
	     else
	     {  //NMFN
		   temp = "/tn"  + temp;
		   document.forms[0].SearchText.value = document.forms[0].GlobalSearchText.value;
	     }

	     document.forms[0].SearchType.value = 'searchcomponent';
		  //for Netscape navigator the model_trigger comes through as ++ instead of "" like it should
		 //if this is a problem the form can be submitted with enter in Netscape in other ways.
		//document.forms[0].model_trigger.value = '';
	  	document.forms[0].action = temp;
	  return true;
  }

}






//******************************* POPUP.JS CODE ***********************************************
<!-- hide from JavaScript-challenged browsers
var popupWin = null;
var controlledWin = new Array();


function winAttributes(name, featureString) {
	this.name = name;
	this.featureString = featureString;
}

//WINDOW STYLES------------------------------------------
//To create a new window style copy:
//	1. Copy the last window style to a new line
//	2. Change the first parameter to a new/unique name.
//	3. Change the second parameter to match the window attributes you need.

//	Your JavaScript call will be: openWin("YourWinName", "http://YourURL.com");
controlledWin [controlledWin.length] = new winAttributes("DILO", "width=345,height=400,left=100,top=100");
controlledWin [controlledWin.length] = new winAttributes("formCalc", "location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=425,top=0,left=" + (screen.availWidth - 615));
controlledWin [controlledWin.length] = new winAttributes("longevityGame", "location=no,toolbar=no,status=yes,scrollbars=no,resizable=yes,menubar=yes,width=640,height=500,top=0,left=" + (screen.availWidth - 655));
controlledWin [controlledWin.length] = new winAttributes("FWSContactForm", "location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes,width=620,height=550,top=0,left=" + (screen.availWidth - 635));
controlledWin [controlledWin.length] = new winAttributes("SES", "scrollbars=yes,resizable=yes,width=620,height=540,left=150,top=0");;
controlledWin [controlledWin.length] = new winAttributes("glossary", "scrollbars=yes,width=320,height=330,left=150,top=0");
controlledWin [controlledWin.length] = new winAttributes("dailyUnitValues", "scrollbars=yes,resizable=yes,width=600,height=450,left=150,top=0");
controlledWin [controlledWin.length] = new winAttributes("printerFriendly", "location=no,menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=660,height=500,left=150,top=0");
controlledWin [controlledWin.length] = new winAttributes("officeLocator", "scrollbars=yes,resizable=yes,height=660,width=820,left=" + (screen.availWidth - 835) + ",top=" + (screen.availHeight - 740) + ",menubar=yes");
controlledWin [controlledWin.length] = new winAttributes("pdfForm", "location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=425,left=100,top=100");
controlledWin [controlledWin.length] = new winAttributes("webSurvey", "location=no,status=yes,width=700,height=500,top=60,left=100,toolbar=no,menubar=no,scrollbars=yes,titlebar=yes,resizable=yes");
controlledWin [controlledWin.length] = new winAttributes("russellDailyPrices", "scrollbars=yes,resizable=yes,width=600,height=450,left=150,top=0");
controlledWin [controlledWin.length] = new winAttributes("apl", "location=no,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=765,height=525,left=" + (screen.availWidth - 780) + ",top=0,menubar=no");
controlledWin [controlledWin.length] = new winAttributes("associates", "location=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=600,left=40,top=40");
controlledWin [controlledWin.length] = new winAttributes("SAMPLE", "scrollbars=yes,resizable=yes,width=657,height=600,left=150,top=0");
controlledWin [controlledWin.length] = new winAttributes("CONTACTUS", "scrollbars=yes,resizable=yes,width=775,height=600,left=" + (screen.availWidth - 785) + ",top=0");
controlledWin [controlledWin.length] = new winAttributes("CI", "location=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=440,left=" + (screen.availWidth - 615) + ",top=0,menubar=no");
controlledWin [controlledWin.length] = new winAttributes("recruiting", "location=no,status=yes,scrollbars=yes,resizable=yes,width=620,height=550,left=" + (screen.availWidth - 635) + ",top=0,menubar=no");
controlledWin [controlledWin.length] = new winAttributes("CareerVideo", "width=350,height=450,left="+ (screen.availWidth - 365) +",top=0");
controlledWin [controlledWin.length] = new winAttributes("LOGIN", "scrollbars=yes,resizable=yes,menubar,toolbar,location,width=770,height=540,left=150,top=0");;
controlledWin [controlledWin.length] = new winAttributes("SignUp", "location=no,toolbar=no,status=yes,scrollbars=yes,width=1020,height=650,resizable=yes,top=0,left=0");
controlledWin [controlledWin.length] = new winAttributes("GetMap", "scrollbars=yes,resizable=yes,height=380,width=788,left=" + (screen.availWidth - 803) + ",top=" + (screen.availHeight - 560) + ",menubar=yes");

//END WINDOW STYLES-----------------------------------------
function openWin(name, URL) {
	if(URL==null || allTrim(URL)=="" || allTrim(URL)=="#") return;

	for (i = 0; i < controlledWin.length; i++) {
		var tempWin = controlledWin[i];
		if (name == tempWin.name) {
			popupWin = window.open(URL, tempWin.name, tempWin.featureString);
		}
	}
}

function winControl(name, url) {
	if (popupWin == null){
		openWin(name, url);
	}
	else if (!popupWin.closed){
		popupWin.close();
		openWin(name, url);
	}
	else {
		openWin(name, url);
	}
	self.name = "nmfnParent";
}

function openLegal(targ) {
	if (window.opener && window.opener.location)
	{
		window.opener.location.href=targ;
	}
	else
	{
		window.open(targ, 'legal');
	}
}

function previewAlert(){
var associates = associatesLinkCheck();
var commSvc = communitySvcLinkCheck();
if(siteTemplateType !=1)
    alert('While in Preview Mode, Home, Profile, Our Expertise' + associates + commSvc+ ', Customer Center, Financial Highlights and Careers are available for viewing.');
else
	alert('While in Preview Mode, Home, Profile, Our Expertise, Customer Center, Financial Highlights and Careers are available for viewing.');
}

function associatesLinkCheck(){
if(associatesLinkPresent =="T")
	return ", Associates";
else if(associatesLinkPresent =="F")
	return "";
}

function communitySvcLinkCheck(){
if(communityServiceLinkPresent =="T")
	return ", Community Services";
else if(communityServiceLinkPresent =="F")
	return "";
}

function allTrim(s) {
//Trim leading and trailing spaces from a string.
	while((s.indexOf(" ")==0) && (s.length>0))
		s=s.substr(1);
	while((s.lastIndexOf(" ") == s.length - 1) && (s.length>0))
		s=s.substr(0, s.length-1);
	return s;
}

// done hiding -->
// ********************************** END OF POPUP.JS ***************************************

