//================================================
// Display Page Header
//================================================
function pageHeader()
{
	document.write('	<div id="PageHeader" style="position:relative; top:14px;" onMouseOver="hideAll();">');
	document.write('		<table width=750 border=0 cellspacing=0 cellpadding=0 align="center">');
	document.write('			<tr>');
	document.write('				<td width=300 align="left" valign="middle">');
	document.write('					<img src="images/logo-home.gif" alt="Welcome to Home Bank" width="300" height="104" border="0" align="middle">');
	document.write('				</td>');
	document.write('				<td width=450 align="right" valign="bottom">');
	document.write('					<a href="https://www.homebanksbonline.com/onlineserv/HB/Signon.cgi">');
	document.write('						<img src="images/icon-prsnl-olb.gif" alt="Personal Online Banking Login" width="97" height="25" border="0"></a>');
	document.write('					&nbsp;&nbsp;&nbsp;&nbsp;');
	document.write('					<a href="https://www.homebanksbonline.com/onlineserv/CM/">');
	document.write('						<img src="images/icon-biz-olb.gif" alt="Business Online Banking Login" width="97" height="25" border="0"></a>');
	document.write('					&nbsp;&nbsp;&nbsp;&nbsp;');
	document.write('					<a href="index.html">');
	document.write('						<img src="images/icon-home.gif" alt="Return to our home page" width="84" height="25" border="0"></a>');
	document.write('				</td>');
	document.write('			</tr>');
	document.write('		</table>');
	document.write('	</div>');
}

//================================================
// Display Page Header for IPI
//================================================
function pageHeaderIPI()
{
	document.write('	<div id="PageHeader" style="position:relative; top:14px;" onMouseOver="hideAll();">');
	document.write('		<table width=750 border=0 cellspacing=0 cellpadding=0 align="center">');
	document.write('			<tr>');
	document.write('				<td width=300 align="left" valign="middle">');
	document.write('					<img src="images/logo-fin-srvcs.gif" alt="Welcome to Home Bank Financial Services" width="253" height="103" border="0" align="middle">');
	document.write('				</td>');
	document.write('				<td width=450 align="right" valign="bottom">');
	document.write('					<a href="index.html">');
	document.write('						<img src="images/icon-home.gif" alt="Return to our home page" width="84" height="25" border="0"></a>');
	document.write('				</td>');
	document.write('			</tr>');
	document.write('		</table>');
	document.write('	</div>');
}

//================================================
// Display Page Footer
//================================================
function pageFooter()
{
	document.write('	<p/><hr width=750 size=1>');
	document.write('	<table width=750 border=0 cellspacing=0 cellpadding=5>');
	document.write('		<tr>');
	document.write('			<td width=600 align="left" valign="top">');
	document.write('				<a href="site-map.html">Site Map</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="terms-of-use.html">Terms of Use</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="2012 Privacy Notice.pdf">Privacy Notice</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="patriot-act.html">Patriot Act</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="fair-credit-reporting-act.html">Fair Credit Reporting Act</a>');
	document.write('			</td>');
	document.write('			<td width=150 align="center" valign="top">');
	document.write('				');
	document.write('			</td>');
	document.write('			<td width=300 align="right" valign="top" class="copyright">');
	document.write('				&copy;2012 HOMEBANK - All rights reserved.');
	document.write('			</td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td colspan=3 align="center" valign="top">');
	document.write('				<strong>HomeBank<span class="smlsb"><strong>SB</strong></span></strong>, 59 W Washington Street, Martinsville, IN 46151, 765-342-6695<br>');
	document.write('				<img src="images/fdic-eha.gif" alt="" width="136" height="50" border="0"><p/>');
//	document.write('				Site design by<br><a href="http://www.nextsteptechnology.com/web-development.html"><strong>Next Step Technology</strong></a>');
	document.write('			</td>');
	document.write('	</table>');
}

//================================================
// Display Page Footer
//================================================
function pageFooter2()
{
	document.write('	<p/><hr width=750 size=1>');
	document.write('	<table width=750 border=0 cellspacing=0 cellpadding=5>');
	document.write('		<tr>');
	document.write('			<td width=600 align="left" valign="top">');
	document.write('				<a href="site-map.html">Site Map</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="terms-of-use.html">Terms of Use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="2011_Privacy_Notice.pdf">Privacy Notice</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="patriot-act.html">Patriot Act</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="fair-credit-reporting-act.html">Fair Credit Reporting Act</a>');
	document.write('			</td>');
	document.write('			<td width=150 align="center" valign="top">');
	document.write('				');
	document.write('			</td>');
	document.write('			<td width=300 align="right" valign="top" class="copyright">');
	document.write('				&copy;2012 HOMEBANK - All rights reserved.');
	document.write('			</td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td colspan=3 align="center" valign="top" class="smltext">');
	document.write('				<strong>HomeBankSB</strong>, 59 W Washington Street, Martinsville, IN 46151, 317-831-8037<br>&nbsp;<br>');
//	document.write('				Site design by<br><a href="http://www.nextsteptechnology.com/web-development.html"><strong>Next Step Technology</strong></a>');
	document.write('			</td>');
	document.write('	</table>');
}

