<!-- 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("formCalcLarge", "location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes,width=720,height=640,top=0,left=" + (screen.availWidth - 735));
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=300,height=450,left="+ (screen.availWidth - 315) +",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");
controlledWin [controlledWin.length] = new winAttributes("clientVideo", "scrollbars=no,resizable=yes,height=400,width=600,menubar=no");
controlledWin [controlledWin.length] = new winAttributes("LTCCalc", "location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes,width=800,height=720,top=0,left=" + (screen.availWidth - 800));

//END WINDOW STYLES-----------------------------------------
function openWin(name, URL) {
	if(URL==null || allTrim(URL)=="" || allTrim(URL)=="#") return;

	if (name == "pdfForm") {
	  if (window._hbDownload) {
	    _hbDownload(URL);
	  }
	}
  
  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 -->

function clickleaveSite(url,message) {
	boolConfirmResponse = confirm(message);
    if(boolConfirmResponse)
	{
		window.open(url);
		return false;
	}
	else
		return false;
}

