window.onerror = function(){ return true; }

//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 = templateimages + "/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.nassaufinancial.org/new_site/images/"
sitedir="http://www.nassaufinancial.org/new_site/site/"
securedir="http://www.nassaufinancial.org/new_site/site/"
homedir="http://www.nassaufinancial.org/new_site/"
}
else if(window.securepage)
{
imgdir="https://www.nassaufinancial.org/new_site/images/"
sitedir="http://www.nassaufinancial.org/new_site/site/"
securedir="https://www.nassaufinancial.org/new_site/site/"
homedir="http://www.nassaufinancial.org/new_site/"
}
// 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;
}


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.nassaufinancial.org/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.nassaufinancial.org/onlineserv/HB/demo.html");
//else openWin("https://www.nassaufinancial.org/onlineserv/HB/")
}




/************************************************************************************************************
* This function is used in the onclick of the a tag to display the external site warning. 
* @param msg - Integer specifying the which message to display.
* @param lk - The a link object
* Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a>
**************************************************************************************************************/
function displayThirdPartyAlert(msg,lk){
	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("\""));
	}
	showWarning(lk.href, description, lk.target, msg)
	return false;
}

/************************************************************************************************************
* This function is used in the href of the a tag to display the external site warning. 
* @param lk - The url of the site to be opened
* @param desc - The description of the site to be opened, i.e. the name of the site.
* @param target - Allows for the window to opened in a new window
* @param msg - Integer specifying the which message to display.
* Usage: <a href="javascript:('http://wwww.mysite.com');">My Site</a>
**************************************************************************************************************/
function showWarning(lk, desc, target, msg){
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	messages[0] = '<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union\'s website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial\'s  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.';
	
	messages[1] = '<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union\'s website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial\'s  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.';
	
	messages[2] = '<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.';
	
	messages[3] = '<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union\'s website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial\'s  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.';
	
	messages[4] = '<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union\'s website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial\'s  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.';
	
	messages[5] = '<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union\'s website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial\'s  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.';

	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+lk+'" target="'+target+'" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<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);
}


/*
function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>By accessing the link below you will be leaving Nassau Financial Federal Credit Union's website and entering a website hosted by another party. Although Nassau Financial Federal Credit Union has 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 Nassau Financial's  website. We encourage you to read and evaluate the privacy and security policies on the site you are entering, which may be different than those of Nassau Financial Federal Credit Union.";
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>&nbsp;&nbsp;<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);
}*/

function emailWarning(address)
{
	var content = new Array();
	var index = 0;

	content[index++] = "<h2>E-mail Security Warning</h2>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.";
	content[index++] = "<br /><br /><br />";
	content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"document.location.replace('"+address+"');document.getElementById('ex_dis').style.display = 'none'\">Continue</a>&nbsp;&nbsp;<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);
}

var myWidth = 0, myHeight = 0;

function setSize()
{
if( typeof( window.innerWidth ) == 'number' )
{
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
{
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
}
//alert(myWidth + ', ' + myHeight);
}

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:' + (Math.ceil(myWidth/2)-175) + 'px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 100000; width:350px;"></div>');

function hide_backLinks()
{
if (document.all)
{
document.all["back_links"].style.display = 'none';
}
else
{
document.getElementById('back_links').style.display = 'none';
}
}

function removeFinePrint(str)
{
    var daggerIndex = str.indexOf("&#134;");
    var asteriskIndex = str.indexOf("*");
    
    var newStr = str;
    
    if (daggerIndex > -1)
    {
        newStr = str.substring(0, daggerIndex);
    }
    else if (asteriskIndex > -1)
    {
        newStr = str.substring(0, asteriskIndex);
    }
    
    return newStr;
}

function shrinkSymbols(str)
{
    var fontSize = "9px"

    var asteriskBegin = str.indexOf("*");
    var asteriskEnd = str.lastIndexOf("*", str.length);
    var daggerBegin = str.indexOf("&#134;");
    var daggerEnd = str.lastIndexOf("&#134;", str.length);
    
    newStr = str;
    
    if (asteriskBegin > -1)
    {
        newStr = (str.substring(0, asteriskBegin) + '<span style="font-size: '+fontSize+';">' + str.substring(asteriskBegin, asteriskEnd+1) + '</span>' + str.substring(asteriskEnd+1, str.length));
    }
    else if (daggerBegin > -1)
    {
        newStr = (str.substring(0, daggerBegin) + '<span style="font-size: '+fontSize+';">' + str.substring(daggerBegin, daggerEnd+6) + '</span>' + str.substring(daggerEnd+6, str.length));
    }
    
    return newStr;
}

