//CALL TO CORRECT DIRECTORY BELOW - if you are on homepage you need <script> var homepage = "yes";</script> to make codework properly
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.absolute)
{
imgdir="http://www.metcapbank.com/images/"
sitedir="http://www.metcapbank.com/site/"
securedir="http://www.metcapbank.com/site/"
homedir="http://www.metcapbank.com/"
}
else if(window.secure)
{
imgdir="https://www.metcapbank.com/images/"
sitedir="http://www.metcapbank.com/site/"
securedir="https://www.metcapbank.com/site/"
homedir="http://www.metcapbank.com/"
}
//CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW
function openWin(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?o:(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}

function showCalc(calc){
openWin(calc,"calc",550,480,"resizable=1,scrollbars=1");
}

function open_apps(nameofapp){
openWin("https://www.metcapbank.com/Forms/OnlineForm.cgi?form=" + nameofapp,"application",700,600,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,status=1");
}

function openIB(page){
	if (page=="security") alert("Security: Coming Soon!");
	else if (page=="apply") document.location.href = "https://www.metcapbank.com/onlineserv/HB/STDReg.cgi";
	else if (page=="demo") document.location.href = "https://www.metcapbank.com/onlineserv/HB/demo.html";
	else if (page=="info") document.location.href = sitedir+"faq_internet_banking.html";
	else document.location.href = "https://www.metcapbank.com/onlineserv/HB/";
}

function openCM(page){
	document.location.href = "https://www.metcapbank.com/onlineserv/CM/";
}
function makeFooter(){
	var footer = "";
	footer+=		'<div class="footerTop">'+"\n";
	footer+=		'<img src="'+imgdir+'fdic.gif" width="52" height="25" alt="FDIC" /><img src="'+imgdir+'ehl.gif" width="38" height="27" alt="Equal Housing Lender" />'+"\n";
	footer+=		'</div><!-- Close Footer Top -->'+"\n";
	footer+=		'<div class="footerDivider"><!-- Footer Divider --></div>'+"\n";
	footer+=		'<div class="footerBottom">'+"\n";
	footer+=		'<img src="'+imgdir+'address.gif" width="423" height="23" alt="Metropolitan Capital Bank | Nine East Ontario | Chicago, Illinois 60611-4747 | Member FDIC, Equal Housing Lender, Equal Housing Opportunity Lender" />'+"\n";
	footer+=		'<a href="http://www.metcapbank.com/"><img src="'+imgdir+'nav-home.gif" width="37" height="13" alt="Home" border="0" /></a>'+"\n";
	footer+=		'<a href="'+sitedir+'privacy.html"><img src="'+imgdir+'nav-privacy.gif" width="52" height="13" alt="Privacy" border="0" /></a>'+"\n";
	footer+=		'<a href="'+sitedir+'security.html"><img src="'+imgdir+'nav-security.gif" width="57" height="13" alt="Security" border="0" /></a>'+"\n";
	footer+=		'&nbsp;<a href="'+sitedir+'ELEPPolicy.pdf" target="_blank"><img src="'+imgdir+'nav-elp.gif" alt="Disclosure" border="0" /></a>'+"\n";
	footer+=		'<a href="'+sitedir+'disclosure.html"><img src="'+imgdir+'nav-disclosure.gif" width="67" height="13" alt="Disclosure" border="0" /></a>'+"\n";
	footer+=		'<a href="http://www.digitalinsight.com/" style="float: right;"><!--[if lt IE 7]><script type="text/javascript" src="https://www.metcapbank.com/mstinc/web/js/png.js"></script><![endif]--><img src="https://www.metcapbank.com/mstinc/web/images/di_91x22_1c_k.png" width="91" height="22" border="0" alt="Digital Insight, an Intuit company" /></a>'+"\n";
	footer+=		'</div><!-- Close Footer -->'+"\n";

	document.write(footer);
}

//no longer using this code, but it is funny to look at.
/*function openExtras(page){
	switch(page){
		case "Privacy":
			document.location.href = sitedir+"privacy.html";
			break;
		case "Security":
			document.location.href = sitedir+"security.html";
			break;
		case "Disclosure":
			document.location.href = sitedir+"disclosure.html";
			break;
		case "Contact":
			alert("Metropolitan Capital Bank\nNine East Ontario\nChicago, Illinois 60611-2709\nPhone: (312) 640-2300\nFax: (312) 640-2323\nEmail: Info@metcapbank.com\n");
			document.location.href = sitedir+"about_metcap_bios.html";
			break;
		default:
			alert(page+": Coming Soon!"); // document.location.href = "#";
	}
}*/
//no longer using this code, but it is funny to look at.

var XHTMLNS = "http://www.w3.org/1999/xhtml";
var CURRENT_CAP;
function showCapPlan(bOpen){
    if (!document.getElementsByTagName) return;
	// create the DIV via the DOM
	if(bOpen){
		showCapPlan(false);
		var cap = document.createElementNS(XHTMLNS,"div");
		var capWidth = 632;
		var capContent = '<div style="border:1px solid #685539; padding:2px"><a href="javascript:showCapPlan(false);" onmouseout="window.setTimeout(\'showCapPlan(false)\',1000)"><img src="'+imgdir+'plan-large.gif" width="626" height="630" alt="" border="0"></a></div>';
	    
		// add styles
//		cap.className = "capacumplan";
		cap.style.width = capWidth + 'px';
		cap.style.top = '10px';
		cap.style.position = 'absolute';
		cap.style.border = '2px solid #685539';
		cap.style.padding = '2px';
		cap.style.background = '#fff';
		
		if (document.body && document.body.offsetWidth){
		   	cap.style.left = ((document.body.offsetWidth - capWidth)/2) + 'px';
		}
		cap.innerHTML = capContent;
	    document.getElementsByTagName("body")[0].appendChild(cap);
		CURRENT_CAP = cap;
		window.scrollTo(0,0);
	}
	else if(CURRENT_CAP){
		document.getElementsByTagName("body")[0].removeChild(CURRENT_CAP);
		CURRENT_CAP = null;
	}
}
// OTHER FUNCTIONS ABOVE
