var uri = document.location.href;
var newUri = false;


/*

META TAGS CONTENT AND DESCRIPTION BELOW

META TAGS CONTENT AND DESCRIPTION BELOW

META TAGS CONTENT AND DESCRIPTION BELOW

*/

document.write('<meta name="description" content="Credit union of new jersey, credit union of nj, www.cunj.org, cunj.org, cunj, credit union, credit union membership, car loan, business loan, banking, free banking, nj banking, bank \n Savings, share savings, young savers club, club accounts, vacation club, holiday club, IRA, share certificates, money market, checking, free checking, interest checking, senior checking, student checking, loans, auto loans, 0% financing, the motor vehicle certification program, guaranteed asset protection, GAP, GAP coverage, mechanical repair coverage, home equity loans, personal loans, student loans, home loans, home equity, home equity line of credit,  credit cards, payment protection, apply for a loan, loan rates, insurance, auto insurance, homeowners insurance, the family security plan, e-services, internet banking, e-statements, free e-statements, electronic statements, reason #243, bill payer, free bill payer, e-deposit, electronic deposit, touch tone teller \n Business services, business checking, business share, business money market, remote deposit, business deposits, business lending, financial services, irs tax center \n Investment services, financial planning, financial analysis, financial consultation, life insurance planning, life insurance analysis, college funding, estate planning, retirement plan, retirement plan review, retirement plan analysis, IRA plan, IRA review, IRA analysis, investment products, financial workshops, financial education workshops \n Anytime advisor, balance financial fitness, identity theft, identity theft protection, credit report, scam alerts, financial seminars, free financial seminars  ">');





	if (window.secure || /Forms/i.test(document.location.href))
	{
		/* make sure we're at https: */
		if(/^http:/.test(uri)){
			uri = uri.replace(/^http/,'https');
			newUri = true;
		}
	}
	else
	{
		/* make sure we're at http: */
		if(/^https:/.test(uri)){
			uri = uri.replace(/^https/,'http');
			newUri = true;
		}
	}
	/* redirect */
	if( ! /^https:\/\/skynet/.test(uri)) {
		if(newUri) document.location.replace(uri);
	}

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



//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('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;
}

/************************************************************************************************************
* 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 : 0;

	var messages = new Array(6);
	messages[0] = '<h1 style="text-align:center">Partner Site Disclaimer</h1>By accessing the noted link you will be leaving Credit Union of New Jersey’s website and entering a partner site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of Credit Union of New Jersey.';
	
	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>';	
	var oExDis = document.getElementById("ex_dis")
	oExDis.innerHTML = content.join("");
    var halfwide = (400/2);
    var pWidth = ( ((parseInt(document.body.offsetWidth) / 2)) - halfwide);
	oExDis.style.top = "160px";
	oExDis.style.left = pWidth+"px";
	oExDis.style.display = "block";
	scrollTo(0,0);
}

function showWarning2(){
	

	var content = new Array();
	var index = 0;
	content[index++] = '<h1 style="text-align:center">About Third Party Links from this Site</h1>NSWC Federal Credit Union provides links from this web site to other non-NSWC Federal Credit Union operated web sites for your information only. NSWC Federal Credit Union neither recommends nor endorses any products or services appearing on these alternate sites. Neither are we responsible for the privacy practices or the contents of any web site other than our own. NSWC Federal Credit Union does not represent Credit Union members or third parties should the two enter into an online transaction. NSWC Federal Credit Union suggests that you engage in an appropriate investigation for any products and services prior to purchase. Questions as to the content, availability or maintenance of these web sites should be directed to the site owners.';
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="http://start.chromecarbook.com/ccb.jsp?ccbId=501922&xmlURI=http://www.nswcfcuonline.org/ccbsettings.xml" target="_blank" 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>';	
	var oExDis = document.getElementById("ex_dis")
	oExDis.innerHTML = content.join("");
    var halfwide = (400/2);
    var pWidth = ( ((parseInt(document.body.offsetWidth) / 2)) - halfwide);
	oExDis.style.top = "160px";
	oExDis.style.left = pWidth+"px";
	oExDis.style.display = "block";
	scrollTo(0,0);
}

/*
function showWarning(URL)
{
	document.location.href = "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 RandomHomeImage(targetElement){
    this.el = targetElement;
    this.imgs = [];
    this.add = function(img){
        this.imgs[this.imgs.length]=img;
    }
    this.set = function(){
        imgToPut = this.imgs[Math.floor(Math.random()*this.imgs.length)];
        htmlToPut = '<a href="'+(/^http/.test(imgToPut.url)?'':'')+imgToPut.url+'"><img src="$fiImages'+imgToPut.img+'" alt="'+imgToPut.alt+'" /></a>';
        document.getElementById(this.el).innerHTML = htmlToPut;
    }
}

//end of file
