// ---------------------------------------------------------------------------------------------------------------------------------
// FILE CONTAINS FUNCTIONS USED TO OPEN NEW WINDOWS ON ABA WEB SITE
// ---------------------------------------------------------------------------------------------------------------------------------
var newWin = null;

// ---------------------------------------------------------------------------------------------------------------------------------
// FUNCTION FOR OPENING ALL NEW WINDOWS EXCEPT APPLICATION
// sWindowName - Identifies what content to load in new window
// sSubPage - Used to identify particular page with in AO Demo in new window displaying Demo
// ---------------------------------------------------------------------------------------------------------------------------------
function openNewWin(sWindowName, sSubPage)	{
	if (sWindowName == "trvlterms")	{
		sSiteURL="https://www.accountonline.com/ACQ/DisplayTerms?sc=FPWDW2359ADA9U5Q60W&app=UNSOL&siteId=adacard&langId=en&BUS_TYP_CD=consumer&DOWNSELL_LEVEL=0&BALCON_SC=&B=A&DOWNSELL_BRANDS=";
		sWidth="750";
		sHeight="450";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}
	else if (sWindowName == "lwrtterms")	{
		sSiteURL="https://www.accountonline.com/ACQ/DisplayTerms?sc=FPPDW3959ADA9U5R60W&app=UNSOL&siteId=adacard&langId=en&BUS_TYP_CD=consumer&DOWNSELL_LEVEL=0&BALCON_SC=&B=M&DOWNSELL_BRANDS=";
		sWidth="750";
		sHeight="450";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "busterms")	{
		sSiteURL="busterms.htm";
		sWidth="750";
		sHeight="450";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "Privacy")	{
		sSiteURL="http://www.citibank.com/us/cards/privacy.htm";
		sWidth="600";
		sHeight="450";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "AODemo")	{
		if (sSubPage == "Home")	{
			sSiteURL="http://www.citibank.com/us/cards/tour/citiusa2/index.htm";
		}
		else if (sSubPage == "CTP")	{
			sSiteURL="http://www.citibank.com/us/cards/tour/citiusa2/click_to_pay.htm";
		}
		else if (sSubPage == "Security")	{
			sSiteURL="http://www.citibank.com/us/cards/tour/citiusa2/security.htm";
		}
		else if (sSubPage == "BT")	{
			sSiteURL="http://www.citibank.com/us/cards/tour/citiusa2/balance_transfer.htm";
		}
		else if (sSubPage == "AllE")	{
			sSiteURL="http://www.citibank.com/us/cards/tour/citiusa2/statements.htm";
		}
		sWidth="675";
		sHeight="600";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "TravelerMiles")	{
		sSiteURL="/us/cards/pop_go.jsp?dest=http://www.travelermiles.com";
		sWidth="750";
		sHeight="550";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="Yes";
		sStatus="Yes";
		sLocation="Yes";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "ABA")	{
		sSiteURL="/us/cards/pop_go.jsp?dest=http://www.abanet.org";
		sWidth="785";
		sHeight="575";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="Yes";
		sStatus="Yes";
		sLocation="Yes";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "Rewards")	{
		sSiteURL="trvlrwdstcs.htm";
		sWidth="750";
		sHeight="450";
		sMenuBar="Yes";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	
	else if (sWindowName == "Points")	{
		sSiteURL="points.htm";
		sWidth="300";
		sHeight="500";
		sMenuBar="No";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="5";
		sLeft="200";
	}	
	else if (sWindowName == "ADALegal")	{
		sSiteURL="adalgl_dtls.htm";
		sWidth="500";
		sHeight="250";
		sMenuBar="No";
		sResizable="Yes";
		sScrollbars="Yes";
		sToolbar="No";
		sStatus="No";
		sLocation="No";
		sTop="25";
		sLeft="25";
	}	

	if (newWin && !newWin.closed)	{
		newWin.close();
	}

	newWin = window.open( sSiteURL, "SubWindow", "menubar="+sMenuBar+",status="+sStatus+",toolbar="+sToolbar+",location="+sLocation+",resizable="+sResizable+",scrollbars="+sScrollbars+",screenx=" + sTop +",screeny=" + sLeft +",width=" + sWidth + ",height=" + sHeight + ",top=" + sTop +",left=" + sLeft);
	newWin.focus();
} 

// ---------------------------------------------------------------------------------------------------------------------------------
// FUNCTION FOR OPENING APPLICATION IN NEW WINDOW
// sEtoECode - Passed by calling page to allow for tracking of application source
// ---------------------------------------------------------------------------------------------------------------------------------
function openAppWin(sProduct, sEtoECode)	{

	// If application is supposed to be the WorldCard or Business card phone number set appropraite values
	if (sProduct == "bus")	{
		sSiteURL="appconstruct.jsp?Var=" + sEtoECode + "&prod=" + sProduct;
		sWidth="700";
		sHeight="100";
		sTop="150";
		sLeft="50";
		sScrollbars="Yes";
	}
	// For all other applications set appropriate values
	else 	{
		sSiteURL="adastatus.jsp?Var=" + sEtoECode + "&prod=" + sProduct;
		sWidth="600";
		sHeight="300";
		sTop="150";
		sLeft="75";
		sScrollbars="Yes";
	}	
	if (sProduct == "trvl")	{
		sSiteURL="appconstruct.jsp?Var=" + sEtoECode + "&prod=" + sProduct;
		sWidth="650";
		sHeight="450";
		sTop="150";
		sLeft="50";
		sScrollbars="Yes";
	}

	if (newWin && !newWin.closed)	{
		newWin.close();
	}

	newWin = window.open( sSiteURL, "SubWindow", "menubar=Yes,status=Yes,toolbar=No,location=No,resizable=Yes,scrollbars=" + sScrollbars + ",screenx=" + sTop +",screeny=" + sLeft +",width=" + sWidth + ",height=" + sHeight + ",top=" + sTop +",left=" + sLeft);
	newWin.focus();
}