//================================================
// Display Page Footer for IPI
//================================================
function pageFooterIPI()
{
	document.write('	<p/><hr width=750 size=1>');
	document.write('	<table width=750 border=0 cellspacing=0 cellpadding=5>');
	document.write('		<tr>');
	document.write('			<td width=300 align="left" valign="top">');
	document.write('				<a href="site-map.html">Site Map</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="terms-of-use.html">Terms of Use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="2011_Privacy_Notice.pdf">Privacy Notice</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="patriot-act.html">Patriot Act</a>');
	document.write('			</td>');
	document.write('			<td width=150 align="center" valign="top">');
	document.write('				');
	document.write('			</td>');
	document.write('			<td width=300 align="right" valign="top" class="copyright">');
	document.write('				&copy;2012 HOMEBANK - All rights reserved.');
	document.write('			</td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td colspan=3 align="center" valign="top" class="smltext">');
	document.write('				<strong>IPI</strong> located at <strong>HomeBankSB</strong><br>');
	document.write('				59 W Washington Street, Martinsville, IN 46151, 317-831-8037<br>&nbsp;<br>');
//	document.write('				Site design by<br><a href="http://www.nextsteptechnology.com/web-development.html"><strong>Next Step Technology</strong></a>');
	document.write('			</td>');
	document.write('	</table>');
}

//================================================
// Display Main Menu
//================================================
function displayMainMenu()
{
	document.write('	<div id="PageMenu" style="position:relative; top:25px; z-index:99;">');
	document.write('		<table width=750 border=0 cellspacing=0 cellpadding=0 align="center">');
	document.write('			<tr height=93>');
	document.write('				<td width=179></td>');
	document.write('				<td width=392 align="center" valign="middle">');
	document.write('					<img src="images/main-menu-all-off.gif" id="imgMainMenu" alt="" width="392" height="83" border="0" align="middle" usemap="#main-menu-map">');
	document.write('				</td>');
	document.write('				<td width=179></td>');
	document.write('			</tr>');
	document.write('			<tr>');
	document.write('				<td width=179></td>');
	document.write('				<td width=393 align="center" valign="middle">');
	document.write('					<table width=392 border=0 cellspacing=0 cellpadding=0>');
	document.write('						<tr>');
	document.write('							<td width=125 align="left" valign="top">');
	document.write('								<div id="divPrsnlMenu"></div>');
	document.write('							</td>');
	document.write('							<td width=9></td>');
	document.write('							<td width=125 align="left" valign="top">');
	document.write('								<div id="divBizMenu"></div>');
	document.write('							</td>');
	document.write('							<td width=9></td>');
	document.write('							<td width=125 align="left" valign="top">');
	document.write('								<div id="divLoanMenu"></div>');
	document.write('							</td>');
	document.write('						</tr>');
	document.write('					</table>');
	document.write('				</td>');
	document.write('				<td width=178></td>');
	document.write('			</tr>');
	document.write('		</table>');
	document.write('	</div>');
}


//================================================
// Display Menu Maps
//================================================
function displayMenuMaps()
{
	document.write('<map name="main-menu-map">');
	document.write('	<area shape="rect" coords="  0,  0,125, 82" href="#" alt="" onMouseOver="document.getElementById(\'imgMainMenu\').src=\'images/main-menu-personal-on.gif\'; showPersonalMenu();">');
	document.write('	<area shape="rect" coords="134,  0,259, 82" href="#" alt="" onMouseOver="document.getElementById(\'imgMainMenu\').src=\'images/main-menu-business-on.gif\'; showBusinessMenu()">');
	document.write('	<area shape="rect" coords="266,  0,391, 82" href="#" alt="" onMouseOver="document.getElementById(\'imgMainMenu\').src=\'images/main-menu-loans-on.gif\'; showLoanMenu()">');
	document.write('</map>');
	document.write('');
	document.write('<!-- Personal Banking Menu Map -->');
	document.write('<map name="personal-menu">');
	document.write('	<area shape="rect" coords=" 0, 0,124,14" href="prsnl-savings.html" alt="Personal Savings"/>');
	document.write('	<area shape="rect" coords=" 0,16,124,31" href="prsnl-checking.html" alt="Personal Checking"/>');
	document.write('	<area shape="rect" coords=" 0,32,124,47" href="prsnl-cds.html" alt="Certificates of Deposit"/>');
	document.write('	<area shape="rect" coords=" 0,48,124,63" href="prsnl-iras.html" alt="Individual Retirement Accounts"/>');
	document.write('	<area shape="rect" coords=" 0,64,124,79" href="prsnl-atm.html" alt="ATM and Debit Cards"/>');
	document.write('	<area shape="rect" coords=" 0,82,124,95" href="prsnl-credit-cards.html" alt="Personal Credit Cards"/>');
	document.write('</map>');	
	document.write('<!-- Business Banking Menu Map -->');
	document.write('<map name="business-menu">');
	document.write('	<area shape="rect" coords=" 0, 0,124,14" href="biz-checking-savings.html" alt="Checking & Savings"/>');
	document.write('	<area shape="rect" coords=" 0,16,124,31" href="biz-merch-svcs.html" alt="Merchant Services"/>');
	document.write('	<area shape="rect" coords=" 0,33,124,47" href="biz-merch-svcs.html" alt="Merchant Services"/>');
	document.write('	<area shape="rect" coords=" 0,49,124,63" href="biz-merch-svcs.html" alt="Merchant Services"/>');
	document.write('	<area shape="rect" coords=" 0,65,124,79" href="biz-payroll.html" alt="Payroll Services"/>');
	document.write('	<area shape="rect" coords=" 0,81,124,96" href="biz-rmt-capture.html" alt="Remote Capture"/>');
	document.write('</map>');	
	document.write('<!-- Loan Menu Map -->');
	document.write('<map name="loan-menu">');
	document.write('	<area shape="rect" coords=" 0, 0,124,14" href="loan-consumer.html" alt="Consumer Products"/>');
	document.write('	<area shape="rect" coords=" 0,16,124,31" href="loan-residential.html" alt="Residential Products"/>');
	document.write('	<area shape="rect" coords=" 0,32,124,47" href="loan-commercial.html" alt="Commercial Products"/>');
	document.write('	<area shape="rect" coords=" 0,48,124,63" href="index.html" alt="Financial Services"/>');
	document.write('</map>');
}


