﻿/* 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="site/";
securedir="site/";
homedir="";
*/

imgdir="https://www.texfed.org/images/"
sitedir="https://www.texfed.org/site/"
securedir="https://www.texfed.org/site/"
homedir="https://www.texfed.org/"

uri = document.location.href;
newUri = false;
        /* make sure we're at https: */
        if(/^http:/.test(uri)){
                uri = uri.replace(/^http/,'https');
                newUri = true;
        }
if(newUri)document.location.replace(uri);


}
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://www.texfed.org/images/"
sitedir="https://www.texfed.org/site/"
securedir="https://www.texfed.org/site/"
homedir="https://www.texfed.org/"

uri = document.location.href;
newUri = false;
	/* make sure we're at https: */
	if(/^http:/.test(uri)){
		uri = uri.replace(/^http/,'https');
		newUri = true;
	}
if(newUri)document.location.replace(uri);

}
// 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 navitems = new Array();
navitems["about"] = new makeNavImage("about",81,37);
navitems["join"] = new makeNavImage("join",74,37);

navitems["accounts"] = new makeNavImage("accounts",129,37);
navitems["loans"] = new makeNavImage("loans",59,37);
navitems["rates"] = new makeNavImage("rates",59,37);
navitems["resources"] = new makeNavImage("resources",144,37);


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('http://www.texfed.org/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 align=\"center\">Third Party Site Disclaimer</h2><br />You are leaving Texas Federal Credit Union's website. Links that may be accessed via this site are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by Texas Federal Credit Union. The site you are about to visit may have a privacy policy that is different than Texas Federal Credit Union's. Please review their privacy policy. Texas Federal Credit Union does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.";
content[index++] = "<br /><br /><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: 9pt; font-weight: normal; color: #000000; text-align: left; position:absolute;   border: 1px solid #1A448E;  display: none; z-index: 3000; "></div>');

function comingSoon(link){
var content = new Array();
var index = 0;
content[index++] = "<h2>Coming Soon</h2>You have attempted to access " + link + " on State Bank of Kansas's website.  This page is currently being developed.  Please check back soon for this online feature.";
content[index++] = "<br /><br /><br /><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: 9pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:125px; left:300px; border: 1px 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>');


// OTHER FUNCTIONS ABOVE


	function option_link(url){
		var page = url;  
	    self.location=url; 			
	}

	
	
	
	
	
	
	
	
// 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 onload="changeBanner();"> 
// 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 = 6; //number of images to rotate out.
var imageArray = new Array("https://www.texfed.org/images/promo.jpg",  "https://www.texfed.org/images/i-NETWebAd.jpg", "https://www.texfed.org/images/10831C-173x108.jpg",  "https://www.texfed.org/images/10908C.jpg",  "https://www.texfed.org/images/PTG_road.jpg", "https://www.texfed.org/images/MortgageBanner.jpg"); //the src values for the images 
var linkArray = new Array("http://www.texfed.org/site/accounts_epay.html", "javascript:openPDF('accountservices_net_inet_application.pdf');", "http://www.texfed.org/site/skipapayment.html", "http://www.texfed.org/site/accounts_Home_Mortgage.html",  "http://www.texfed.org/site/loans.html", "http://www.texfed.org/site/accounts_Home_Mortgage.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 = 6; //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)

}

