function stopError() {
  //return true;
}
window.onerror = stopError;

function makeNavImage(name_on,name_off,name_over,width,height)
{
this.name_on=name_on;
this.name_off=name_off;
this.name_over=name_over;
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;

this.newimage_over = new Image(width,height);
this.newimage_over.src = imgdir + this.name_over;

}

function img_act(imgName)
{
document[imgName].src = navitems[imgName].newimage_over.src;
}

function img_inact(imgName)
{
window.status = "";
document[imgName].src = navitems[imgName].newimage_off.src;
}




function openWindow(loc,winname,options){
	window.open(loc,winname,options);
	return;
}

function openBond(bond){
	var pWidth = ( ((parseInt(screen.width) / 2)) - 550/2);
	var pHeight = (((parseInt(screen.height) / 2)) - 330/2);
	
	window.open(bond,'bond',"width=550,height=330,left="+pWidth+",top="+pHeight);
	return;
}

function home_openwin(url) {
var mylink = 
window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=415,height=415,left=80,top=100");
    return;
}

function openHomePromo(url) {
var mylink = 
window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=525,height=600,left=80,top=100");
    return;
}


function wcInternalPopup(url, height, width){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'internalpopup',features);
} 

function wcPopup(url, height, width, disclaimer){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'externalpopup',features);
} 


/*
function displayThirdPartyAlert(message,lk,descriptor){
	var description = lk.innerHTML;
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	
    if(message==1)
    {
        return confirm('You are leaving Centris\' website. The products and services provided by the site, ' +description+ ',you are entering are part of Centris Federal Credit Union.');
    }
    else if(message==2)
    {
        return confirm('You are leaving Centris\' website. The products and services of the site, ' +description+ ', you are entering are offered by Centris Federal Credit Union. The site you are about to visit may have a different privacy policy than Centris\'. Please review their privacy policy.');
    }
    else if(message==3)
    {
        return confirm('You are leaving Centris\' website. Any products and services accessed through this link are not provided or guaranteed by Centris. The site, ' +description+ ',you are about to visit may have a privacy policy that is different than Centris\'. Please review their privacy policy.');
    }
    else if(message==4)
    {
        return confirm('You are leaving Centris\' website. Products and services accessed through this link are not provided or guaranteed by Centris.  The site, ' +description+ ',you are about to visit may have a privacy policy that is different than Centris\'.  Please review their privacy policy.');
    }
    else if(message==5)
    {
        return confirm('You are leaving Centris\' website.');
    }
    else if(message==6)
    {
        return confirm('You are leaving Centris\' website. Products and services accessed through this link are not provided or guaranteed by Centris.  The site, careerlink.org, you are about to visit may have a privacy policy that is different than Centris\'.  Please review their privacy policy.');
    }
    else if(message==7)
    {
        return confirm('You are leaving Centris\' website. The products and services of the site, ' +descriptor+ ', you are entering are offered by Centris Federal Credit Union. The site you are about to visit may have a different privacy policy than Centris\'. Please review their privacy policy.');
    }
	return false;
}

*/



function displayThirdPartyAlert(msg,lk,descriptor){
//You may have up to 5 different messages: 0, 1, 2, 3, 4
	var description = lk.innerHTML;

	if(description.indexOf('alt="') != -1){
	//alt tag description must be a least 2 words.
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);0
        msg = (msg) ? msg : 0;
		description = temp.substring(0,temp.indexOf("\""));
	}
	//content creation
	var content = new Array();
    var index = 0;
    if(msg == 0){
		content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. The products and services provided by the site, ' +description+ ',you are entering are part of Centris Federal Credit Union.';
	}
	else if(msg == 1){
		content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. The products and services of the site, ' +description+ ', you are entering are offered by Centris Federal Credit Union. The site you are about to visit may have a different privacy policy than Centris\'. Please review their privacy policy.';
	}
	else if(msg == 2){
		content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1>Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. Any products and services accessed through this link are not provided or guaranteed by Centris. The site, ' +description+ ',you are about to visit may have a privacy policy that is different than Centris\'. Please review their privacy policy.';
	}
	else if(msg == 3){
	content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1>Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. Products and services accessed through this link are not provided or guaranteed by Centris.  The site, ' +description+ ',you are about to visit may have a privacy policy that is different than Centris\'.  Please review their privacy policy.';
	}
	else if(msg == 4){
	content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1>Third Party Site Disclaimer</h1><br>You are leaving Centris\' website.';
	}
	else if(msg == 5){
	content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1>Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. Products and services accessed through this link are not provided or guaranteed by Centris.  The site, careerlink.org, you are about to visit may have a privacy policy that is different than Centris\'.  Please review their privacy policy.';
	}
	else if(msg == 6){
	content[index++] = '<img src="'+imgdir+'logo-centrisfcu.gif" width="190" height="85" alt="" border="0"><h1>Third Party Site Disclaimer</h1><br>You are leaving Centris\' website. The products and services of the site, ' +descriptor+ ', you are entering are offered by Centris Federal Credit Union. The site you are about to visit may have a different privacy policy than Centris\'. Please review their privacy policy.';
	}
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+lk.href+'" target="_blank" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Continue</a>&#160;&#160;<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);
	return false;
}



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: center; position:absolute; border: 2px solid #330067; padding: 15px; visibility: hidden; z-index: 300; width:400px;  top:50; left:150px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=CCCCCC,offX=7,offY=8,positive=true); "></div>');


