if (typeof imgdir == "undefined") imgdir="../images/";
if (typeof securedir == "undefined") securedir="../";
if (typeof homedir == "undefined") homedir="../";
if (typeof proddir == "undefined") proddir="../products/";
if (typeof discdir == "undefined") discdir="../disclosures/";
if (typeof calcdir == "undefined") calcdir="../calculators/";
if (typeof sitedir == "undefined") sitedir="../site/";

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

function makeHeader(sectionimg,sectiontitle){
	var header = new Array();
	var index = 0;
	
	header[index++] = '<div align="center">';
	header[index++] = '<!-- start header table -->';
	header[index++] = '<table border="0" width="760" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr valign="top">';
	header[index++] = '  		<td width="760"><img src="'+imgdir+'logo-left.jpg" width="161" height="143" alt="" border="0" /><img src="'+imgdir+'logo.jpg" width="464" height="143" alt="Iowa State Bank" border="0" /><a href="'+homedir+'index.html?demo"><img src="'+imgdir+'header_cloudsright.jpg" width="135" height="143" alt="" border="0" /></a><br />';
	header[index++] = '<img src="'+imgdir+'nav-space.gif" width="162" height="39" alt="" border="0" />'+writeSectionHeader(sectionimg,sectiontitle)+'</td>';
	header[index++] = '	</tr>';
	header[index++] = '</table>';
	header[index++] = '<!-- end header table -->';
	header[index++] = '<!-- start Nav bar Table  -->';
	header[index++] = '<table border="0" width="760" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr valign="top">';
  	header[index++] = '	<td width="162" background="'+imgdir+'bg.gif">';
	header[index++] = makeLeftNav();
	header[index++] = '</td>';
	header[index++] = '<!-- End Nav nar Table  -->';
	header[index++] = '<!--  start content  -->';
	header[index++] = '	<td width="589">';
	header[index++] = '		<table width="589" height="250" border="0" cellspacing="0" cellpadding="0" align="center">';
	header[index++] = '			<tr valign="top">';
	header[index++] = '				<td width="15"><img src="'+imgdir+'pix-clear.gif" width="15" height="1" alt="" border="0" /></td>';
	header[index++] = '				<td width="574"><img src="'+imgdir+'pix-clear.gif" width="574" height="1" alt="" border="0" /><br />';
	
	document.open('text/html','replace');
	document.write(header.join(""));
	document.close();
	return;
}

function makeLeftNav() {
	var leftnav = new Array();
	var index = 0;
	
	leftnav[index++] = '	<div class="obContainer"><div class="ttlOb"><img src="'+imgdir+'ob_ttl.gif" width="161" height="25" alt="Online Banking Login" /></div><!-- ttlOb --><div class="obLinks"><a href="https://www.iowastatebank.com/onlineserv/HB/STDReg.cgi" target="_top"><strong>Register</strong></a><br /><a href="'+homedir+'index.html?demo">Demo</a>&nbsp;|&nbsp;<a href="javascript:void(0)" onclick="window.open(\'https://www.iowastatebank.com/onlineserv/HB/security_site/privacy.html\',\'info\',\'width=650,height=550,scrollbars=yes,status=yes,resizable=yes\');">More Info</a>';
	if(window.homepage){
	leftnav[index++] = '&nbsp;|&nbsp;<a href="javascript:void(0);" onclick="doPopup();"><strong>Co-Browse</strong></a>';
	}
	leftnav[index++] = '</div><!-- obLinks -->';
	if(window.homepage){
	leftnav[index++] = '<form autocomplete="off" name="Login" action="https://www.iowastatebank.com/onlineserv/HB/Login.cgi" method="post"  onsubmit="return runSubmit(this.form, this)">';
	leftnav[index++] = '<input type="hidden" name="runmode" value="SIGN_IN" />';
	leftnav[index++] = '<input type="hidden" name="DISESSIONID" value="" />User ID<br /><input type="text" name="userNumber" size="14" maxlength="32" class="IDField" onfocus="showMOTD();" /><br />Password<br /><input  type="password" name="password" size="14" maxlength="14"  onblur="bPasswordFocus = false;" onfocus="bPasswordFocus = true;" class="passField" /><br /><a href="https://www.iowastatebank.com/onlineserv/HB/ForgottenPW.html">Forgotten Password</a><div class="btnOb"><input type="image" name="submit" src="images/ob_btn_login.gif" alt="Login &gt;" border="0" /></div></form>';
	} else {
	leftnav[index++] = '<div class="btnObBack"><a href="'+homedir+'index.html"><img src="'+imgdir+'ob_btn_login.gif" width="64" height="23" alt="Online Banking Login" /></a></div>';
	}
	leftnav[index++] = '</div>';
	/*leftnav[index++] = '	<!-- <a href="'+sitedir+'relief.html" class="rollover" onMouseOver="window.status=\'Tornado Relief Fund\'; return true"><img src="'+imgdir+'nav_relief_off.gif" width="162" height="24" alt="Tornado Relief Fund" border="0" name="relief" /></a><br /> -->';*/
	leftnav[index++] = '	<a href="'+proddir+'products.html" class="rollover" onMouseOver="window.status=\'Products and Services\'; return true"><img src="'+imgdir+'nav_products_off.gif" width="162" height="24" alt="Products and Services" border="0" name="products" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'rates.html" class="rollover" onMouseOver="window.status=\'Rates\'; return true"><img src="'+imgdir+'nav_rates_off.gif" width="162" height="24" alt="Rates" border="0" name="rates" /></a><br />';
	leftnav[index++] = '	<a href="'+calcdir+'loan.html" class="rollover" onMouseOver="window.status=\'Calculators\'; return true"><img src="'+imgdir+'nav_calculators_off.gif" width="162" height="24" alt="Calculators" border="0" name="calculators" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'contact.html" class="rollover" onMouseOver="window.status=\'Contact Us\'; return true"><img src="'+imgdir+'nav_contactus_off.gif" width="162" height="24" alt="Contact Us" border="0" name="contactus" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'about.html" class="rollover" onMouseOver="window.status=\'About Us\'; return true"><img src="'+imgdir+'nav_aboutus_off.gif" width="162" height="24" alt="About Us" border="0" name="aboutus" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'links.html" class="rollover" onMouseOver="window.status=\'Useful Links\'; return true"><img src="'+imgdir+'nav_links_off.gif" width="162" height="24" alt="Useful Links" border="0" name="links" /></a><br />';
	leftnav[index++] = '	<a href="'+proddir+'internet_trading.html" class="rollover" onMouseOver="window.status=\'Discount Brokerage\'; return true"><img src="'+imgdir+'nav_brokerage_off.gif" width="162" height="36" alt="Discount Brokerage" border="0" name="brokerage" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'securetips.html" class="rollover" onMouseOver="window.status=\'Online Security Tips\'; return true"><img src="'+imgdir+'nav_securetips_off.gif" width="162" height="24" alt="Online Security Tips" border="0" name="securetips" /></a><br />';
	leftnav[index++] = '	<a href="'+sitedir+'check21.html" class="rollover" onMouseOver="window.status=\'Check 21\'; return true"><img src="'+imgdir+'nav_check21_off.gif" width="162" height="24" alt="Check 21" border="0" name="check21" /></a><br />';
	if(!window.homepage){
		leftnav[index++] = '	<a href="'+homedir+'index.html" class="rollover" onMouseOver="window.status=\'Home\'; return true"><br /><img src="'+imgdir+'nav_home_off.gif" width="162" height="24" alt="Home" border="0" name="home" /></a><br />';
	}
	leftnav[index++] = '<center>';
	leftnav[index++] = '<a href="'+proddir+'ddragon-index.html"><img src="'+imgdir+'dollar_savings2.gif" border="0" /><br /><font size="-1" face="arial" color="#000000">Visit our new "Dollars and $ense for Kids" website</a>.</font>';
	leftnav[index++] = '</center>';
	leftnav[index++] = '<br /><br />';
	

	return leftnav.join("");
}

