/* 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 = "http://www.pegasusbankdallas.com/site/";
var securedir = "https://www.pegasusbankdallas.com/site/";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="http://www.pegasusbankdallas.com/site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://208.35.189.227/images/"
sitedir="http://208.35.189.227/site/"
securedir="http://208.35.189.227/site/"
homedir="http://208.35.189.227/"
}
else if(window.securepage)
{ 
imgdir="https://208.35.189.227/images/"
sitedir="http://208.35.189.227/site/"
securedir="https://208.35.189.227/site/"
homedir="http://208.35.189.227/"
}
// 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_heights=29;

var navitems = new Array();

navitems["pers"] = new makeNavImage("pers",49,19);
navitems["bus"] = new makeNavImage("bus",181,32);
navitems["treas"] = new makeNavImage("treas",181,32);
navitems["calcs"] = new makeNavImage("calcs",181,32);
navitems["art"] = new makeNavImage("art",181,32);

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

function openPDF(page){
	bWindow = window.open('../pdfs/'+page);
	bWindow = null;
}

// 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.equitableonline.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.equitableonline.com/onlineserv/HB/demo.html");
//else openWin("https://www.equitableonline.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 Pegasus Bank's website and entering a website hosted by another party. Pegasus Bank 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 Pegasus Bank'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 Pegasus Bank.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href='"+url+"' onclick=\"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>');

function comingSoon(link){
var content = new Array();
var index = 0;
content[index++] = "<h2>Coming Soon</h2>You have attempted to access " + link + " on Pegasus Bank's website.  This page is currently being developed.  Please check back soon for this online feature.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"#\" onclick=\"document.getElementById('cs_dis').style.display = 'none'\">Close</a>  </div></div>";  
document.getElementById("cs_dis").innerHTML = content.join("");
document.getElementById("cs_dis").style.display = "block";
scrollTo(0, 0);
}

document.write('<div id="cs_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>');

function showEmailWarning(email){

var content = new Array();
var index = 0;
content[index++] = "<h2>Email Security Warning</h2><p>E-mail messages sent over the Internet are not secure. Please do not include any account or personal information such as social security numbers in the message.</p>";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"mailto:"+ email +"\" onclick=\"document.getElementById('email_dis').style.display = 'none'\">Continue</a>  <a href=\"#\" onclick=\"document.getElementById('email_dis').style.display = 'none'\">Decline</a></div></div>";  
document.getElementById("email_dis").innerHTML = content.join("");
document.getElementById("email_dis").style.display = "block";
scrollTo(0, 0);
}

document.write('<div id="email_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>');





// 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 numImages = 3; //number of images to rotate out.
var imageArray = new Array("images/promo_billpay.jpg",  "images/promo_bptw.jpg",  "images/promo_kids.jpg"); //the src values for the images
var linkArray = new Array("site/other_bill_pay.html", "site/community_news_room.html", "site/kids.html"); //the links you want the images to go to. (make sure links match up with images)
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 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)

}



// 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.



//Config variables
var numImages2 = 3; //number of images to rotate out.
var imageArray2 = new Array("images/welcomepic1.jpg",  "images/welcomepic2.jpg",  "images/welcomepic3.jpg"); //the src values for the images
//var linkArray2 = new Array("site/other_bill_pay.html", "site/community_news_room.html", "site/kids.html"); //the links you want the images to go to. (make sure links match up with images)
var imgElement2 = "bannerImg2";
//var linkElement2 = "bannerLink2";  //this is the id you gave your link tag.
//var visibleForSeconds2 = 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 rand2(numImages2) {
		return Math.ceil((Math.random()* numImages2));       
};

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

	
//the function that does all the work
function changeBanner2(){
	
	//IE4/5
	if( document.all )
	{
		//new link and image swapping code
		//document.all[linkElement2].href = linkArray[iteratorNum2];
		document.all[imgElement2].src = imageArray2[iteratorNum2];
	}
	else
	//IE6/NS6 thisis the w3c standard to access
	{
		//new link and image swapping code
		//document.getElementById(linkElement2).href = linkArray[iteratorNum2];
		document.getElementById(imgElement2).src = imageArray2[iteratorNum2];
	}
		
	//fancypants math stuff
	iteratorNum2 +=1;
	iteratorNum2 %= numImages2;
	
	

}


// OTHER FUNCTIONS ABOVE