

// 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;
}

var navitems = new Array();
navitems["OB"] = new makeNavImage("OB",102,31);
navitems["personal"] = new makeNavImage("personal",115,31);
navitems["business"] = new makeNavImage("business",116,31);
navitems["rates"] = new makeNavImage("rates",50,31);
navitems["infocntr"] = new makeNavImage("infocntr",123,31);


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;
}


var imgdir = "/home/diFiles/skins/default/images/";

var val_sel = "empty";

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 openPage(page)
{
bWindow = window.open(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] = '<h2>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank 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>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[2] = '<h2>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[3] = '<h2>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[4] = '<h2>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[5] = '<h2>Non-Secure Email Disclaimer</h2><br/>As a convenience to you and to provide additional means of communications between you and NJM Bank, you can use electronic mail (e-mail) to contact the bank regarding general inquiries and general access and maintenance issues. However communication via e-mail is not considered secure, and you agree that you will not use e-mail to transmit sensitive and/or confidential information such as account numbers, user IDs, or PINs, or to request or authorize any financial transaction.';

	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 show_warning(lk)
{
    var content = new Array();
	
	target = "_blank";
	
	var index = 0;
	
	content[index++] = '<h2>Third Party Site Disclaimer</h2><br>You are leaving NJM Bank\'s website. Links that may be accessed via this link are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by NJM Bank. The site you are about to visit may have a privacy policy that is different than NJM Bank\'s. Please review their privacy policy. NJM Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	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 getUrl(){
	var url = document.location.href;
	var urlstart = url.indexOf("newUrl=") + 7;
	var urlToReturn = url.substring(urlstart);
	return urlToReturn;
}


function light_img()
{

    if(!document.getElementById)return;
    
    aTag = document.getElementById("nav_pos") ;
    
    id_val = aTag.name;
    
    if(id_val)
    {
    
        id_val = id_val + "1" ;
   
        imgTag = document.getElementById(id_val);
  
        img_src_val = imgTag.src ;
        
        imgTag.src = img_src_val.substring(0,img_src_val.lastIndexOf("_")) + "_on.gif" ;

    }
    
}




function drop_selector(val_sel)
{

    switch(val_sel)
    {   
        case "empty": break;
        
        case "demo": self.location='home?demo'; break;
        
        case "els" : self.location='ob/Internet_Security/OB_IS_ELS';break;
        
        case "els_faq" : self.location='ob/Internet_Security/OB_ELS_FAQ';break;
                
        case "els_demo" : wcPopup('http://www.njmbankonline.com/mstinc/MFA/mfa_main_blue.html','625', '815', '0'); break;
        
        case "billpay": openPage('http://www.njmbankonline.com/bridge/GRP/mvbpp_flash_demo/'); break;
        
        case "faq_ob": self.location='ob/per/faq'; break;
        
        case "forgotpasswd": openPage('https://www.njmbankonline.com/onlineserv/HB/ForgottenPW.html'); break;
        
        case "register_ib" : openPage('https://www.njmbankonline.com/onlineserv/HB/STDReg.cgi'); break;
                
     //   case "security" : self.location='http://www.njmbankonline.com/home/ob.ob_per.ob_per_sec'; break;
        
        case "privacy" : self.location='pri'; break;
        
        case "aol" : openPage('https://www.njmbankonline.com/onlineserv/HB/aol.html'); break;
        
        case "bill_pay": self.location='ob/per/bpp_faq';break;
        
    }


}


function promo_img_func()
{

    if(!document.getElementById)return;
    
    aTag = document.getElementById('homePromo');
    imgTag = aTag.firstChild;
  
    i = Math.floor(Math.random()*img_array.length );

    aTag.href = img_array[i] [0];
    imgTag.src = img_array[i] [1];
    imgTag.alt = img_array[i] [2];
    
}




//end of file