//================================================
// Display Personal Banking sub-menu
//================================================
function showPersonalMenu()
{
	this.obj = document.getElementById('divBizMenu');
	this.style = document.getElementById('divBizMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divLoanMenu');
	this.style = document.getElementById('divLoanMenu').innerHTML='&nbsp;';

	this.obj = document.getElementById('divPrsnlMenu');
	this.style = document.getElementById('divPrsnlMenu').innerHTML='<img id="imgSubMenu" src="images/vsub-menu-personal.gif" border=0 alt="" usemap="#personal-menu">';
	
}


//================================================
// Display Business Banking sub-menu
//================================================
function showBusinessMenu()
{
	this.obj = document.getElementById('divPrsnlMenu');
	this.style = document.getElementById('divPrsnlMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divLoanMenu');
	this.style = document.getElementById('divLoanMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divBizMenu');
	this.style = document.getElementById('divBizMenu').innerHTML='<img id="imgSubMenu" src="images/vsub-menu-business.gif" border=0 alt="" usemap="#business-menu">';
}


//================================================
// Display Loan sub-menu
//================================================
function showLoanMenu()
{
	this.obj = document.getElementById('divPrsnlMenu');
	this.style = document.getElementById('divPrsnlMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divBizMenu');
	this.style = document.getElementById('divBizMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divLoanMenu');
	this.style = document.getElementById('divLoanMenu').innerHTML='<img id="imgSubMenu" src="images/vsub-menu-loan.gif" border=0 alt="" usemap="#loan-menu">';
}


//================================================
// Hide all menus and turn buttons off
//================================================
function hideAll()
{
	this.obj = document.getElementById('divPrsnlMenu');
	this.style = document.getElementById('divPrsnlMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divBizMenu');
	this.style = document.getElementById('divBizMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('divLoanMenu');
	this.style = document.getElementById('divLoanMenu').innerHTML='&nbsp;';
	
	this.obj = document.getElementById('imgMainMenu');
	this.style = document.getElementById('imgMainMenu').src='images/main-menu-all-off.gif';
}

//================================================
// Validate form input
//================================================
function ValidateForm(theForm)
{
	if(theForm.txtName.value == '')
	{
		alert('Please enter your name.');
		theForm.txtName.focus();
		return false
	}
	
	if(theForm.txtEmail.value == '')
	{
		alert('Please enter your email.');
		theForm.txtName.focus();
		return false
	}
}

//================================================
// "Exiting web site" Disclaimer
//================================================
function showDisclaimer()
{
	alert('You are now leaving the HomeBankSB website. HomeBankSB is not responsible for any material, products, or services viewed, obtained, or originated when leaving this site.');
	return true
}


//================================================
// Validate contact form entries
//================================================
function frmValidate(theForm)
{
	var pattern = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;  // for verifying valid email syntax
	
	if(theForm.txtName.value == "")
	{
		alert("Please provide us with your name.");
		theForm.txtName.focus();
		return false;
	}
	
	if(theForm.txtEmail.value == "")
	{
		alert("Please provide us with your email address.");
		theForm.txtEmail.focus();
		return false;
	}
	
	if(!pattern.test(theForm.txtEmail.value))
	{
		alert("The email address provided: '" + theForm.txtEmail.value + "' was not formatted correctly.\nPlease reenter.");
		theForm.txtEmail.value = "";
		theForm.txtEmail.focus();
		return false;
	}
}

//================================================
// Validate contact form entries
//================================================
function confirmRes()
{
	var answer = confirm("To view this page, you must be a resident of FL, IN, MN, OH, or TX.\nIf you do not reside in one of these states, please press Cancel below.");
	if(!answer)
	{
		alert('Returning to previous page...');
		window.location.href = history.back();
	}
}

