function stopError() {
 // return true;
}

window.onerror = stopError;
/*
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);
} 

/************************************************************************************************************
* 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] = '<h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br/>You are leaving Heritage Bank\'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 Heritage Bank. The site you are about to visit may have a privacy policy that is different than Heritage Bank\'s. Please review their privacy policy. Heritage 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] = '<h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br/>You are leaving Heritage Bank\'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 Heritage Bank. The site you are about to visit may have a privacy policy that is different than Heritage Bank\'s. Please review their privacy policy. Heritage 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] = '<h1 style="margin-left:100px;">Non-Secure Email Disclaimer</h1><br/>As a convenience to you and to provide additional means of communications between you and Heritage 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.';
	
	messages[3] = '<h1 align="center">IMPORTANT INFORMATION ABOUT<br />PROCEDURES FOR<br />OPENING A NEW ACCOUNT</h1><p>To help the government fight the funding of terrorism and money laundering activities, Federal law requires all financial institutions to obtain, verify, and record information that identifies each person who opens and account.</p><p>What this means for you: When you open an account, we will ask for your name, address, date of birth, and other information that will allow us to identify you. We will also ask to see your driver\'s license or other identifying documents.</p>';
	
	messages[4] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Heritage Bank\'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 Heritage Bank. The site you are about to visit may have a privacy policy that is different than Heritage Bank\'s. Please review their privacy policy. Heritage 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] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Heritage Bank\'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 Heritage Bank. The site you are about to visit may have a privacy policy that is different than Heritage Bank\'s. Please review their privacy policy. Heritage Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';

	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);
}

show_warning = showWarning;

function openIB(){
    //showMessage();
	
	self.location.href = "?pageLabel=login";
	
}

function goDemo(){
    //showMessage();
	
	self.location.href = "?pageLabel=login&demo";
	
}

function openCM(){
    showMessage();
	
		
}

function showMessage(){
    var content = new Array();
	var index = 0;
	content[index++] = '<h1>Coming Soon!!</h1><br/><p>You are attempting to access a page or product that is not yet available.</p>  <p>Please check back often. It will be available soon.</p><p>Thank you!</p>';
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'"><strong>Close</strong></a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);

}

function sendMail(rec){
    self.location.href = "https://www.heritagebankwaonline2.com/home?pageLabel=on.on_app.on_app_em&amp;rec="+rec;
}

function navContactIFrame(){
    if(!document.getElementById)return;
    url = document.location.href;
    formName = url.match(/type=([^#&]+)/);
    if(!formName || !formName[1]){
        fName = false;
    }
    else
        fName = formName[1];
    
    objFrame = document.getElementById("formFrame");
    objFrame.src = "https://www.heritagebankwaonline2.com/Forms/OnlineForm.cgi?form=email_app_WC"+(fName?"&type="+fName:'');

}

function hfwaRedirect(){

	document.location.replace("http://phx.corporate-ir.net/phoenix.zhtml?c=71188&p=IROL-irhome");

} 
//end of file
