function Includes(section){
	this.section = section;
	this.makeHeader = makeHeader;
	this.makeLeftRail = makeLeftRail;
	this.headerImg = headerImg;
	this.makeFooter = makeFooter;
}

function makeHeader(){
	var index = 0;
	var header=new Array();
	header[index++]='<table width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">';
	header[index++]='<tr><td bgcolor=\"#FFFFFF\"><img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"1\"></td></tr>';
	header[index++]='<tr><td valign=\"top\" bgcolor=\"#00234C\">';
	header[index++]='<a href=\"javascript:void(0);\" onMouseOver=\"img_act(\'aboutus\'); window.status=\'About Us\'; popUp(\'HM_Menu1\',event); return true\" onMouseOut=\"img_inact(\'aboutus\'); popDown(\'HM_Menu1\',event);\"><img src=\"'+imgdir+'nav-aboutus-off.gif\" width=\"113\" height=\"36\" alt=\"About Us\" border=\"0\" name=\"aboutus\"></a>';
	header[index++]='<a href=\"javascript:void(0);\" onMouseOver=\"img_act(\'loan\'); window.status=\'Loan Services\'; popUp(\'HM_Menu2\',event); return true\" onMouseOut=\"img_inact(\'loan\'); popDown(\'HM_Menu2\',event);\"><img src=\"'+imgdir+'nav-loan-off.gif\" width=\"139\" height=\"36\" alt=\"Loan Services\" border=\"0\" name=\"loan\"></a>';
	header[index++]='<a href=\"javascript:void(0);\" onMouseOver=\"img_act(\'convenience\'); window.status=\'Convenience Services\'; popUp(\'HM_Menu3\',event); return true\" onMouseOut=\"img_inact(\'convenience\'); popDown(\'HM_Menu3\',event);\"><img src=\"'+imgdir+'nav-convenience-off.gif\" width=\"183\" height=\"36\" alt=\"Convenience Services\" border=\"0\" name=\"convenience\"></a>';
	header[index++]='<a href=\"javascript:void(0);\" onMouseOver=\"img_act(\'deposit\'); window.status=\'Deposit Services\'; popUp(\'HM_Menu4\',event); return true\" onMouseOut=\"img_inact(\'deposit\'); popDown(\'HM_Menu4\',event);\"><img src=\"'+imgdir+'nav-deposit-off.gif\" width=\"155\" height=\"36\" alt=\"Deposit Services\" border=\"0\" name=\"deposit\"></a>';
	header[index++]='<a href=\"javascript:void(0);\" onMouseOver=\"img_act(\'business\'); window.status=\'Business Services\'; popUp(\'HM_Menu5\',event); return true\" onMouseOut=\"img_inact(\'business\'); popDown(\'HM_Menu5\',event);\"><img src=\"'+imgdir+'nav-business-off.gif\" width=\"166\" height=\"36\" alt=\"Business Services\" border=\"0\" name=\"business\"></a>';
	header[index++]='</td></tr>';
	header[index++]='<tr><td bgcolor=\"#FFFFFF\"><img src=\"'+imgdir+'"clearpix.gif\" width=\"1\" height=\"1\"></td></tr>';
	if (this.section!='home'){
		header[index++]='<tr><td bgcolor=\"#007C6F\"><img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"5\"></td></tr>';
	}
	header[index++]='</table>';

	document.open("text/html","replace");
	document.writeln(header.join(""));
	document.close();
}

