if(document.location.href.indexOf("fnbamesonline.com")!=-1)
  	document.location.replace("https://www.fnbames.com");
else { 
		if (window.securepage){ 
	      var loc = document.location.toString();
	      var index = loc.indexOf(":");
	      var url = loc.substring(index,loc.length);
	      if (index == "4")
	          {
	         secureUrl = "https" + url;
	         location.replace(secureUrl); // get rid of current page in history
	      }
		 }
		}



/*
Removed per inc. 800-269369
window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}*/

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="";
securedir="";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.fnbames.com/images/"
sitedir="http://www.fnbames.com/"
securedir="http://www.fnbames.com/"
homedir="http://www.fnbames.com/"
}
else if(window.securepage)
{
imgdir="https://www.fnbames.com/images/"
sitedir="http://www.fnbames.com/"
securedir="https://www.fnbames.com/"
homedir="http://www.fnbames.com/"
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="button_" + name +"_over.gif";
this.name_off="button_" + name +".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_heights=35;
var navitems = new Array();
navitems["personal_bank"] = new makeNavImage("personal_bank",134,nav_heights);
navitems["business_bank"] = new makeNavImage("business_bank",124,nav_heights);
navitems["invest_services"] = new makeNavImage("invest_services",124,nav_heights);
navitems["loan_services"] = new makeNavImage("loan_services",124,nav_heights);
navitems["mort_services"] = new makeNavImage("mort_services",94,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 showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<div class=\"smalltext\"><h2 align='center' class='body_header'>Third Party Site Disclaimer</h2>This link will connect you to other web sites that may be of interest to you, but please be advised that you are leaving the website of First National Bank.  First National Bank does not own or operate the linked sites. These sites may not adhere to the same privacy policies and standards as First National Bank. Please review the privacy policy at each site. First National Bank does not endorse products or services advertised on linked sites nor are we responsible for their content.  First National Bank does not warrant linked sites under any circumstance. First National Bank does not represent this third party nor you if you choose to enter into a transaction with this third party.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');document.getElementById('ex_dis').style.display = 'none'\">Continue</a>  <a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Decline</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}


function showWarningtwo(url){
var content = new Array();
var index = 0;
content[index++] = "<div class=\"smalltext\"><h2 align='center' class='body_header'>Third Party Site Disclaimer</h2>You are now leaving the website of First National Bank.  This link will connect you to a partner affiliate of First National Bank, but the Bank does not own or operate the linked site. First National Bank does endorse products or services offered on this linked site.";
content[index++] = "<br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');document.getElementById('ex_dis').style.display = 'none'\">Continue</a>  <a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Decline</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
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:200px; left:300px; border: thick solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');


// rotating banner with corresponding links updated 10/12/04 by Richard Wise and Joe Dawley
// original rotating banner with corresponging links by matthew billings

// 1. drop script in head or script file
// 2. fill out config variables 
// 3. add onLoad="changeBanner();" to <body> 
// 4  make sure link tag has id="bannerLink" and img tag has name="banner" and id="bannerImg"
// 5. general form of use. <a href="#" id="bannerLink"><img src="./img1.gif" name="banner" border="0" id="bannerImg"></a> 


//Config variables
var imageArray = new Array(imgdir + "300x64_FW_V2_1_Banner.gif",  imgdir + "HSAad.gif", imgdir + "Taxcreditbanner.gif", imgdir + "switch_banner.gif"); //the src values for the images
var linkArray = new Array(sitedir + "personal_financeworks.html", "javascript:openWin('pdfs/HSAAccountPostcard_9.pdf');", "mortgage_services.html", "switch_kit_marketing.html"); //the links you want the images to go to. (make sure links match up with images)
var numImages = imageArray.length; //number of images to rotate out.
var imgElement = "bannerImg";
var linkElement = "bannerLink";  //this is the id you gave your link tag.
var visibleForSeconds = 8; //how many seconds to you want before the banner swaps out;


// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 


//for random number choosing
function rand(numImages) {
		return Math.ceil((Math.random()* numImages));       
};

//vaiables that shouldn't be edited
var iteratorNum = ( rand(numImages) - 1); //-1 to take into account that array starts at 0
var count = 1; //don't touch. It's an initializer 

	
//the function that does all the work
// Function has been disabled
//function changeBanner() { return; }
function changeBanner(){
	
	//IE4/5
	if( document.all )
	{
		//new link and image swapping code
		document.all[linkElement].href = linkArray[iteratorNum];
		document.all[imgElement].src = imageArray[iteratorNum];
	}
	else
	//IE6/NS6 thisis the w3c standard to access
	{
		//new link and image swapping code
		document.getElementById(linkElement).href = linkArray[iteratorNum];
		document.getElementById(imgElement).src = imageArray[iteratorNum];
	}
		
	//fancypants math stuff
	iteratorNum +=1;
	iteratorNum %= numImages;
	
	//sleeps and then changes banner
	setTimeout('changeBanner()', visibleForSeconds * 1000);

}
// OTHER FUNCTIONS ABOVE

function import_google_analytics() {
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

	try {
		var pageTracker = _gat._getTracker("UA-8361215-1");
		pageTracker._trackPageview();
	} catch(err) {}
}
