if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

// CALL TO CORRECT DIRECTORY BELOW
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.formpage)
{
imgdir="../images/";
sitedir="../site/";
securedir="../site/";
homedir="../";
}
else if(window.absolutepage)
{
imgdir="http://www.fnbchadrononline.com/images/"
sitedir="http://www.fnbchadrononline.com/site/"
securedir="http://www.fnbchadrononline.com/site/"
homedir="http://www.fnbchadrononline.com/"
}
else if(window.securepage)
{
imgdir="https://www.fnbchadrononline.com/images/"
sitedir="https://www.fnbchadrononline.com/site/"
securedir="https://www.fnbchadrononline.com/site/"
homedir="https://www.fnbchadrononline.com/"
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="nav-" + name +"-on.gif";
this.name_off="nav-" + name +"-off.gif";
this.width=width;
this.height=height;
this.newimage_on = new Image(width,height);
this.newimage_on.src = imgdir + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = imgdir + this.name_off;
}

var nav_widths=147;
var nav_heights=30;

var navitems = new Array();
navitems["home"] = new makeNavImage("home",nav_widths,nav_heights);
navitems["bankprod"] = new makeNavImage("bankprod",nav_widths,nav_heights);
navitems["insurance"] = new makeNavImage("insurance",nav_widths,nav_heights);
navitems["invest"] = new makeNavImage("invest",nav_widths,nav_heights);
navitems["rates"] = new makeNavImage("rates",nav_widths,nav_heights);
navitems["calc"] = new makeNavImage("calc",nav_widths,nav_heights);
navitems["about"] = new makeNavImage("about",nav_widths,nav_heights);
navitems["contact"] = new makeNavImage("contact",nav_widths,nav_heights);
navitems["infodesk"] = new makeNavImage("infodesk",nav_widths,nav_heights);
navitems["other"] = new makeNavImage("other",nav_widths,nav_heights);

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
document[imgName].src = navitems[imgName].newimage_off.src;
}
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW
function openWin(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}

function open_apps(nameofapp){
self.location.href = "https://www.fnbchadrononline.com/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

function applyNow(nameofapp){
open_apps(nameofapp);
}

function openIB(page){ // NOTE - The MFA notice div on each page is written in by _dhtml.js

if (page=="demo") self.location.href = "https://www.fnbchadrononline.com/onlineserv/HB/demo.html";
else if (page=="info") self.location.href = sitedir + "infodesk_ibfaqs.html";
else if (page=="security") openWin("https://www.fnbchadrononline.com/onlineserv/HB/security_site/index.html");
//Commenting out the default function for the MFA popup notice  - 201-75458
//else self.location.href = "https://www.fnbchadrononline.com/onlineserv/HB/";
else {
	$('.hideFromTPW').css('visibility', 'hidden');
	document.getElementById('mfaNotice').style.display='block'; scrollTo(0,0);	
}

}

function hideWarning() {
	$('.hideFromTPW').show().css('visibility', 'visible');
	document.getElementById('ex_dis').style.visibility = 'hidden';
}

function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>By accessing the noted link you are leaving First National Bank's website and entering a website hosted by another party. Any products and services accessed through this link are not provided, endorsed or guaranteed by First National Bank. We encourage you to read and evaluate the privacy and the security policy of the site you are entering, as both may be different than those of First National Bank.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');hideWarning();\">Continue</a>  <a href=\"javascript:void('0');\" onclick=\"hideWarning();\">Decline</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
$('.hideFromTPW').css('visibility', 'hidden');
document.getElementById("ex_dis").style.visibility = "visible";
scrollTo(0, 0);
}

document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:125px; left:300px; border: thin solid #275127; padding: 15px; visibility: hidden;z-index: 3000; width:350px;"></div>');
// OTHER FUNCTIONS ABOVE


// DATE STAMP
function datestamp() {
	day = new Array("Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday");
	month = new Array("January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , " November" , "December");
	total = new Date; 
	document.write( month[total.getMonth()] + " " + total.getDate() + ", " + total.getFullYear());
}

