// for Cool Menus
window.onerror = function(){ return true; }
/*
if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();
*/


/*window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}*/

//window.onerror = function(){ return true; }

function target_blank(url){
    tmp = window.open(url);
    tmp = null;
}

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 = dir + '/images/' + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = dir + '/images/' + 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;
}


document.write('<img src="'+dir+'/images/wcscreenrez.gif?width='+screen.width+'&height='+screen.height+'" width="1" height="1">'); 

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 open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.usfed.org/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

function openPDF(page)
{
bWindow = window.open('/home/fiFiles/static/documents/'+page,'newWin');
	bWindow = null;
	return;
}

function openDisc(page)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 300)
var pHeight = (((parseInt(screen.height) / 2)) - 400)
bWindow = window.open(page,'discwin',"scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0,width=600,height=600,top=" + pHeight + ",left=" + pWidth);
	bWindow = null;
	return;
}

function openIB(page){
    if (page=="register")
		openWin('/onlineserv/HB/OnlineForm.cgi?form=BRS_enroll_app');
	else if (page=="help")
		self.location.href="help";
	else if (page=="forgot")
		testForDemo('/onlineserv/HB/ForgottenPW.html');	
	else
		self.location.href="home";
}
/************************************************************************************************************
* 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 : "_blank";
	msg = (msg) ? msg : 1;
	
		var messages = new Array(6);
	
	messages[0] = '<h2 align="center">Third Party Site Disclaimer</h1><br/>You are leaving \'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ lk +'</strong> are not provided or guaranteed by . The site you are about to visit may have a privacy policy that is different than \'s. Please review their privacy policy.  does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[1] = '<h2 align="center">Third Party Site Disclaimer</h1><br/>These links to other Web sites are provided to assist you in locating information. Once you click on a link, you will leave First Atlantic Federal Credit Union\'s Web site and link to an alternate site that is not operated by First Atlantic. The fact that there is a link between First Atlantic\'s Web site and another site does not constitute endorsement for any product, service or organization. First Atlantic has no responsibility for the content of and does not guarantee the accuracy of any information on any of the sites listed. First Atlantic does not represent either the third party or the member if the two enter into a transaction. Privacy and security policies of other Web sites may differ from those practiced by First Atlantic.';
	
	messages[2] = 'Please be advised that e-mail is an unsecured method of communication. Any information contained in your message could be viewed by a third party.';
	
	messages[3] = '<h2 align="center">ShareBuilder Transfer Notice</h2><br />You are now leaving this site and will be transferred to a non-affiliated site that is not owned or controlled by .<br /><br />Investments are not obligations of, deposits of, or guaranteed by .  Investments are not insured by the National Credit Union Share Insurance Fund or any other federal government agency of the United States, .  Investments are subject to investment risks, including possible loss of value.  Brokerage services are provided by ShareBuilder, an affiliate of NetStock Inc., a registered broker/dealer and member of the NASD and SIPC.<br /><br />ShareBuilder/NetStock, Inc. is not an affiliate of .';
	
	messages[4] = '<h2 align="center">Auto Insurance Quote Transfer Notice</h2><br />You are about to leave \'s web site.<br /><br />The web site you have selected is an external one located on another server.  While  has no responsibility for any external web site, this is a trusted partner of  and all information is maintained in a secure environment.<br /><br /> makes no warranty, express or implied, regarding any external site.<br /><br />CA License No. 0B33273';
	
	messages[5] = '<h2 align="center">Homeowners Insurance Quote Transfer Notice</h2><br />You are about to leave \'s web site.<br /><br />The web site you have selected is an external one located on another server.  While  has no responsibility for any external web site, this is a trusted partner of  and all information is maintained in a secure environment.<br /><br /> makes no warranty, express or implied, regarding any external site.<br /><br />CA License No. 0B33273';

	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\';  showSelects(); document.getElementById(\'flashpromo\').style.visibility = \'visible\';">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'; showSelects(); document.getElementById(\'flashpromo\').style.visibility = \'visible\'; ">Decline</a></div></div>';	
	if (document.getElementById("flashpromo"))
	{
	//    document.getElementById("flashpromo").style.visibility = "hidden";
	} 
	hideSelects();
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	
	scrollTo(0,0);
}

function hideSelects()
{
    var select_boxes = document.getElementsByTagName('select');
        
    for (var i = 0; i < select_boxes.length; i++)
    {
        //alert(hidable_items[i]);
        select_boxes[i].style.visibility = 'hidden';
    }
}

function showSelects()
{

    var select_boxes = document.getElementsByTagName('select');
//alert("showSelects "+select_boxes.length);
    for (var i = 0; i < select_boxes.length; i++)
    {
      //  alert("show:"+select_boxes[i]);
        select_boxes[i].style.visibility = 'visible';
    }
}

/*
function showWarning(URL)
{
	document.location.href = "?pageLabel=thirdparty&amp;newUrl="+URL;
}	
*/
function getUrl(){
	var url = document.location.href;
	var urlstart = url.indexOf("newUrl=") + 7;
	var urlToReturn = url.substring(urlstart);
	return urlToReturn;
}

