function getSSL(page) {
	return "https://" + window.location.hostname + page;
}
function getSSLOpen(page) {
	window.location=("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 Platinum Recovery's web site. You are being directed to a third party hosted recruiting solution." );
			break;
		case "nonaffiliate2":
			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 FooterDate()
{
	var ftrDate=new Date();
	var ftrYear=ftrDate.getYear();
	if (ftrYear < 1000) {
	ftrYear = ftrYear + 1900;
}
	document.write(ftrYear);
}


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";
	}
}
