//window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}

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

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="nav-" + name +"-on.jpg";
this.name_off="nav-" + name +"-off.jpg";
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 navitems = new Array();
navitems["onlinebanking"] = new makeNavImage("onlinebanking",109,33);
navitems["busbanking"] = new makeNavImage("busbanking",109,33);
navitems["perscheckacct"] = new makeNavImage("perscheckacct",109,33);
navitems["prod"] = new makeNavImage("prod",109,33);
navitems["services"] = new makeNavImage("services",109,33);
navitems["hours"] = new makeNavImage("hours",109,33);
navitems["about"] = new makeNavImage("about",106,33);

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.northwestgabankonline.com/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

function openIB(page){
if (page=="demo") self.location.href = homedir+"index.html?demo";
else self.location.href = homedir+"index.html";
//if (page=="demo") openWin("https://www.northwestgabankonline.com/onlineserv/HB/demo.html");
//else openWin("https://www.northwestgabankonline.com/onlineserv/HB/")
}

function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving your financial institution's website and entering a website hosted by another party. Your financial institution has not approved this as a reliable partner site.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of your financial institution's website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of your financial institution's.";
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);
}


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 #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');
// OTHER FUNCTIONS ABOVE


/*<!-- rotating banner with corresponging links by matthew.billings @ digitalinsight.com -->
<!-- 1. drop script in head  --> 
<!-- 2. fill out config variables -->
<!-- 3. add onLoad="changeBanner(); changeBanner2();" to <body> -->
<!-- 4 make sure image is named banner -->
<!-- 5. general form of use. <a href="#"><img src="./img1.gif" name="banner" border="0"></a> (image needs to be named banner!)  -->
<!--*/


//Config variables
var imageArray = new Array(imgdir+"gift.jpg"); //the src values for the images
var bannerOnPage = 0;  //this value is the number of links that occour on the page before the banner.
var visibleForSeconds = 6; //how many seconds to you want before the banner swaps out;
var numImages = imageArray.length; //number of images to rotate out.
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
//vaiables that souldn'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 

//for random number choosing
function rand(numImages) {
		return Math.ceil((Math.random()* numImages));       
};	
	
//the function that does all the work
function changeBanner(){

	//swapping code
	//line 138 will need to be uncommented for grs banners to work.
	//document.banner.src = imageArray[iteratorNum];  //change image
	
	//fancypants math stuff
	iteratorNum +=1;
	iteratorNum %= numImages;
	
	//sleeps and then changes banner
	setTimeout('changeBanner()', visibleForSeconds * 1000)

}

function writePromo1() {
	// Do nothing
}

function writePromo2() {
	// Create me!
}

function writePromo3() { // This is pulling the second rotating promo on the page. It's set by _rotating_promo2.js 
	document.write('<a id="bannerLink2" href="#"><img src="https://www.northwestgabankonline.com/images/promo_idtheftins.gif" border="0" name="banner2" id="bannerImg2" alt="Get Identity Theft insurance with our Smart Buy package." title="Get Identity Theft insurance with our Smart Buy package." /></a>');
}