function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

var timeOut = null;

function navIn() {
  if (timeOut != null) {window.clearTimeout(timeOut);}
}

function navTimer(navItem, action) {
  if (timeOut != null) {window.clearTimeout(timeOut);}
  timeOut = window.setTimeout('hideNav(\'' + navItem + '\', \'' + action + '\')',250);
}

function hideNav(navItem, action) {
  MM_showHideLayers(navItem,'',action);
}

function myOpen(page,width,height) {
    if (navigator.appName == 'Netscape') {
        adjWidth = width+10;
        adjHeight = height+10;
    }
    else {
        adjWidth = width;
        adjHeight = height;
    }
   
    window.open(page,'windowName','width=' + adjWidth + ',height=' + adjHeight + ',toolbar=no,location=no,directories=no,resizable=yes,status=yes,menubar=yes,scrollbars=yes');
}

function printCheck() {
	if (window.print) {
		window.print();
	} else { 
		alert("Your browser does not support this print function. Please hit CTRL-P if you are using windows, or APPLE/ALT-P if using a Mac.");
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function mailConfirm(passPrefix,passSuffix,passSubject)
{
	if (confirm("Messages sent to IBERIABANK via e-mail are sent over the Internet and may not be transmitted in an encrypted or secure form. Caution is urged in the use of confidential information."))
	{
		if (passSuffix == "pesmail.com") passSuffix = "iberiabank.com";
		passedAddress = "mailto:" + passPrefix + "@" + passSuffix;
		if(passSubject != null){
			passedAddress = passedAddress + "?subject=" + passSubject;	
		}
		window.location = passedAddress;
	}
}

function disclaimer(passedWebsite)
{
	if(confirm('The link you have chosen will direct you to another website not owned or controlled by IBERIABANK. We do not guarantee the accuracy, completeness, or timeliness of the information of other websites. The website may not have the same privacy policy as IBERIABANK and is only provided as a service to the user.'))
	{
		window.open(passedWebsite,'NewWin','toolbar,status,resizable,location,scrollbars,menubar')
	}
}

function linkEvaluator(selectBox)
{
	eval(selectBox[selectBox.selectedIndex].value);
}

function P7_Snap() { //v2.65 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}
/*
	The code below is for the new Show/hide functionality. Any page that calls these functions needs to have the following 
	variables created and set on the page within script tags. Each unique object needs its own flag.
		
		var objectFlag1 = 0;
		var objectFlag2 = 0;
		var objectFlag3 = 0;
		var startObject = 1;
		var stopObject = 3;
*/

//Product Matrix Show/Hide Code.
function toggleMoreInfo(id) {
	var obj = document.getElementById("moreInfo" + id);
	if (obj.className == "hideObject") {
		eval("objectFlag" + id + " = 1;");
		obj.className = "showMoreInfo";
		var obj = document.getElementById("linkText" + id);
		obj.innerHTML = "Hide&laquo;";
	}
	else {
		eval("objectFlag" + id + " = 0;");
		obj.className = "hideObject";
		var obj = document.getElementById("linkText" + id);
		obj.innerHTML = "More&raquo;";
	}
}

//Product Matrix Show/Hide Code With Gray Bar Background.
function toggleMoreInfoGrayBar(id) {
	var obj = document.getElementById("moreInfo" + id);
	if (obj.className == "hideObject") {
		eval("objectFlag" + id + " = 1;");
		obj.className = "showMoreInfo";
		var obj = document.getElementById("linkText" + id);
		obj.innerHTML = "Hide&laquo;";
		var obj = document.getElementById("productRowHighlight" + id);
		obj.className = "mtxRowGrayBar";
	}
	else {
		eval("objectFlag" + id + " = 0;");
		obj.className = "hideObject";
		var obj = document.getElementById("linkText" + id);
		obj.innerHTML = "More&raquo;";
		var obj = document.getElementById("productRowHighlight" + id);
		obj.className = "mtxRowWhiteBar";
	}
}
function toggleMoreInfoGrayBarCDs(id1,id2) {
	var objMoreInfo = document.getElementById("moreInfo" + id1);
	if (objMoreInfo.className == "hideObject") {
		objMoreInfo.className = "showMoreInfo";
		var obj = document.getElementById("linkText" + id1);
		obj.innerHTML = "Hide&laquo;";
	}
	else {
		objMoreInfo.className = "hideObject";
		var obj = document.getElementById("linkText" + id1);
		obj.innerHTML = "More&raquo;";
	}
	for(i=id1 ;i<=id2;i++) {
		if (objMoreInfo.className == "hideObject") {
			var obj = document.getElementById("productRowHighlight" + i);
			obj.className = "mtxRowWhiteBar";
		}
		else {
			var obj = document.getElementById("productRowHighlight" + i);
			obj.className = "mtxRowGrayBar";
		}
	}
}
function toggleMatrixMoreInfoGrayBar(id1,id2) {
	var objMoreInfo = document.getElementById("moreInfo" + id1);
	if (objMoreInfo.className == "hideObject") {
		objMoreInfo.className = "showMoreInfo";
		var obj = document.getElementById("linkText" + id1);
		obj.innerHTML = "Hide&laquo;";
	}
	else {
		objMoreInfo.className = "hideObject";
		var obj = document.getElementById("linkText" + id1);
		obj.innerHTML = "More&raquo;";
	}
	for(i=id1 ;i<=id2;i++) {
		if (objMoreInfo.className == "hideObject") {
			var obj = document.getElementById("productRowHighlight" + i);
			obj.className = "mtxRowWhiteBar";
		}
		else {
			var obj = document.getElementById("productRowHighlight" + i);
			obj.className = "mtxRowGrayBar";
		}
	}
}

//Generic Show/Hide Code.
function showAll(status,startRow,stopRow) {
	for(n=startRow;n<=stopRow;n++) {
		var objLink = document.getElementById("linkObject" + n);
		var objDisp = document.getElementById("displayObject" + n);
		if(status == 0) {
			objLink.className = "bulletPlusListMtxTd";
			objDisp.className = "hideObject";
		} else {
			objLink.className = "hideObject";
			objDisp.className = "bulletListMtxTdNone";
			//Adding code to pull in the image if we need it
			if(arrImage){
				if(arrImage[n-1].length > 0){
					if(document.getElementById("showHideImage" + n).src != arrImage[n-1]){
						document.getElementById("showHideImage" + n).src = arrImage[n-1];
					}
				}
			}			
		}
	}
	return;
}

function toggleShowAllVisibility(id) {
	var objLink = document.getElementById("linkObject" + id);
	var objDisp = document.getElementById("displayObject" + id);
	if(objLink.className == "hideObject") {
		objLink.className = "bulletPlusListMtxTd";
		objDisp.className = "hideObject";
	} else {
		objLink.className = "hideObject";
		objDisp.className = "bulletListMtxTdNone";
		//Adding code to pull in the image if we need it
		if(arrImage){
			if(arrImage[id-1].length > 0){
				if(document.getElementById("showHideImage" + id).src != arrImage[id-1]){
					document.getElementById("showHideImage" + id).src = arrImage[id-1];
				}
			}
		}
	}
	return;
}
function showAllOriginal(status,startRow,stopRow) {
	for(n=startRow;n<=stopRow;n++) {
		var objLink = document.getElementById("linkObject" + n);
		var objDisp = document.getElementById("displayObject" + n);
		if(status == 0) {
			objLink.className = "bulletPlusListMtxTd";
			objDisp.className = "hideObject";
		} else {
			objLink.className = "hideObject";
			objDisp.className = "bulletListMtxTdNone";			
		}
	}
	return;
}

function toggleShowAllVisibilityOriginal(id) {
	var objLink = document.getElementById("linkObject" + id);
	var objDisp = document.getElementById("displayObject" + id);
	if(objLink.className == "hideObject") {
		objLink.className = "bulletPlusListMtxTd";
		objDisp.className = "hideObject";
	} else {
		objLink.className = "hideObject";
		objDisp.className = "bulletListMtxTdNone";
	}
	return;
}

function toggleTable(status,tableID) {
	if(status == 0){	
		document.getElementById("displayTable" + tableID).className = "hideObject";	
	}else{	
		document.getElementById("displayTable" + tableID).className = "showRowObject";	
	}
	return;
}

function toggleRates(status,ratesTableID){
	if(status == 0){
		document.getElementById("ratesLink" + ratesTableID).className = "showRowObject";	
		document.getElementById("ratesDetail" + ratesTableID).className = "hideObject";	
	}else{
		document.getElementById("ratesLink" + ratesTableID).className = "hideObject";	
		document.getElementById("ratesDetail" + ratesTableID).className = "showRowObject";	
	}
	return;
}
//PEMS show/hide
function showHideElement(elementID,rowID,showHideStatus){
	var linkObj = document.getElementById("linkObject" + elementID + "sh" + rowID);
	var displayObj = document.getElementById("displayObject" + elementID + "sh" + rowID);
	
	if(showHideStatus == 0){
		linkObj.className = "bulletPlusListMtxTd";
		displayObj.className = "hideObject";				
	}
	else{
		linkObj.className = "hideObject";
		displayObj.className = "bulletListMtxTdNone";				 
	}
}

function ajaxLogin(){
	var dynURL = "ntLogin.cfm";
	void retrieveURLForHTMLContent(dynURL,"loginContainer");
}

// Functions needed for the map
function ajaxContent(dynURL,contentContainer){
	var dynURL = dynURL;
	regExToUse = /REGIONID=/i;
	regExToUse2 = /REGIONID=0/i;
	if((regExToUse.test(document.cookie)==false && regExToUse.test(dynURL)==false) || regExToUse2.test(dynURL)==true) {
		dynURL = dynURL.replace(/ajax/i,"");
		window.location = "map.cfm?callingPage=" + dynURL;
	}
	void retrieveURLForHTMLContent(dynURL,contentContainer);
}

<!--- Create the JS needed to get the needed info from the map --->
function showRegionContent(regionID,callingPage) {
	window.location = callingPage + "?regionID=" + regionID;
}
//Functions needed for ajax
/* Here is all the code for AJAXing HTML content into an ID'd container*/
var req;
var which;
var contentID;

function retrieveURLForHTMLContent(url,contentTargetID) {
contentID = contentTargetID;
if (window.XMLHttpRequest) { // Non-IE browsers
	 req = new XMLHttpRequest();
	 req.onreadystatechange = processStateChangeForHTMLContent;
	 try {
		 req.open("GET", url, true);
	 } catch (e) {
		 //alert(e);
	 }
	 req.send(null);
 } else if (window.ActiveXObject) { // IE
	 req = new ActiveXObject("Microsoft.XMLHTTP");
	 if (req) {
		 req.onreadystatechange = processStateChangeForHTMLContent;
		 req.open("GET", url, true);
		 req.send();
	 }
 }
}

function processStateChangeForHTMLContent() {
	if (req) {
		if (req.readyState == 4) { // Complete
			if (req.status == 200) { // OK response
				document.getElementById(contentID).innerHTML = req.responseText;
			} else {
				//alert("Problem: " + req.statusText);
			}
		}
	}
}