// JavaScript Document

var str=(location.hostname)

if(str.match("wwd"))
{
env = "wwd"
}
else if(str.match("wwq"))
{
env = "wwq"
}
else
{
env = "www"
}

function FooterDate()
 {
     var ftrDate=new Date();
     var ftrYear=ftrDate.getYear();
     if (ftrYear < 1000) {
         ftrYear = ftrYear + 1900;
     };
     document.write(ftrYear);
 };
 
<!-- bank names -->

function BankName()
{
	if(str.match("1stnationalbank"))
	{
	document.write("First National Bank");
	}
	else if(str.match("fnbconline"))
	{
	document.write("First National Bank of Colorado");
	}
	else if(str.match("washingtoncountybank"))
	{
	document.write("Washington County Bank");
	}
	else if(str.match("firstnationalonlinebanking"))
	{
	document.write("First National Bank");
	}
	else if(str.match("firstnational"))
	{
	document.write("First National Bank");
	}
	else if(str.match("fnbsd"))
	{
	document.write("First National Bank South Dakota");
	}
	else if(str.match("fnbnorfolk"))
	{
	document.write("First National Bank");
	}
	else if(str.match("fremontnational"))
	{
	document.write("Fremont National Bank & Trust");
	}
	else if(str.match("pvsb"))
	{
	document.write("Platte Valley State Bank & Trust");
	}
	else if(str.match("fnbnp"))
	{
	document.write("First National Bank North Platte");
	}
	else if(str.match("fnbk"))
	{
	document.write("First National Bank");
	}
	else if(str.match("sibleystatebank"))
	{
	document.write("Sibley State Bank");
	}
	else if(str.match("fnsouthwest"))
	{
	document.write("First National Bank Southwest");
	}
	else{
	document.write("")
	}
};
	
