var backtotop = 0;


function Include(section,subSection){
	this.section = section;
	this.subSection = subSection;
	this.makeHeader = makeHeader;
	this.makeHeaderImg = makeHeaderImg;
	this.makeSubNav = makeSubNav;
	this.makeFooter = makeFooter;
}

function makeHeader(){
	var header = new Array();
	var index = 0;
	header[index++] = '<a name="top"></a>';
	header[index++] = '<table width="760" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td width="425" valign="top">';
	header[index++] = '<table width="425" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td width="425" height="21" background="' + imgdir + 'stripes_top.gif"><img src="' + imgdir + 'clearpix.gif" width="425" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td bgcolor="#F3EFD7"><img src="' + imgdir + 'clearpix.gif" width="8" height="1" alt="" border="0"><img src="' + imgdir + 'logo_bankofoldmonroe.gif" width="280" height="136" alt="Bank of Old Monroe" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><img src="' + imgdir + 'welcome.gif" width="425" height="55" alt="Welcome to Your Online Branch" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '</td>';
	header[index++] = '<td width="335" valign="top" bgcolor="#E8E0B2">';
	
	/*
		NOTE: THE HOMEPAGE IS NOW HARD CODED SO THIS CODE IS NO LONGER USED FOR THAT PAGE
	
	*/
	
	header[index++] = '<table width="335" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td width="99" height="135" valign="top"><img src="' + imgdir + 'ibcenter_image.jpg" width="99" height="135" alt="" border="0"></td>';
	header[index++] = '<td width="236" valign="top">';
	header[index++] = '<table width="236" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td width="236" colspan="2"><img src="' + imgdir + 'internet_banking_center.gif" width="236" height="69" alt="Internet Banking Center" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td width="235"><img src="' + imgdir + 'clearpix.gif" width="1" height="10" alt="" border="0"></td>';
	header[index++] = '<td width="1" bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="1" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	// IB LOGIN
	header[index++] = '<td><img src="' + imgdir + 'clearpix.gif" width="26" height="1" alt="" border="0"><a href="javascript:openIB();" onMouseOver="img_act(\'ibclogin\'); window.status=\'Login in to my account\'; return true" onMouseOut="img_inact(\'ibclogin\');"><img src="' + imgdir + 'nav-ibclogin-off.gif" width="180" height="20" alt="Login in to my account" border="0" name="ibclogin"></a></td>';
	// IB LOGIN
	header[index++] = '<td width="1" bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="1" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><img src="' + imgdir + 'clearpix.gif" width="1" height="8" alt="" border="0"></td>';
	header[index++] = '<td width="1" bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="1" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	// IB DEMO
	header[index++] = '<td align="right"><a href="javascript:openIB(\'demo\');" onMouseOver="img_act(\'ibcdemo\'); window.status=\'Internet Banking Demo\'; return true" onMouseOut="img_inact(\'ibcdemo\');"><img src="' + imgdir + 'nav-ibcdemo-off.gif" width="146" height="15" alt="Internet Banking Demo" border="0" name="ibcdemo"></a>&nbsp;&nbsp;</td>';
	// IB DEMO
	header[index++] = '<td width="1" bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="1" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><img src="' + imgdir + 'clearpix.gif" width="1" height="10" alt="" border="0"></td>';
	header[index++] = '<td width="1" bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="1" height="1" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '</td>';
	header[index++] = '</tr>	';
	header[index++] = '<tr>';
	header[index++] = '<td width="335" colspan="2" valign="top" background="' + imgdir + 'stripes_IB.gif"><img src="' + imgdir + 'clearpix.gif" width="335" height="22" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	// PRIVACY AND SECURITY LINKS
	header[index++] = '<td width="335" colspan="2" bgcolor="#F3EFD7"><img src="' + imgdir + 'clearpix.gif" width="5" height="1" alt="" border="0"><a href="' + sitedir + 'privacy.html" onMouseOver="img_act(\'privacy\'); window.status=\'Privacy\'; return true" onMouseOut="img_inact(\'privacy\');"><img src="' + imgdir + 'nav-privacy-off.gif" width="48" height="33" alt="Privacy" border="0" name="privacy"></a><img src="' + imgdir + 'divider.gif" width="23" height="33" alt="" border="0"><a href="' + sitedir + 'faq-securitytips.html" onMouseOver="img_act(\'security\'); window.status=\'Security\'; return true" onMouseOut="img_inact(\'security\');"><img src="' + imgdir + 'nav-security-off.gif" width="54" height="33" alt="Security" border="0" name="security"></a></td>';
	// PRIVACY AND SECURITY LINKS
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td width="335" colspan="2" background="' + imgdir + 'stripes_welcome.gif"><img src="' + imgdir + 'clearpix.gif" width="335" height="22" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	
	
	
	
	header[index++] = '</td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '<table width="760" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td colspan="6"><img src="' + imgdir + 'clearpix.gif" width="760" height="20" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td width="224" valign="top">';
	header[index++] = '<table width="224" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	// MAIN NAV
	header[index++] = '<td><a href="' + sitedir + 'personal_accounts_services.html" onMouseOver="img_act(\'pers\'); window.status=\'Personal Accounts &amp; Services\'; return true" onMouseOut="img_inact(\'pers\');"><img src="' + imgdir + 'nav-pers-off.gif" width="224" height="44" alt="Personal Accounts &amp; Services" border="0" name="pers"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'business_accounts_services.html" onMouseOver="img_act(\'biz\'); window.status=\'Business Accounts &amp; Services\'; return true" onMouseOut="img_inact(\'biz\');"><img src="' + imgdir + 'nav-biz-off.gif" width="224" height="44" alt="Business Accounts &amp; Services" border="0" name="biz"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="http://www.oldmonroeinvestmentservices.com/" onclick="javascript:showWarning(this.href); return false;" onmouseover="img_act(\'oldmonroeis\'); window.status=\'Old Monroe Investment Services\'; return true" onmouseout="img_inact(\'oldmonroeis\');"><img src="' + imgdir + 'nav-oldmonroeis-off.gif" alt="Old Monroe Investment Services" name="oldmonroeis" border="0" height="44" width="224"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'rates.html" onMouseOver="img_act(\'rates\'); window.status=\'Rates\'; return true" onMouseOut="img_inact(\'rates\');"><img src="' + imgdir + 'nav-rates-off.gif" width="224" height="32" alt="Rates" border="0" name="rates"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'calculators.html" onMouseOver="img_act(\'calcs\'); window.status=\'Calculators\'; return true" onMouseOut="img_inact(\'calcs\');"><img src="' + imgdir + 'nav-calcs-off.gif" width="224" height="32" alt="Calculators" border="0" name="calcs"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'aboutus.html" onMouseOver="img_act(\'aboutus\'); window.status=\'About Us\'; return true" onMouseOut="img_inact(\'aboutus\');"><img src="' + imgdir + 'nav-aboutus-off.gif" width="224" height="32" alt="About Us" border="0" name="aboutus"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'contactus.html" onMouseOver="img_act(\'contactus\'); window.status=\'Contact Us\'; return true" onMouseOut="img_inact(\'contactus\');"><img src="' + imgdir + 'nav-contactus-off.gif" width="224" height="32" alt="Contact Us" border="0" name="contactus"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'news.html" onMouseOver="img_act(\'news\'); window.status=\'Bank News\'; return true" onMouseOut="img_inact(\'news\');"><img src="' + imgdir + 'nav-news-off.gif" width="224" height="32" alt="Bank News" border="0" name="news"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + sitedir + 'help.html" onMouseOver="img_act(\'help\'); window.status=\'Help\'; return true" onMouseOut="img_inact(\'help\');"><img src="' + imgdir + 'nav-help-off.gif" width="224" height="32" alt="Help" border="0" name="help"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><a href="' + homedir + '" onMouseOver="img_act(\'home\'); window.status=\'Home\'; return true" onMouseOut="img_inact(\'home\');"><img src="' + imgdir + 'nav-home-off.gif" width="224" height="32" alt="Home" border="0" name="home"></a><br /><br /> <img src="' + imgdir + 'banner_lost.gif"  style="margin-left:30px;" alt="" border="0"></td>';
	// MAIN NAV
	header[index++] = '</tr>';
	header[index++] = '<tr>';
	header[index++] = '<td><img src="' + imgdir + 'clearpix.gif" width="1" height="25" alt="" border="0"></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '</td>';
	header[index++] = '<td width="15"><img src="' + imgdir + 'clearpix.gif" width="20" height="1" alt="" border="0"></td>';
	header[index++] = '<td width="500" valign="top">';
	header[index++] = '<table width="490" border="0" cellspacing="0" cellpadding="0">';
	if (this.section!="home"){
		header[index++] = '<tr>';
		// SECTION HEADER
		header[index++] = '<td>' + this.makeHeaderImg(); + '</td>';
		// SECTION HEADER
		header[index++] = '</tr>';
		header[index++] = '<tr>';
		// SUBNAV IF APPLICABLE
		header[index++] = '<td class="subnav">' + this.makeSubNav(); + '</td>';
		// SUBNAV IF APPLICABLE
		header[index++] = '</tr>';
	}
	header[index++] = '<tr>';
	header[index++] = '<td class="ficontent"><br>';
	if (this.subSection!='' && this.subSection!="events" && this.subSection!="onlinebanking"){
		header[index++] = '<img src="' + imgdir + 'image_' + this.subSection + '.jpg" width="175" height="127" alt="" border="0" hspace="0" vspace="0" align="right">';
	}
	document.open("text/html","replace");
	document.writeln(header.join(""));
	document.close();
	return;
}

function makeFooter(){
	var footer = new Array();
	var index = 0;
	footer[index++] = '<br><br>';
	footer[index++] = '</td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '</td>';
	footer[index++] = '<td width="15"><img src="' + imgdir + 'clearpix.gif" width="20" height="1" alt="" border="0"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '<table width="760" border="0" cellspacing="0" cellpadding="0">';
	footer[index++] = '<tr>';
	footer[index++] = '<td width="225">&nbsp;</td><td width="535" align="center">';
	footer[index++] = '<div align="center" style="color:#AA2B4A; font-weight:700; font-size:15pt; font-family: Arial,Helvetica,sans-serif"" nowrap><em>"You\'re right at home when you bank with us"</em></div>';
	if (backtotop==1){
		footer[index++] = '<br><div align="center"><a href="#top"><img src="' + imgdir + 'backtotop.gif" width="125" height="19" alt="Back to Top" border="0"></a></div>';
	}
	footer[index++] = '</td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '<table width="760" border="0" cellspacing="0" cellpadding="0">';
	footer[index++] = '<tr>';
	footer[index++] = '<td><img src="' + imgdir + 'clearpix.gif" width="760" height="25" alt="" border="0"></td></tr>';
	footer[index++] = '<tr>';
	footer[index++] = '<td background="' + imgdir + 'stripes_footer.gif"><img src="' + imgdir + 'clearpix.gif" width="760" height="24" alt="" border="0"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '<tr>';
	footer[index++] = '<td bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="760" height="10" alt="" border="0"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '<tr>';
	// FOOTER LOGOS AND LINKS
	footer[index++] = '<td bgcolor="#AA2B4A">&nbsp;<a href="javascript:showWarning(\'http://www.hud.gov/\');"><img src="' + imgdir + 'logo_ehl.gif" width="43" height="38" alt="Equal Housing Lender" border="0"></a>&nbsp;&nbsp;<a href="http://ifs.intuit.com\" onclick="return displayThirdPartyAlert(1,this);" target="_blank"><img src="https://www.bankofoldmonroe.com/mstinc/web/images/logo_91x22.png" width="91" height="22" border="0" alt="" /></a>&nbsp;&nbsp;<a href="javascript:showWarning(\'http://www.fdic.gov/\');"><img src="' + imgdir + 'logo_fdic.gif" width="63" height="38" alt="FDIC" border="0"></a><img src="' + imgdir + 'clearpix.gif" width="35" height="1" alt="" border="0"><img src="' + imgdir + 'address.gif" width="486" height="38" alt="Main &amp; Locust   I   P.O. Box 188   I   Old Monroe, MO 63369   I   (636) 665-5601" border="0"></td>';
	// FOOTER LOGOS AND LINKS
	footer[index++] = '</tr>';
	footer[index++] = '<tr>';
	footer[index++] = '<td bgcolor="#AA2B4A"><img src="' + imgdir + 'clearpix.gif" width="760" height="20" alt="" border="0"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	document.open("text/html","replace");
	document.writeln(footer.join(""));
	document.close();
	return;
}

function makeHeaderImg(){
	var img = '<img src="' + imgdir + 'hed-' + this.section + '.gif" width="500" height="32" alt="" border="0">';
	return img;
}

function makeSubNav(){
	if (this.section=="internetbanking"){
		var subnav = '<a href="demo.html">Online Banking &amp; Bill Payment Demo</a>  l  ';
		subnav += '<a href="javascript:testForDemo(\'dimlDisplayer.cgi?DIML_FILE=passwordReset.diml\');">Forgot Your Password?</a>  l  ';
		subnav += '<a href="ForgottenPW.html">Reset Your Password?</a>  l  ';
		subnav += '<a href="login_help.html">Help</a>  l  ';
		subnav += '<a href="aol.html">Important Info for AOL Users</a>  l  ';
		subnav += '<a href="security_site/index.html">Security</a>  l  ';
		subnav += '<a href="' + sitedir + 'privacy.html">Privacy</a>  l  ';
		subnav += '<a href="eft.html" target="_blank">EFT Disclosure</a>  l  ';
		subnav += '<a href="https://www.bankofoldmonroe.com/bridge/disclosures/ib/disclose.html" target="_blank">Internet Banking Disclosure</a>';
	} else if (this.section=="products" && this.subSection!=""){
		var subnav = '<a href="' + sitedir + 'products_checking.html">Checking Accounts</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_intchecking.html">Interest Bearing Checking</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_savings.html">Savings Accounts</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_cards.html">Credit/Debit Cards</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_loans.html">Loans</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_dialabank.html">Dial-A-Bank</a>  l  ';
		subnav += '<a href="' + sitedir + 'products_travel.html">Travel Club</a>';
	} else if (this.section=="bizproducts" && this.subSection!=""){
		var subnav = '<a href="' + sitedir + 'business_checking.html">Checking Accounts</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_intchecking.html">Interest Bearing Checking</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_savings.html">Savings Accounts</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_cards.html">Credit/Debit Cards</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_loans.html">Loans</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_dialabank.html">Dial-A-Bank</a>  l  ';
		subnav += '<a href="' + sitedir + 'business_onlinebanking.html">Online Business Banking</a>';
	} else if (this.section=="calculators"){
		var subnav = '<a href="javascript:showCalc(\'calculator_loan.html\')">Loan</a>  l  ';
		subnav += '<a href="javascript:showCalc(\'calculator_loancomp.html\')">Loan Comparison</a>  l  ';
		subnav += '<a href="javascript:showCalc(\'calculator_mortgage.html\')">Mortgage</a>  l  ';
		subnav += '<a href="javascript:showCalc(\'calculator_retirement.html\')">Retirement</a>  l  ';
		subnav += '<a href="javascript:showCalc(\'calculator_savings.html\')">Savings</a>';
	} else if (this.section=="rates"){
		var subnav = '<a href="' + sitedir + 'rates.html#cd">CD/IRA Rates</a>  l  ';
		subnav += '<a href="' + sitedir + 'rates.html#savings">Savings Rates</a>';
	} else if (this.section=="help"){
		var subnav = '<a href="' + sitedir + 'faq-billpay.html">Bill Pay FAQ</a>  l  ';
		subnav += '<a href="' + sitedir + 'faq-internetbanking.html">Online Banking FAQ</a>  l  ';
		subnav += '<a href="' + sitedir + 'faq-securitytips.html">Security</a>';		
	} else {
		var subnav = '';
	}
	return subnav;
}