function makeFooter(arg1){
	var footer = new Array();
	var index = 0;
	var footoption = (typeof arg1 != "undefined")?arg1:false;
		
	footer[index++] = '<br /><br />';
	footer[index++] = '<!-- Begin DI, FDIC, EHL  Logos -->';
	footer[index++] = '<center>';
	footer[index++] = '<table width="400" border="0">';
	footer[index++] = '<tr>';
	if(!footoption){
	footer[index++] = '	<td align="left"><a href="javascript:exitSite(\'http://www.fdic.gov\')"><img src="/mstinc/web/images/fdic_57x19_k_75.png" border=0 /></a></td>';
	}
	footer[index++] = '<td align="center">';
	footer[index++] = '	<!-- DI LOGO-->';
	footer[index++] = '	<a HREF="javascript:exitSite(\'http://www.ifs.intuit.com\');"><img src="/mstinc/web/images/di_140x34_2c.png" width="140" height="34" border="0" alt="Powered by Intuit" /></a>';
	footer[index++] = '<!-- DI LOGO-->';
    footer[index++] = '</td>';
    if(!footoption){
	footer[index++] = '<td align="right">';
	footer[index++] = '	<img src="/mstinc/web/images/ehl_40x35_k_75.png" border="0" />';
	footer[index++] = '</td>';
	}
	footer[index++] = '<td>';
	//footer[index++] = '<scr'+'ipt src="https://seal.verisign.com/getseal?host_name=www.iowastatebank.com&size=M&use_flash=NO&use_transparent=YES&lang=en>/**/</scr'+'ipt></a>';
	footer[index++] = '</td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '</center>';
	footer[index++] = '<br /><br />';
	footer[index++] = '<!-- End DI, FDIC, EHL  LOGOS -->';
	footer[index++] = '				</td>';
	footer[index++] = '		</tr>';
	footer[index++] = '	</table></td>';
	footer[index++] = '<td width="9" background="'+imgdir+'bg2.gif"><img src="'+imgdir+'pix-clear.gif" width="9" height="1" alt="" border="0" /></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '<!-- end main table -->';
	footer[index++] = '<!-- start footer table -->';
	footer[index++] = '<table border="0" width="760" cellspacing="0" cellpadding="0">';
	footer[index++] = '<tr>';
  	footer[index++] = '	<td width="760"><img src="'+imgdir+'ft-address.gif" width="760" height="39" alt="100 North Main St., Clarksville, IA  50649, 777.888.9012" border="0" /></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '<!-- end footer table -->';
	footer[index++] = '</div>';



	document.open('text/html','replace');
	document.write(footer.join(""));
	document.close();

	return;
}
	
	function writeSectionHeader(sectionimg,sectiontitle){
		var content = new Array();
		var index = 0;
		
		if(typeof sectionimg != "undefined" && sectionimg != "none"){
			content[index++]='<img src="'+imgdir+'hed-'+sectionimg+'.gif" width="598" height="39" border="0" alt="'+sectiontitle+'" />';
		}
		
		return content.join("");
	}	
// end of file
	