function BankLogo()
{
	var str=(location.hostname)
	if(str.match("1stnationalbank"))
	{
	document.write("<a href='http://www.1stnationalbank.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("firstnationalonlinebanking"))
	{
	document.write("<a href='http://www.firstnationalonlinebanking.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}	
	else if(str.match("fnbsd"))
	{
	document.write("<a href='http://www.fnbsd.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("fnbnp"))
	{
	document.write("<a href='http://www.fnbnp.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("fnbk"))
	{
	document.write("<a href='http://www.fnbk.com'><img src='/mark/images/brand_on.gif' border=0 /></a>");
	}	
	else if(str.match("fnbsd"))
	{
	document.write("<a href='http://www.fnbsd.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
		else if(str.match("firstnational"))
	{
	document.write("<a href='http://www.firstnational.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("fnsouthwest"))
	{
	document.write("<a href='http://www.fnsouthwest.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
		else if(str.match("sibleystatebank"))
	{
	document.write("<a href='http://www.sibleystatebank.com'><img src='/common/iws/images/fnblogo_54.gif' border=0 /></a>");
	}
	else if(str.match("fremontnational"))
	{
	document.write("<a href='http://www.fremontnational.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("pvsb"))
	{
	document.write("<a href='http://www.pvsb.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("fnbconline"))
	{
	document.write("<a href='http://www.fnbconline.com'><img src='/config/html/en/theme/brand.gif' border=0 /></a>");
	}
	else if(str.match("washingtoncountybank"))
	{
	document.write("<a href='http://www.washingtoncountybank.com'><img src='/common/iws/images/fnblogo_22.gif' border=0 /></a>");
	}
	else{
	document.write("")
	}
};
	
<!-- apply links for banks -->
	
function FraudLink()
{
	{
	document.write("<a href='https://" + str + "/marketing/fraud/index.jsp'>");
	}
};
	

function Address()
{
	if(str.match("1stnationalbank"))
	{
	document.write("PO Box 578 - Fort Collins, CO 80521");
	}
	else if(str.match("firstnationalonlinebanking"))
	{
	document.write("P.O. Box 730 Columbus, NE 68602");
	}
	else if(str.match("fnbnorfolk"))
	{
	document.write("P.O. Box 730 Columbus, NE 68601");
	}
	else if(str.match("fnbsd"))
	{
	document.write("332 Broadway, P.O. Box 670, Yankton, SD 57078-0670");
	}
	else if(str.match("fnsouthwest"))
	{
	document.write("P.O. Box 1746 - Frisco, TX 75034");
	}
	else if(str.match("fremontnational"))
	{
	document.write("P.O. Box 228 Fremont, NE 68026-0228");
	}
	else if(str.match("pvsb"))
	{
	document.write("P.O. Box 430 - Kearney, NE 68848-0430");
	}
	else if(str.match("fnbconline"))
	{
	document.write("P.O. Box 9032 - Boulder, CO 80301");
	}
	else if(str.match("fnbnp"))
	{
	document.write("P.O. Box 10 North Platte, NE 69103 ");
	}
	else if(str.match("sibleystatebank"))
	{
	document.write("P.O. Box 10 North Platte, NE 69103 ");
	}
	else if(str.match("fnbk"))
	{
	document.write("P.O. Box 7428 Shawnee Mission, KS 66207-0428");
	}
	else if(str.match("washingtoncountybank"))
	{
	document.write("1523 Washington Street, P.O. Box 248, Blair, NE 68008-0248 (402) 426-2111</br>303 S. Thirteenth Street, P.O. Box 238, Tekamah, NE 68061 (402) 374-2020");
	}
		else if(str.match("firstnational"))
	{
	document.write("1620 Dodge St. Omaha, NE 68197");
	}
	 
	else{
	document.write("")
	}
};


function getSSL(page) {
	return "https://" + window.location.hostname + page;
}

//BEGIN LINK DISCLOSURE ALERT
function siteDisclosure( linktype, ourSite, newSite, newSiteURL, newWindow ){
	switch ( linktype ) {
		// Linking to an FNNI family site
		case "affiliate":
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nThe products and services provided by the site you are entering are part of the FNNI Corporate family." );
			break;
		case "bankcard":		
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nThe products and services provided by the site you are entering are part of the FNNI Corporate family.  " + newSite + " may have a different privacy policy than " + ourSite + ". Please review " + newSite + "'s privacy policy." );
			break;
		// e.g., Microsoft, Adobe, Netscape
		case "nonaffiliate":
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nAny products and services accessed through this link are not provided, endorsed or guaranteed by " + ourSite + ".  " + newSite + " may have a privacy policy that is different than " + ourSite + ".  Please review the " + newSite + " privacy policy." );
			break;
		// e.g., Visa
		case "strategicaffiliate":
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nProducts and services accessed through this link are not provided or guaranteed by " + ourSite + ". " + newSite + " may have a privacy policy that is different than " + ourSite + ".\n\nPlease review the " + newSite + " privacy policy." );
			break;
		case "careers":
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nYou are being directed to a third party hosted recruiting solution." );
			break;
		case "mortgage":
			confirmValue = confirm( "You are leaving " + ourSite + "'s web site.\nYou are being directed to a third party hosted home financing solution." );
			break;
	}//end switch
	
	if ( confirmValue ) {
		if (newWindow != "yes") {
			document.location=newSiteURL;
		}//end nested if
		else {
			window.open(newSiteURL);
		}//end else
	}//end if

}//end siteDisclosure

function spawnNewWindowOneOfaCard()
{
	open ("http://www.oneofacard.com/generalinfo.asp","", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=720,height=520");
}
function spawnSecondOneOfaCard()
{
	open ("http://www.oneofacard.com/generalinfo2.asp","", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=720,height=520");
}
function spawnNewWindowCheck21()
{
	open ("/iws_help/substitutecheck_disclosure.htm","", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=420,height=500");
}
function spawnNewCCWindow(bank, jumpto, applynow, customCard, plasticCode)
{
	open ("/welcome/DynamicApp?bank=" + bank + "&jumpto=" + jumpto + "&applynow_=" + applynow + "&Custom_Card=" + customCard + "&Plastic_Indicator=" + plasticCode,"", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=600,height=450");
}
function popWin(url,width,height) {
	open (url,"NewWindow", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=" + width + ",height=" + height);
}
function spawnTerm(product, siteID){
	var location = "https://" + window.location.hostname + "/welcome/DynamicApp?jumpto=" + product + "&goterms=Y&bank=" + siteID;
	open (location, "", "scrollbars=yes,menubar=no,resizable=1,copyhistory=1,width=800,height=600");
}
function formHandler(form) {
var windowprops = "height=500,width=500,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

var URL = form.site.options[form.site.selectedIndex].value;
	if (URL != 0){
	popup = window.open(URL,"MenuPopup",windowprops);
	}
}


function init()
      {
        // Microsoft Internet Explorer
        if (document.all)
        {
          document.all.loading.visibility="hidden";
          document.all.myapplet.visibility="visible";
          document.applets[0].repaint();
        }
        // Netscape Navigator
        else
        {
          document.loading.visibility="hide";
          document.myapplet.visibility="visible";
        }
      }
	  
	  
function buildform(bank_promo_code, product, inType) {  
	var form = document.productinfo;
	
	/*
	   Description of parameters:
	   siteid                    = OM (for now... will eventually be based on branded bank code)
	   ref_url                   = URL of the branded bank products page the servlet will put in the "BACK" button
	   sub_bank_code     = 000  (for now... will eventually be based on branded sub_bank code)
	   bank_promo_code = promotion code that uniquely identifies the selected specific product or product category
	   alignment =          = the position of the link that calls this form (top, left, main, etc.) 
	   brand_img =            URL of the bank logo.
	*/

	form.bank_promo_code.value = bank_promo_code;
	form.product.value = product;
	form.type.value = inType;
	
	var webapp="welcome/Marketing";
	
	if ((self.opener)&&(self.opener.location.href.indexOf("Online")) >= 0) {
		webapp="Online/jsp/products/indiv_or_joint.jsp";
		form.siteid.value = "01";
	    form.target="main";
	        
	    if (inType=="checking") {
			self.opener.parent.leftmenu.clickMenuItem('prodChecking',false);
		} 
		else if (inType=="savings") {
        	self.opener.parent.leftmenu.clickMenuItem('prodSavings',false);
		}
	}
    else {
		form.ref_url.value=self.location.href;
	}
	
	var myHost = self.location.host;
	if (myHost.indexOf('teamsite') > -1) {
		myHost = "wwd.firstnational.com";
	}
    form.action="https://" + myHost + "/"+webapp;
	form.submit();
	
	if ((self.opener)&&(self.opener.location.href.indexOf("Online")) >= 0) {
		self.location="https://" + self.location.host + "/welcome/jsp/closewindow.jsp";
	}
}