//Homepage Script
var fidir = imgdir.indexOf("editmode") != -1 ? "editmode/" : "";


function openIBMessage(pw, ph, pf){

	var width = (pw) ? pw : 500;
	var height = (ph) ? ph : 200;
	var extra = (pf) ? pf : "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1"
	var halfwide = (parseInt(width)/2);
	var halftall = (parseInt(height)/2);	
	var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
	var pHeight = (((parseInt(screen.height) / 2)) - halftall);
	var features = extra +",width="+width+",height="+height+",top="+pHeight+",left="+pWidth;
	window.open("fiFiles/static/documents/ib.html","ibmessage",features);
}

function openAmber(){
	window.open("http://www.centrisfcu.org/home/fiFiles/static/documents/amber.html","amber","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=200,screenX=100,screenY=104,top=90,left=100");
}
// end of file

/*This section of code is for a popup window that will display once when a user exits homebanking and goes back to the homepage.*/
var expDays = 180; // number of days the cookie should last

var page = "https://www.centrisfcu.org/home/fiFiles/static/documents/survey.html";
var windowprops = "width=600,height=350,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes";

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);

window.open(page, "", windowprops);

}
else {
count++;
SetCookie('count', count, exp);
   }
}
/*end cookie code*/

function checkLastPage () {

	if ((document.referrer == 'https://www.centrisfcu.org/onlineserv/HB/HomeBanking.cgi') || (document.referrer == 'https://www.centrisfcu.org/onlineserv/HB/Goodbye.cgi') || (document.referrer=='https://www.centrisfcu.org/onlineserv/HB/dimlDisplayer.cgi?DIML_FILE=DemoLayout.diml&DIML_PATH=../HB3.library/standard/layout/&pageType=Goodbye&language=english&DEFAULT_HTTP_CHAR_SET=charset=ISO-8859-1'))
	//var refPage = document.referrer;
	//alert(refPage);

	//if (refPage.indexOf("Goodbye")!=-1)
	{
		
		checkCount();

	}
	
	//else 
		//alert(document.referrer);

}

function timeValueCalc(){


 LOCATION = unescape(document.location.pathname);
 LOCATION = LOCATION.substring(1,LOCATION.length);
 QS = unescape(document.location.search);
 QS = "&" + QS.substring(1,QS.length);
 
 TEMPLATE_ID = "www.centrisfcu.org_1";
 PASSTHROUGH = "";

 if (QS.indexOf("TEMPLATE_ID") == -1){QS = QS + "&TEMPLATE_ID=" + TEMPLATE_ID;}
 if ((PASSTHROUGH != "") && (QS.indexOf("PASSTHROUGH") == -1)){QS = QS + "&PASSTHROUGH=" + escape(PASSTHROUGH);}

 URL = "http://www.TimeValueCalculators.com/TimeValueCalculators/Calculator.aspx?RESPONSE=ASJS&REFERREDBY=" + LOCATION + QS;
 document.write('<SCR' + 'IPT LANGUAGE="JavaScript1.2" SRC="' + URL + '" TYPE="text/javascript"></SCR' + 'IPT>');
}

function timeValueCalc2(){


 LOCATION = unescape(document.location.pathname);
 LOCATION = LOCATION.substring(1,LOCATION.length);
 QS = unescape(document.location.search);
 QS = "&" + QS.substring(1,QS.length);
 
 TEMPLATE_ID = "www.centrisfcu.org_1";
 PASSTHROUGH = "";

 if (QS.indexOf("TEMPLATE_ID") == -1){QS = QS + "&TEMPLATE_ID=" + TEMPLATE_ID;}
 if ((PASSTHROUGH != "") && (QS.indexOf("PASSTHROUGH") == -1)){QS = QS + "&PASSTHROUGH=" + escape(PASSTHROUGH);}

 URL = "http://www.TimeValueCalculators.com/TimeValueCalculators/Calculator.aspx?RESPONSE=ASJS&REFERREDBY=" + LOCATION + QS;
 //document.write('<SCR' + 'IPT LANGUAGE="JavaScript1.2" SRC="' + URL + '" TYPE="text/javascript"></SCR' + 'IPT>');
}