function makeLeftRail(){
	var index = 0;
	var leftrail=new Array();
	
	if (this.section!='home'){
		leftrail[index++]='<img src=\"'+imgdir+'logo-eastwis.gif\" width=\"209\" height=\"87\" alt=\"East Wisconsin Savings Bank\" border=\"0\">';
		leftrail[index++]='<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\"'+imgdir+'clearpix.gif\" width=\"27\" height=\"1\"></td><td valign=\"top\" class=\"subnav\">';
			if (this.section=='aboutus'){
				leftrail[index++]='<a href=\"aboutus_history.html\">Our History</a><br><br>';
				leftrail[index++]='<a href=\"aboutus_office.html\">Office Information</a><br><br>';
				leftrail[index++]='<a href=\"https://www.eastwis.com/Forms/OnlineForm.cgi?form=contact\">Contact Information</a><br><br>';
				leftrail[index++]='<a href=\"aboutus_links.html\">Community Links</a><br><br>';
				leftrail[index++]='<a href=\"calculators.html\">Calculators</a><br><br>';
			} else if (this.section=='loan'){
				leftrail[index++]='<a href=\"loan_home.html\">Home Loans</a><br><br>';
				leftrail[index++]='<a href=\"loan_equity.html\">Home Equity Loans</a><br><br>';
				leftrail[index++]='<a href=\"loan_consumer.html\">Consumer Loans</a><br><br>';
				leftrail[index++]='<a href=\"calculators.html\">Calculators</a><br><br>';
			} else if (this.section=='convenience'){
				leftrail[index++]='<a href=\"convenience.html\">Convenience Banking</a><br><br>';
				/* leftrail[index++]='<a href=\"#cc\">VISA CheckCard</a><br><br>';
				leftrail[index++]='<a href=\"#bp\">Bank-by-Phone</a><br><br>';
				leftrail[index++]='<a href=\"#dd\">Payroll Direct Deposit</a><br><br>';
				leftrail[index++]='<a href=\"#lp\">Automatic Loan Payments</a><br><br>';
				leftrail[index++]='<a href=\"#op\">Overdraft Protection</a><br><br>';
				leftrail[index++]='<a href=\"#vi\">VISA Credit Card</a><br><br>'; */
				leftrail[index++]='<a href=\"calculators.html\">Calculators</a><br><br>';
			} else if (this.section=='deposit'){
				leftrail[index++]='<a href=\"deposit_checking.html\">Checking Accounts</a><br><br>';
				leftrail[index++]='<a href=\"deposit_savings.html\">Savings Accounts</a><br><br>';
				leftrail[index++]='<a href=\"deposit_cd.html\">Certificates of Deposit</a><br><br>';
				leftrail[index++]='<a href=\"deposit_mm.html\">Money Market Accounts</a><br><br>';
				leftrail[index++]='<a href=\"deposit_ira.html\">Individual Retirement Accounts</a><br><br>';
				leftrail[index++]='<a href=\"deposit_hsa.html\">Health Savings Account (HSA)</a><br><br>';
				leftrail[index++]='<a href=\"calculators.html\">Calculators</a><br><br>';
			} else if (this.section=='business'){
				leftrail[index++]='<a href=\"#re\">Commercial Real Estate Loans</a><br><br>';
				leftrail[index++]='<a href=\"#bl\">Business Loans</a><br><br>';
				leftrail[index++]='<a href=\"#bc\">Business Checking Accounts</a><br><br>';
				leftrail[index++]='<a href=\"#mm\">Business Money Market Accounts</a><br><br>';
				leftrail[index++]='<a href=\"calculators.html\">Calculators</a><br><br>';
			} else {
				leftrail[index++]='<br><br><br><br><br><br>';
			}
		leftrail[index++]='</td></tr></table>';
		var url = new String(document.URL);
		leftrail[index++]='<table width=\"209\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';
		leftrail[index++]='<tr><td align=\"center\"><img src=\"'+imgdir+'onlinebanking.gif\" width=\"165\" height=\"29\" alt=\"Online Banking\" border=\"0\"><br>';
		leftrail[index++]='<a href=\"javascript:openIB();\" onMouseOver=\"img_act(\'login\'); window.status=\'Login to Online Banking\'; return true\" onMouseOut=\"img_inact(\'login\');\"><img src=\"'+imgdir+'nav-login-off.gif\" width=\"83\" height=\"22\" alt=\"LOGIN\" border=\"0\" name=\"login\"></a>';
		leftrail[index++]='<a href=\"javascript:openIB(\'demo\')\" onMouseOver=\"img_act(\'demo\'); window.status=\'Demo\'; return true\" onMouseOut=\"img_inact(\'demo\');\"><img src=\"'+imgdir+'nav-demo-off.gif\" width=\"74\" height=\"22\" alt=\"demo\" border=\"0\" name=\"demo\"></a>';

		if (-1 != url.indexOf("HB"))
			leftrail[index++]='<!--<br /><br /> TurboTax Banner was here -->';

		leftrail[index++]='<br><br></td></tr><tr><td align=\"center\"><a href="http://www.elancard.com/cgi_w/cfm/elancard/index.cfm?loc=0662&theme=elan1" target="_blank"><img src=\"'+imgdir+'cc-link.gif\" width=\"55\" height=\"35\" border=\"0\"></a><br><br></td></tr>';
		leftrail[index++]='</table>';
        
			if (-1 != url.indexOf("HB"))
			leftrail[index++]='<div align="center"><a href=\"https://usa.visa.com/personal/security/vbv/index.html" target=\"_blank\" title="Verified by Visa\"><img src=\"https://www.eastwis.com/images/verifiedbyvisa.jpg\" width=\"142\" height=\"72\" border=\"0\" /></a></div><br />';
			
			if (!url.indexOf("HB") && url.indexOf("aboutus_history.html") < 0 && url.indexOf("aboutus_office.html") < 0 && url.indexOf("aboutus_links.html") < 0 && url.indexOf("calculators.html") < 0 && url.indexOf("loan_home.html") < 0 && url.indexOf("loan_equity.html") < 0 && url.indexOf("loan_consumer.html") < 0 && url.indexOf("convenience.html") < 0 && url.indexOf("deposit_checking.html") < 0 && url.indexOf("deposit_savings.html") < 0 && url.indexOf("deposit_cd.html") < 0 && url.indexOf("deposit_mm.html") < 0 && url.indexOf("deposit_ira.html") < 0 && url.indexOf("deposit_hsa.html") < 0 && url.indexOf("business.html") < 0 )
			{
			leftrail[index++]='<div align="center"><a href=\"http://www.deluxe-idtheftblock.com/" target=\"_blank\" title="Deluxe ID TheftBlock\"><img src=\"https://www.eastwis.com/images/DeluxeIDTheftBlock.jpg\" width=\"120\" height=\"82\" border=\"0\" /></a></div><br />';
			leftrail[index++]='<div align="center"><a href=\"http://www.mydeluxecard.com/" target=\"_blank\" title="My Deluxe Card\"><img src=\"https://www.eastwis.com/images/mydeluxecard.jpg\" width=\"199\" height=\"60\" border=\"0\" /></a></div><br />';
			}
		
		if (-1 != url.indexOf("HB")){
			//leftrail[index++]='<div align="center"><a href=\"http://www.deluxe.com\" target=\"_blank\" title="Deluxe\"><img src=\"https://www.eastwis.com/images/deluxe_sm.gif\" width=\"100\" height=\"32\" border=\"0\" /></a></div><br />';
		}

		leftrail[index++]='<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">';
		leftrail[index++]='<tr><td align=\"center\"><a href=\"'+homedir+'"index.html\" onMouseOver=\"img_act(\'home\'); window.status=\'Home\'; return true;\" onMouseOut=\"img_inact(\'home\');\"><img src=\"'+imgdir+'nav-home-off.gif\" width=\"76\" height=\"24\" alt=\"Home\" border=\"0\" name=\"home\"></a><br><br></td></tr>';
		leftrail[index++]='</table>';
	} 
	document.open("text/html","replace");
	document.writeln(leftrail.join(""));
	document.close();
}

