/* window.onresize=resize;
function resize(){
self.location.href=self.location.href;
} */


// CALL TO CORRECT DIRECTORY BELOW - if you are on homepage you need <script> var homepage = "yes";</script> to make codework properly
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.ndfcu.org/images/"
sitedir="http://www.ndfcu.org/site/"
securedir="http://www.ndfcu.org/site/"
homedir="http://www.ndfcu.org/"
}
else if(window.securepage)
{
imgdir="https://www.ndfcu.org/images/"
sitedir="http://www.ndfcu.org/site/"
securedir="https://www.ndfcu.org/site/"
homedir="http://www.ndfcu.org/"
}
// CALL TO CORRECT DIRECTORY ABOVE

//$(function(){

//	var enrollPopup = '<div class="enrollPopup" style="display: none;"><div align="center"><img src="' + imgdir + '/logo_ndfcu.gif" width="222" height="83" alt="Notre Dame Federal Credit Union" /></div><h1 align="center">Internet Home Banking Enrollment</h1><br /><p>Enrolling in <strong>Internet Home Banking</strong> is easy - here\'s how:</p><ul><li>In the <strong>Member Number/ID</strong> box, enter your member number.</li><li>In the <strong>Password</strong> box, enter your numeric Touch-Tone Teller PIN for first time Internet Home Banking access.</li></ul><p>If you do not have a Touch-Tone Teller PIN or need assistance, please call 574/239-6611 or 800/522-6611.</p><p style="text-align: center;"><a href="#" id="enrollPopupClose">Close</a></p></div>';

//	$(".container").prepend($(enrollPopup)).css('position', 'relative');

//   $(".enrollPopupOpen").click(function(){
//        $(".enrollPopup").show();
//       return false;
//    });
//    $("#enrollPopupClose").click(function(){
//        $(".enrollPopup").hide();
//        return false;
//    });
    
    // makes the popup show when ?enroll is added to the home page url
//    if (location.href.indexOf("?enroll")!=-1)
//    {
//        $(".enrollPopup").show();
//    }
//});


// 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();

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
oM.mout();
window.status = "";
document[imgName].src = navitems[imgName].newimage_off.src;
}
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW


//Config variables
var numImages = 5; //number of images to rotate out.
var imageArray = new Array("images/HomeBanking.jpg", "images/eStatements.jpg", "images/PRIMEquity.jpg","images/StudentLoans.jpg", "images/Mortgage.jpg"); //the src values for the images
var linkArray = new Array("site/online_billpay.html", "site/online_estatements.html","site/products_loan_heloc.html","site/products_loan_student.html","site/products_loan_mortgages.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 = 5; //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)

}




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 showCalc(calc){
openWin(calc,"calc",550,480,"resizable=1,scrollbars=1");
}

function open_apps(nameofapp){
openWin("https://www.ndfcu.org/Forms/OnlineForm.cgi?form=" + nameofapp,"application",700,600,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,status=1");
}

function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = '<h1>Third Party Site Disclaimer</h1>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.visibility = \'hidden\'">Continue</a>&nbsp;&nbsp;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.visibility = "visible";
scrollTo(0, 0);
}

function newUser(url){
var content = new Array();
var index = 0;
content[index++] = '<h1>New Online Banking Users</h1>';
content[index++] = '<br />Please use the last 4 digits of your social security # to access online banking for the first time.<br /><br />';
content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">CLOSE</a></div></div>';	
document.getElementById("ex_dis").innerHTML = content.join("");
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:185px; left:300px; border: thin solid #003876; padding: 15px; visibility: hidden;z-index: 300; width:350px; height:200px; FILTER: progid:DXImageTransform.Microsoft.dropShadow(Color=#CCCCCC,offX=7,offY=8,positive=true); "></div>');

// OTHER FUNCTIONS ABOVE