/* NOTE CHASE-BANK ONE MERGED UI CHANGES
/* See these functions below bolSetFrontZoomIn, bolSetFrontZoomOut, bolSetBackZoomIn, bolSetBackZoomOut
/* changed width and height settings - Kurt Mattes
 */


/* Start GDS Changes
 * Modified by: Sanjeewa
 */
function bolGetCookie(p_CookieName)
{

}

function bolSetCookie(p_Name, p_Value)
{
  document.cookie = p_Name + "=" + escape (p_Value);
}

/* End GDS Changes
 */
function bolPopupURL(aURL){
var newWin=window.open(aURL,"bol","directories=0,height=480,width=578,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes");
var agt=navigator.userAgent.toLowerCase(); 
if(!(agt.indexOf("msie")!=-1 && (parseInt(agt.substr(agt.indexOf("msie")+5,1))==4))){
newWin.focus();
}
}
function bolPopupURL2(aURL){
var newWin=window.open(aURL,"bol","directories=0,height=480,width=578,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
var agt=navigator.userAgent.toLowerCase(); 
if(!(agt.indexOf("msie")!=-1 && (parseInt(agt.substr(agt.indexOf("msie")+5,1))==4))){
newWin.focus();
}
}
function bolPopupURLClose(aURL){
winArray[winArray.length] = window.open(aURL,"bol","directories=0,height=480,width=578,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes");
var agt=navigator.userAgent.toLowerCase(); 
}
function bolCloseChildren()
{
	for(i=0;i<winArray.length;i++)
	{
		// check if window wasn't already closed 
		if (winArray[i] && !winArray[i].closed) 
		{	
		  winArray[i].close();
		}		
	}
	winArray.length = 0;
}
function bolBillPayPopup(aURL){
var newWin=window.open(aURL,"bol","directories=0,height=280,width=463,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
var agt=navigator.userAgent.toLowerCase(); 
if(!(agt.indexOf("msie")!=-1 && (parseInt(agt.substr(agt.indexOf("msie")+5,1))==4))){
newWin.focus();
}
}
function bolAdPopupURL(aURL){
var leftOffset=0;
var topOffset=0;
var popupwidth=800;
var popupheight=400;
if(screen.width){
if(screen.width>popupwidth){
leftOffset=((screen.width-popupwidth)/2);
}  
}
var newWin=window.open(aURL,"bol",'directories=0,left='+leftOffset+',top='+topOffset+',screenx='+leftOffset+',screeny='+topOffset+',height='+popupheight+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes,width='+popupwidth);
var agt=navigator.userAgent.toLowerCase(); 
if(!(agt.indexOf("msie")!=-1&&(parseInt(agt.substr(agt.indexOf("msie")+5,1))==4))){
newWin.focus();
}
}
function bolTONWPopupURL(bolObj,aURL){
if(bolObj.selectedIndex!=0){
var leftOffset=50;
var topOffset=30;
var popupwidth=795;
var popupheight=475;
bolObj.selectedIndex = 0;
if(screen.width){	
if(screen.width>popupwidth){	
leftOffset=((screen.width-popupwidth)/2);
}  
}
var newWin=window.open(aURL,"ICMLayout",'directories=0,left='+leftOffset+',top='+topOffset+',screenx='+leftOffset+',screeny='+topOffset+',height='+popupheight+',width='+popupwidth+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
var agt=navigator.userAgent.toLowerCase(); 
if(!(agt.indexOf("msie")!=-1&&(parseInt(agt.substr(agt.indexOf("msie")+5,1))==4))){	
newWin.focus();	
}
}
}
function bolSelAct(bolObj,bolIdx,bolUseFirstOption){
var bolOffLink=bolObj.options[bolObj.selectedIndex].value;
if(bolUseFirstOption=="true" || (bolUseFirstOption==null && bolObj.selectedIndex!=0)){
if(bolOffLink!="VisaDNDLink" && bolOffLink != "UALMilesPlusLink" && bolOffLink != "SONYREWARDS"){
if(bolIdx=='' || bolOffLink.indexOf("AcctIndex=")==-1){
eval("top.location='"+bolObj.options[bolObj.selectedIndex].value+"'");
}else{
eval("top.location='"+bolObj.options[bolObj.selectedIndex].value+bolIdx+"'");
}
}else{
if (bolOffLink =="UALMilesPlusLink")
{
bolOffSiteLink('UAL Miles Plus','http://mileageplusvisa.ualmiles.com/');	
}
else if (bolOffLink == "SONYREWARDS")
{
bolOffSiteLink('Sony Rewards','http://www.sony.com/sonycard/');	
}
else
{
var bolBrandGoto = "";
if (document.bolForm["bolBrand" + bolIdx] != null)
{
bolBrandGoto = document.bolForm["bolBrand" + bolIdx].value;
}
else
{
var cookieVal = document.cookie;
if ( (cookieVal.indexOf("bolBrand=")) + 0 == -1 )
bolBrandGoto = "";
var temp = cookieVal.substring(cookieVal.indexOf("bolBrand=")+ 9, cookieVal.length);
var offset = temp.indexOf(";");
if (offset + 0 == -1)
{
offset = temp.length;
}
bolBrandGoto = unescape(temp.substring(0, offset));
}
switch(bolBrandGoto)
{
case "BA":
bolOffSiteLink('Visa','http://www.usa.visa.com/personal/shopping/visa_special_offers/First_USA_British_Airways.jsp');
break;
case "AMAZON":
bolOffSiteLink('Visa','https://usa.visa.com/specialOffers/FUSA_Amazon/offers.jsp');
break;
case "AOL":
bolOffSiteLink('Visa','http://usa.visa.com/specialOffers/AOLVisaOffers/offers.jsp');
break;
case "CMSFI":
bolOffSiteLink('Visa','http://usa.visa.com/specialOffers/CMS/offers.jsp');
break;
case "CMS":
bolOffSiteLink('Visa','http://usa.visa.com/specialOffers/CMS/offers.jsp');
break;
case "FROST":
bolOffSiteLink('Visa','http://usa.visa.com/specialOffers/CMS/offers.jsp');
break;
case "YAHOO":
bolOffSiteLink('Visa','http://usa.visa.com/specialOffers/Yahoo/offers.jsp');
break;
case "NETBANK":
bolOffSiteLink('Visa','https://www.usa.visa.com/specialOffers/NetBankVisaOffers/offers.jsp');
break;
default:
bolOffSiteLink('Visa','https://www.usa.visa.com/specialOffers/BankOne/offers.jsp');
break;
}
}
bolObj.selectedIndex=0;
}
}
}
function bolOffSiteLink(gotoName,gotoURL){  
gotoName = escape(gotoName);
gotoURL = escape(gotoURL); 
var OffSitePopUpURL;
var leftOffset=0;
var topOffset=0;    
OffSitePopUpURL="/bolOffSiteLink.aspx"; 
if(screen.width){
if(screen.width < 800){
leftOffset=60;
topOffset=90;
}else{
if(screen.width>=800&&screen.width<1024){
leftOffset=160;
topOffset=134;
}else{
if(screen.width>=1024){
leftOffset=272;
topOffset=250;
}
}
}
}
var loadURL=OffSitePopUpURL+'?gotoName='+gotoName+'&gotoURL='+gotoURL;
var webLinkWin=window.open(loadURL,"view",'width=480,height=295,left='+leftOffset+',top='+topOffset+',screenx='+leftOffset+',screeny='+topOffset+',resizable=no,scrollbars=yes,menubar=no');
webLinkWin.focus();
}
function printPage()
{
  var pr =  (window.print) ? 1 : 0;

  if (pr)	//Browser is Internet Explorer 5 or Netscape 4
    window.print()
  else		//Browser is not Internet Explorer 5 nor is it Netscape 4
    alert("Sorry, your browser doesn't support this feature.");
}


function bolPrint()
{
	var urlinfo;
	urlinfo = "BoaAcctIndexHidden=" + escape(document.bolForm.BoaAcctIndexHidden.value) + "&CheckZoomFront=" + escape(document.bolForm.CheckZoomFront.value) + "&CheckZoomBack=" + escape(document.bolForm.CheckZoomBack.value)  + "&BoaHiddenHash=" + document.bolForm.BoaHiddenHashPrint.value  + "&BoaHiddenCheckNumber=" + escape(document.bolForm.BoaHiddenCheckNumber.value)  + "&BoaHiddenSeqNumber=" + escape(document.bolForm.BoaHiddenSeqNumber.value)  + "&BoaHiddenAmount=" + escape(document.bolForm.BoaHiddenAmount.value)  + "&BoaHiddenDate=" + escape(document.bolForm.BoaHiddenDate.value) + "&entrypoint=print";
	var newWin = window.open("BolAccountCheckIMG.aspx?" + urlinfo,"bol","directories=0,height=400,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes,width=785");
}

function bolSetFrontZoom()
{ 
 if(document.bolForm.CheckZoomFront.value == 1)
 {
    bolSetFrontZoomIn();
    return;
 }
 if (document.bolForm.CheckZoomFront.value == 2)
 {
   bolSetFrontZoomOut();
   return;
 }
}

function bolSetFrontZoomIn()
{
    document.bolForm.BoaFrontImage.style.width='1150'
    document.bolForm.BoaFrontImage.style.height='450'
    document.bolForm.CheckZoomFront.value = 2;
}
 
function bolSetFrontZoomOut()
{
    document.bolForm.BoaFrontImage.style.width='509'
    document.bolForm.BoaFrontImage.style.height='204'
    document.bolForm.CheckZoomFront.value = 1;
}

function bolSetBackZoom()
{
  if(document.bolForm.CheckZoomBack.value == 1)
 {
    bolSetBackZoomIn();
    return;
 }
 if (document.bolForm.CheckZoomBack.value == 2)
 {
   bolSetBackZoomOut();
   return;
 }
}

function bolSetBackZoomIn()
{
    document.bolForm.BoaBackImage.style.width='1150'
    document.bolForm.BoaBackImage.style.height='450'
    document.bolForm.CheckZoomBack.value = 2;
 }
function bolSetBackZoomOut()
{
    document.bolForm.BoaBackImage.style.width='509'    
    document.bolForm.BoaBackImage.style.height='204'
    document.bolForm.CheckZoomBack.value = 1;
}

