// Insert this code on any page that will contain a link alert.
// Replace BANK NAME HERE with the name of the institution as it should appear in the alert.

var undefined;


function LinkAlert(URL,target,type)
	{
	BankName = "Arrowhead Bank"
	var MSG = "";
	if (type==undefined) 
		{
		MSG = MSG + "The " + BankName + " web site provides links to other web sites ";
		MSG = MSG + "for convenience and informational purposes only. Users should ";
		MSG = MSG + "be aware that when you select a link on the " + BankName + "'s web ";
		MSG = MSG + "site to an external web site, they are leaving " + BankName + "'s site.\n";
		MSG = MSG + "\n";
		MSG = MSG + "Linked sites are not under the control of " + BankName + ".";
		MSG = MSG + BankName + " is not responsible for the contents of any linked site ";
		MSG = MSG + "or any link contained in a linked site, or any changes or updates ";
		MSG = MSG + "to such sites. The inclusion of a link does not imply endorsement ";
		MSG = MSG + "by " + BankName + " of the site, its content, advertisers or sponsors. ";
		MSG = MSG + "External sites may contain information that is copyrighted with ";
		MSG = MSG + "restrictions on reuse. Permission to use copyrighted materials must ";
		MSG = MSG + "be obtained from the original source and cannot be obtained ";
		MSG = MSG + "from " + BankName + ".";
	
		myTarget = "_blank";
		if (target!=undefined) myTarget = target;
		if (confirm(MSG)) window.open(URL,myTarget);
		}

	if (type=="email") 
		{
		MSG = MSG + "This message will not be a secure email. Please do not include information ";
		MSG = MSG + "such as account numbers, Social Security numbers, or other non-public ";
		MSG = MSG + "personal information in this form. If you need to send confidential "
		MSG = MSG + "information, please call, fax or mail your inquiry or message to the ";
		MSG = MSG + "locations listed on the About Us page. Thank you.";

		alert(MSG);
		}		
	}

function LaunchCalculator(URL,target,attributes)
	{
	myTarget = target;
	if (myTarget=="" || myTarget==undefined) myTarget = "_blank";
	myAttributes = attributes;
	if (myAttributes=="" || myAttributes==undefined) myAttributes = "width=595,height=400,scrollbars=yes,resizable=yes";
	window.open(URL,myTarget,myAttributes);
	}

// This function loops through all the hyperlinks in a document and assigns
// the LinkAlert function to each weather.com link as an event handler.  Don't call it
// before the document is parsed and the links are all defined.  It is best
// to call it from the onload event handler of a <body> tag.
function confirmAllLinks() {
  for(var i = 0; i < document.links.length; i++) {
    this_href = document.links[i].href;
	if (this_href.indexOf("weather.com")>0) {
		document.links[i].href = "javascript:LinkAlert('"+this_href+"');"
		//document.links[i].onclick = confirmLink;
		document.links[i].target = "_self";
	}
  }
}


window.onload = confirmAllLinks;