function headerImg(){
	var index = 0;
	var himg=new Array();
	if (this.section!=''){
		himg[index++] = '<img src=\"'+imgdir+'hed-'+this.section+'.gif\" width=\"551\" height=\"42\" alt=\"\" border=\"0\"><br>';
	} else {
		himg[index++] = '<img src=\"'+imgdir+'clearpix.gif\" width=\"551\" height=\"20\" alt=\"\" border=\"0\"><br>';
	}
	himg[index++] = '<img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"10\"><br>';
	document.open("text/html","replace");
	document.writeln(himg.join(""));
	document.close();
}

function makeFooter(){
	var index = 0;
	var footer=new Array();
	
	footer[index++]='<table width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#00234C\">';
	if (this.section=='home'){
		footer[index++]='<tr><td bgcolor=\"#ffffff\"><img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"1\"></td></tr>';
	}
	footer[index++]='<tr><td><img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"20\"></td></tr>';
	footer[index++]='<tr><td>';
	footer[index++]='<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>';
	footer[index++]='<td><img src=\"'+imgdir+'clearpix.gif\" width=\"133\" height=\"1\"></td><td><a href=\"'+sitedir+'privacy.html\" onMouseOver=\"img_act(\'privacy\'); window.status=\'Privacy Statement\'; return true\" onMouseOut=\"img_inact(\'privacy\');\"><img src=\"'+imgdir+'nav-privacy-off.gif\" width=\"137\" height=\"18\" alt=\"Privacy Statement\" border=\"0\" name=\"privacy\"></a><br><a href=\"https://www.eastwis.com/onlineserv/HB/security_site/privacy.html\" onMouseOver=\"img_act(\'security\'); window.status=\'Security Statement\'; return true\" onMouseOut=\"img_inact(\'security\');\" target=\"_blank\"><img src=\"'+imgdir+'nav-security-off.gif\" width=\"137\" height=\"18\" alt=\"Security Statement\" border=\"0\" name=\"security\"></a></td>';
	footer[index++]='<td><img src=\"'+imgdir+'clearpix.gif\" width=\"32\" height=\"1\"><img src=\"'+imgdir+'equalhl.gif\" width=\"42\" height=\"36\" alt=\"Equal Housing Lender\" border=\"0\"><img src=\"'+imgdir+'clearpix.gif\" width=\"40\" height=\"1\"> <b><font color="#ffffff">Member FDIC</font></b>   <img src=\"'+imgdir+'clearpix.gif\" width=\"40\" height=\"1\"></td>';
	footer[index++]='</tr></table>';
	footer[index++]='</td></tr>';
	footer[index++]='<tr><td><img src=\"'+imgdir+'clearpix.gif\" width=\"1\" height=\"24\"></td></tr>';
	footer[index++]='</table>';
	
	document.open("text/html","replace");
	document.writeln(footer.join(""));
	document.close();
}

function openIB(demo){
	if(!demo){
		location.href="https://www.eastwis.com/onlineserv/HB/Signon.cgi";
	}else{
		location.href="https://www.eastwis.com/onlineserv/HB/demo.html";
	}
}
