function Includes(section){
	if(window.homepage){
		this.myhome = true
	}
	else{
		this.myhome = false;
	}
	this.makeHeader = makeHeader;
	this.makeFooter = makeFooter;
	this.section = section;
	this.header;
	this.footer;
}

function makeHeader(){
	var header = new Array();
	var index = 0;
	header[index++] = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td bgcolor="#278A4D" width="9%"><img src="'+imgdir+'logo.jpg" width="165" height="82" alt="First National Bank of Wayne"></td>';
	header[index++] = '<td width="91%" bgcolor="#278A4D" align="right"><img src="'+imgdir+'header.jpg" width="595" height="82" alt="First National Bank of Wayne"></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td background="'+imgdir+'navbg.gif"><img src="'+imgdir+'nav_top.gif" width="165" height="19"></td>';
	header[index++] = '<td background="'+imgdir+'navbg.gif" align="right"><a href="'+homedir+'home.html" onMouseOver="img_act(\'home\'); window.status=\'Home\'; return true" onMouseOut="img_inact(\'home\');"><img src="'+imgdir+'nav-home-off.gif" width="62" height="19" name="staff" alt="staff" border="0"></a><a href="'+sitedir+'staff.html" onMouseOver="img_act(\'staff\'); window.status=\'Staff\'; return true" onMouseOut="img_inact(\'staff\');"><img src="'+imgdir+'nav-staff-off.gif" width="54" height="19" name="staff" alt="staff" border="0"></a><a href="'+sitedir+'calculators.html" onMouseOver="img_act(\'calculators\'); window.status=\'Calculators\'; return true" onMouseOut="img_inact(\'calculators\');"><img src="'+imgdir+'nav-calculators-off.gif" width="91" height="19" name="calculators" alt="calculators" border="0"></a><a href="javascript:open_apps(\'email_app\');" onMouseOver="img_act(\'contact\'); window.status=\'Contact Us\'; return true" onMouseOut="img_inact(\'contact\');"><img src="'+imgdir+'nav-contact-off.gif" width="86" height="19" name="contact" alt="contact us" border="0"></a><a href="'+sitedir+'links.html" onMouseOver="img_act(\'links\'); window.status=\'Useful Links\'; return true" onMouseOut="img_inact(\'links\');"><img src="'+imgdir+'nav-links-off.gif" width="84" height="19" name="links" alt="useful links" border="0"></a></td>';
	header[index++] = '</tr>';
	header[index++] = '</table>';
	header[index++] = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr>';
	header[index++] = '<td valign="top"> ';
	header[index++] = '<table width="760" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr> ';
	header[index++] = '<td valign="top" width="165" height="142"> <img src="'+imgdir+'login-hed.gif" width="165" height="27" alt="online banking"><br>';
	header[index++] = '<a href="javascript:openIB();"><img src="'+imgdir+'login-login.gif" width="52" height="33" border="0" alt="login"></a><a href="javascript:openIB(\'demo\');"><img src="'+imgdir+'login-demo.gif" width="39" height="33" border="0" alt="demo"></a><a href="'+sitedir+'ib_info.html"><img src="'+imgdir+'login-info.gif" width="74" height="33" border="0" alt="more info"></a><br>';
	header[index++] = '<a href="'+sitedir+'about.html" onMouseOver="img_act(\'aboutus\'); window.status=\'About Us\'; return true" onMouseOut="img_inact(\'aboutus\');"><img src="'+imgdir+'nav-aboutus-off.gif" width="165" height="30" name="aboutus" alt="About Us" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'deposit.html" onMouseOver="img_act(\'depositproducts\'); showMenu(\'menu1\'); window.status=\'Deposit Products\'; return true" onMouseOut="img_inact(\'depositproducts\');"><img src="'+imgdir+'nav-depositproducts-off.gif" width="165" height="30" name="depositproducts" alt="Deposit Products" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'loan_products.html" onMouseOver="img_act(\'loanproducts\'); showMenu(\'menu2\'); window.status=\'Loan Products\'; return true" onMouseOut="img_inact(\'loanproducts\');"><img src="'+imgdir+'nav-loanproducts-off.gif" width="165" height="30" name="loanproducts" alt="Loan Products" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'services.html" onMouseOver="img_act(\'services\'); showMenu(\'menu3\'); window.status=\'Services\'; return true" onMouseOut="img_inact(\'services\');"><img src="'+imgdir+'nav-services-off.gif" width="165" height="30" name="services" alt="Services" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'atm.html" onMouseOver="img_act(\'atm\'); window.status=\'ATM Locations\'; return true" onMouseOut="img_inact(\'atm\');"><img src="'+imgdir+'nav-atm-off.gif" width="165" height="30" name="atm" alt="ATM Locations" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'telephone.html" onMouseOver="img_act(\'telephone\'); window.status=\'Telephone Banking\'; return true" onMouseOut="img_inact(\'telephone\');"><img src="'+imgdir+'nav-telephone-off.gif" width="165" height="30" name="telephone" alt="Telephone Banking" border="0"><br>';
    header[index++] = '<a href="'+sitedir+'privacy.html" onMouseOver="img_act(\'privacy\'); window.status=\'Privacy Policy\'; return true" onMouseOut="img_inact(\'privacy\');"><img src="'+imgdir+'nav-privacy-off.gif" width="165" height="30" name="privacy" alt="Privacy Policy" border="0"></a><br>';
	header[index++] = '<a href="'+sitedir+'disclosure.pdf" target="_blank" onMouseOver="img_act(\'disclosure\'); window.status=\'disclosure Banking\'; return true" onMouseOut="img_inact(\'disclosure\');"><img src="'+imgdir+'nav-disclosure-off.gif" width="165" height="30" name="disclosure" alt="Disclosures" border="0"><br>';
	header[index++] = '</a></td>';
	header[index++] = '<td valign="top" width="595" align="center" rowspan="2" bgcolor="#FFFFFF"> ';
	header[index++] = '<img src="'+imgdir+'clearpix.gif" width="595" height="19" border="0"> ';
	header[index++] = '<table width="552" border="0" cellspacing="0" cellpadding="0">';
	header[index++] = '<tr> ';
	header[index++] = '<td colspan="2"><img src="'+imgdir+'hed-'+this.section+'.gif" width="552" height="19" alt=""></td>';
	header[index++] = '</tr>';
	if(this.myhome){
		header[index++] = '<tr>';
		header[index++] = '<td width="538"><img src="'+imgdir+'img_mainpage.jpg" width="538" height="190" name="collage"></td>';
		header[index++] = '<td rowspan="2" valign="top" width="14" background="'+imgdir+'hed-sidebg.gif"><img src="'+imgdir+'hed-curve.gif" width="14" height="11"></td>';
		header[index++] = '</tr>';
		header[index++] = '<tr> ';
		header[index++] = '<td width="538" align="center" valign="top" class="ficontent" bgcolor="#FFFFFF">';
	}
	else{
		header[index++] = '<tr> ';
		header[index++] = '<td width="538" align="left" valign="top" class="ficontent" bgcolor="#FFFFFF"><img src="'+imgdir+'clearpix.gif" alt="" width="538" height="1" border="0"><br clear="all"><br clear="all">';
	}

	document.open('text/html','replace');
	document.write(header.join(""));
	document.close();
	this.header = header.join("");
	return;
}

function makeFooter(logos){
	var footer = new Array();
	var index = 0;
    if(logos){
        var writelogos = false;
    }
    else{
        var writelogos = true;
    }
	if(this.myhome){
		footer[index++] = '</td>';
		footer[index++] = '</tr>';
	}
	else{
		footer[index++] = '</td>';
		footer[index++] = '<td valign="top" width="14" background="'+imgdir+'hed-sidebg.gif"><img src="'+imgdir+'hed-curve.gif" width="14" height="11"><img src="'+imgdir+'clearpix.gif" width="1" height="300" align="right"></td>';
		footer[index++] = '</tr>';
	}
	footer[index++] = '<tr> ';
	footer[index++] = '<td colspan="2" align="center" valign="top" class="ficontent"><a href="' + sitedir + 'insurance.html">First National Insurance Agency</a> | <a href="' + sitedir + 'investment.html">Investment Center</a> | <a href="javascript:openLink(\'http://www.deluxe-check-order.com/?url=www.fnbwayne.com&urltext=Return%20to%20First%20National%20Bank%20of%20Wayne\')">Reorder Deluxe Checks</a> ';
	//footer[index++] = '<br><a href="' + sitedir + 'privacy.html">Privacy Policy</a> | <a href="'+sitedir+'disclosure.pdf" target="_blank">Disclosures</a> ';
    footer[index++] = '<img src="'+imgdir+'clearpix.gif" width="1" height="20"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '</td>';
	footer[index++] = '</tr>';
	footer[index++] = '<tr> ';
	footer[index++] = '<td valign="bottom" width="165" align="center"><a href="javascript:openLink(\'http://www.hud.gov\');"><img src="'+imgdir+'ehl.gif" width="31" height="31" border="0" alt="Equal Housing Lender"></a><img src="'+imgdir+'clearpix.gif" width="10" height="1">';
    writelogos ? footer[index++] = '<a href="javascript:openLink(\'http://www.fdic.gov\');"><img src="'+imgdir+'fdic.gif" width="45" height="27" border="0" alt="Member FDIC"></a><br>' : footer[index++] = '<img src="'+imgdir+'clearpix.gif" width="45" height="27" border="0" alt="clear"><br>';
	footer[index++] = '<img src="'+imgdir+'clearpix.gif" width="1" height="5"><br>';
	footer[index++] = '<a href="javascript:openLink(\'http://www.digitalinsight.com\');"><!--[if lt IE 7]><script type="text/javascript" src="https://www.fnbwayne.com/mstinc/web/js/png.js"></script><![endif]--><img src="https://www.fnbwayne.com/mstinc/web/images/di_91x22_1c_k.png" width="91" height="22" border="0" alt="Digital Insight, an Intuit company" /></a><br>';
	footer[index++] = '<img src="'+imgdir+'clearpix.gif" width="1" height="8"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';
	footer[index++] = '<img src="'+imgdir+'clearpix.gif" width="1" height="1"></td>';
	footer[index++] = '</tr>';
	footer[index++] = '</table>';

	document.open('text/html','replace');
	document.write(footer.join(""));
	document.close();
	this.footer = footer.join("");
	return;
}

