var winArray=new Array();
                                                                                                                             
function MM_swapImgRestore() {
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
                                                                                                                             
function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null) {
		document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}
                                                                                                                             
function windowOpen(img) {
	foto1= new Image();
	foto1.src=(img);
	Control(img);
}
                                                                                                                             
function Control(img) {
	if((foto1.width!=0)&&(foto1.height!=0)) {
        	viewFoto(img);
	}
	else {
		fun="Control('"+img+"')";
		intervallo=setTimeout(fun,20);
	  }
}
                                                                                                                             
function viewFoto(img) {
	larg=foto1.width+20;
	alt=foto1.height+20;
	string="width="+larg+",height="+alt;
	winModalWindow=window.open(img,"",string);
	winArray[winArray.length]=winModalWindow;
}
                                                                                                                             
function FN_ShowTDIntChart() {
	if (document.form1.cboInterestRates.options[document.form1.cboInterestRates.selectedIndex].value=="-1") {
                alert("Select a Scheme");
                return false;
        }
        else
        {
                window.status="Loading...";
                window.top.onfocus=HandleFocus;
                winModalWindow=window.open("InterestChartTD.jsp","InterestChart","dependent=yes,resizable=no,status=no,toolbar=no,scrollbars=yes,location=no,menubar=no,width=700,height=500,top=30,left=80");
                winArray[winArray.length]=winModalWindow;
                winModalWindow.focus();
                window.status="";
        }
}
                                                                                                                             
function HandleFocus() {
        if (winModalWindow) {
                if (!winModalWindow.closed) {
                        winModalWindow.focus();
                }
        }
        return false;
}
                                                                                                                             
function FN_ShowDepositCalc() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("DepositCalculator.jsp","ModalChild","dependent=yes,resizable=no,status=no,toolbar=no,scrollbars=no,location=no,menubar=no,width=580,height=400,top=100,left=100");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function FN_ShowEMICalc() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("LoanEligibility.jsp","ModalChild","dependent=yes,resizable=no,status=no,toolbar=no,scrollbars=no,location=no,menubar=no,width=600,height=220,top=100,left=100");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function MM_preloadImages() {
	var d=document; 
	if(d.images) {
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) {
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	}
}
                                                                                                                             
function FN_ShowSearch() {
	if (document.form1.cboBranchType.options[document.form1.cboBranchType.selectedIndex].value=="-1") {
                alert("Select a BranchType");
                return false;
        }
//      if (document.form1.cboState.options[document.form1.cboState.selectedIndex].value=="-1")
//      {
//              alert("Select a State");
//              return false;
//      }
//      if (document.form1.cboCity.options[document.form1.cboCity.selectedIndex].value=="-1")
//      {
//              alert("Select a City");
//              return false;
//      }
        else
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("SearchResults.jsp?BRID=" + document.form1.cboBranchType.options[document.form1.cboBranchType.selectedIndex].value + "&BRName=" + document.form1.cboBranchType.options[document.form1.cboBranchType.selectedIndex].text + "&State=" + document.form1.cboState.options[document.form1.cboState.selectedIndex].text + "&City=" + document.form1.cboCity.options[document.form1.cboCity.selectedIndex].text,"n","scrollbars=yes,width=530px,height=430px,top=10px;left=50px");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
		if(!(x=d[n])&&d.all) x=d.all[n]; 
		for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); 
		return x;
}
                                                                                                                             
function FN_ShowAllBranches() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("SearchResults.jsp?BRID=1&BRName=RETAIL BRANCHES&State=" + document.form1.cboState.options[document.form1.cboState.selectedIndex].text + "&City=" + document.form1.cboCity.options[document.form1.cboCity.selectedIndex].text,"n","scrollbars=yes,width=530px,height=480px,top=10px;left=50px");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function FN_CloseChildWindows() {
        for(i=0;i<winArray.length;i++) {
                winArray[i].close();
        }
        winArray.length = 0;
}
                                                                                                                             
function FN_ShowDPFeatures() {
        winModalwindow=window.open('DPFeatures.jsp','v','height=400px,left=100px,top=100px,width=580px,scrollbars=yes');
        winArray[winArray.length]=winModalWindow;
}
                                                                                                                             
function FN_ShowDPIntChart() {
        winModalWindow=window.open('InterestChartTD.jsp','k','width=570px,left=100px,top=50px,height=400px,scrollbars=yes');
        winArray[winArray.length]=winModalWindow;
}

function SMSHelp() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("SMSHelp.htm","ModalChild","dependent=yes,resizable=no,status=no,toolbar=no,location=no,menubar=no,width=580,height=400,top=100,left=100");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}

function FN_ShowDis() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open('Disclaimer.jsp','n','width=500px,height=400x,left=50px,top=50px')
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function FN_ShowMCC() {
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open('ModelCitizenChart.jsp','n','width=520px,height=400x,left=50px,top=50px,scrollbars=yes');
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}

function FN_ShowNetworkedBranches() {
                                                                                                                             
        window.status="Loading...";
        window.top.onfocus=HandleFocus;
        winModalWindow=window.open("SearchResults.jsp?BRID=2&BRName=Networked Branches&State=" + document.form1.cboState.options[document.form1.cboState.selectedIndex].text + "&City=" + document.form1.cboCity.options[document.form1.cboCity.selectedIndex].text,"n","scrollbars=yes,width=500px,height=430px,top=10px;left=50px");
        winArray[winArray.length]=winModalWindow;
        winModalWindow.focus();
        window.status="";
}
                                                                                                                             
function FN_CloseChildWindows() {
        for(i=0;i<winArray.length;i++) {
                winArray[i].close();
        }
        winArray.length = 0;
}

function FN_ShowMBBAccount() {
        winModalWindow=window.open('MBBaccount.jsp','n','width=530px,height=220px,left=200px,top=200px');
        winArray[winArray.length]=winModalWindow;
}
                                                                                                                             
function FN_ShowMBBFeatures() {
        winModalWindow=window.open('MBBFeatures.jsp','n','width=520px,height=275px,left=200px,top=170px');
        winArray[winArray.length]=winModalWindow;
}
                                                                                                                             
function FN_ShowDPIntChart() {
        winModalWindow=window.open('InterestChartTD.jsp','n','left=100px,top=100px,width=600px,height=400px,scrollbars=yes');        winArray[winArray.length]=winModalWindow;
}

function openErr(file) {
          window.document.form1.fileName.value=file;
          toOpen(file);
}

winName="downloadWin";
var windowParams="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=20,height=20,left=0,top=0";

function toOpen(file) {
          window.document.form1.action="DownLoadAction.jsp";
          window.document.form1.target=winName;
          window.document.form1.submit();
          window.document.form1.target="";
          window.setTimeout('toCloseWin()', 50000);
}
                                                                                                                             
function toCloseWin() {
          win1.close();
}

function FN_ShowCorpBank() {
        winModalWindow=window.open('CorpATM.htm');
        winArray[winArray.length]=winModalWindow;
}