function openPDF(page)
{
bWindow = window.open('/home/fiFiles/static/documents/'+page,'newWin');
	bWindow = null;
	return;
}

function openNewWin(page)
{
bWindow = window.open(page,'newWin');
	bWindow = null;
	return;
}


function writeFlash()
{
    var content = new Array();
    var index = 0;
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"     codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="566" height="174"  name="hidable" id="flashpromo" align="middle">');
    document.write('                                            <param name="wmode" value="transparent" />');
    document.write('                                            <param name="allowScriptAccess" value="sameDomain" />');
    document.write('                                            <param name="movie" value="/home/fiFiles/static/images/flashpromo.swf" />');
    document.write('                                            <param name="quality" value="high" />');
    document.write('                                            <param name="bgcolor" value="#ffffff" />');
    document.write('                                            <param name="scale" value="noborder" />');
    document.write('                                                <embed src="/home/fiFiles/static/images/flashpromo.swf" quality="high" bgcolor="#ffffff" width="566" height="174" name="flashpromo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" wmode="transparent" scale="noborder" />');
    document.write('                                        </object>');
  //  document.write(content);

}

function showNewsletterMessage(){
		var msgcontent = new Array();
var msgcontentctr=0;		
msgcontent[msgcontentctr]='<div align="center"><img src="../images/logo_firstatlantic.gif" border="0" alt="" /></div>';
msgcontent[msgcontentctr++]='<div align="left"><strong>Thank you for signing up!</strong><br /><br />';
msgcontent[msgcontentctr++]='Now you\'ll receive special offers and promotions from First Atlantic via e-mail.</div><br /><br />'; 
 msgcontent[msgcontentctr++]='You will also begin receiving the Currents E-newsletter on a quarterly basis. Here you will find useful information to help improve your financial life.<br /><br />'
 msgcontent[msgcontentctr++]='<div align="center"><a href="javascript:void(\'0\');" onclick="document.forms[\'newsletter\'].submit();document.getElementById(\'ex_dis\').style.display = \'none\'; showSelects(); document.getElementById(\'flashpromo\').style.visibility = \'visible\'; ">Close</a></div>';
	document.getElementById("ex_dis").innerHTML = msgcontent.join("");
	document.getElementById("ex_dis").style.display = "block";
	
	scrollTo(0,0);
 }
 
 function wc_testForDemo(URL)
{
    if(document.cookie.indexOf('demo') != -1)
    {
        var exit_demo = confirm("In order to proceed, you must first exit the demo.  Would you like to exit the demo?");
        if (exit_demo)
        {
            expireDate = new Date("January 1, 1970");
            var kill_string1 = "cookie_check=invalid;expires=" + expireDate.toGMTString() + "; path=/";
            document.cookie = kill_string1;
            var kill_string2 = "demo=stub;expires=" + expireDate.toGMTString() + "; path=/";
            document.cookie = kill_string2;
            window.location.href="/home/home";
        }
        else
        {
            window.location.href="/home/home?demo";
        }
    }
    else
    {
            window.open(URL);
    }
}
 
//end of file

