var disclaimerText = "The link you have chosen will direct you to another website not owned or operated by Peoples Bank & Trust.  Due to this we cannot guarantee the accuracy, completeness, or timeliness of the information contained therein.  The website may not have the same privacy policy as Peoples Bank & Trust and the link is provided only as a service to the user.";
function disclaimer(passedWebsite) {
	if(confirm(disclaimerText))
		window.open(passedWebsite,'NewWin','toolbar,status,resizable,location,scrollbars,menubar');
}

var mailConfirmText = "Notice: These email addresses are not secured. Please do not send confidential information, account numbers, and/or other pesonal data via these email channels.";
function mailConfirm(passedAddress) {
	if (confirm(mailConfirmText)) {
		window.location.href = passedAddress;
	}
}

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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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 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');
}

/* Bryan's Tooltip Hodgepodge 
------------------------------------------------------------ */
// This is a helper function that appends new window.onload events without destroying previous events.
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload !== 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            oldonload();
            func();
        };
    }
}
// Get the X coordinate for an event. A mouseover in this case.
function getX(e) {
    var posx;
    posx = 0;
    if (!e) {
        e = window.event;
    }
    if (e.pageX) {
        posx = e.pageX;
    }
    else if (e.clientX) {
        posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
    }
    return posx;
}
// Get the Y coordinate for an event. A mouseover in this case.
function getY(e) {
    var posy = 0;
    if (!e) {
        e = window.event;
    }
    if (e.pageY) {
        posy = e.pageY;
    }
    else if (e.clientY) {
        posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
    }
    return posy;
}
// Show and populate the tooltip and position it where event occured.
function showToolTip(e) {
    if (!document.getElementById || !document.getElementById("toolTip")) {
        return false;
    }
    var toolTip, posx, posy, message;
    toolTip = document.getElementById("toolTip");
    posx = getX(e);
    posy = getY(e);
    message = this.getAttribute("title");
    toolTip.innerHTML = message;
    toolTip.style.top = posy + "px";
    toolTip.style.left = posx + "px";
    toolTip.style.display = "block";
    this.setAttribute("title", "");
}
//Hide the tooltip and put everything back the way it was.
function hideToolTip(e) {
    if (!document.getElementById || !document.getElementById("toolTip")) {
        return false;
    }
    var toolTip, message;
    toolTip = document.getElementById("toolTip");
    message = toolTip.innerHTML;
    toolTip.style.display = "none";
    this.setAttribute("title", message);
}
/*
Find all links with class name of "showToolTip", then add events so the tooltips will work.
This requires "addLoadEvent(initTooltips);" in a script tag on the page the tooltips appear.
*/
function initTooltips() {
    if (!document.getElementsByTagName || !document.getElementById) {
        return false;
    }
    var i, links, toolTip;
    links = document.getElementsByTagName("a");
    toolTip = document.getElementById("toolTip");
    for (i = 0; i < links.length; i++) {
        if (links[i].className.match("showToolTip")) {
            links[i].onmouseover = showToolTip;
            links[i].onmouseout = hideToolTip;
            links[i].onclick = function () {
                return false;
            };
        }
    }
}

/* Zooming link script by Paul Anderson, copyright 2001 CNET Builder.com.
   May be freely used with attribution. Not for resale. All rights reserved. 
   Make a link zoom open by adding the event handler
   
   onclick="zoomBox(event,this);return false"
   
   To zoom into a new, positioned window add width, height, left, and top
   
   onclick="zoomBox(event,this,640,480,100,50);return false"
   */

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;

function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
if (arguments.length > 2) zNew=1;
scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
toX=tox?tox:0;
toY=(toy?toy:0)+scrollH;
fromX=evt.pageX?evt.pageX:evt.clientX;
fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
adjX=toX+evt.screenX-fromX;
adjY=toY+evt.screenY-fromY;
if (document.createElement && document.body.appendChild && !zBox) {
	zBox=document.createElement("div");
	zBox.style.position="absolute";
	document.body.appendChild(zBox);
} else if (document.all && !zBox) {
	document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
	zBox=document.all.zBoxDiv;
} else if (document.layers && !zBox) {
	zBox=new Layer(maxW);
	zBox.style=zBox;
	}
zLink=zlink;
doZoom();
}

function doZoom() {
zStep+=1;
zPct=(10-zStep)/10
if (document.layers) {
	zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
	zBox.document.open();
	zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
	zBox.document.close();
	} else {
	zBox.style.border="2px solid #999999";
	zBox.style.left=toX+zPct*(fromX-toX);
	zBox.style.top=toY+zPct*(fromY-toY);
	zBox.style.width=maxW*(1-zPct);
	zBox.style.height=maxH*(1-zPct);
	}
zBox.style.visibility="visible";
if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
else {
	zBox.style.visibility='hidden';
	zStep=0;
	if (zLink && !zNew) location.href=zLink.href;
	else if (zLink && zNew) {
		var w=window.open(zLink.href,'plan','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY+',scrollbars,resizable');
		zNew=null;
		}
	}
}