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_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_showHideLayers() { //v6.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; }
}

function  toggleRates(recID){
	objTable = document.getElementById("ratesTable" + recID);
	objLink = document.getElementById("linkDiv" + recID);
	objMin = document.getElementById("minimizeDiv" + recID);

	if(objTable.style.display == "none"){
		objTable.style.display = "block";
		objLink.style.display = "none";
		objMin.style.display = "block";
	}else{ 
		objTable.style.display = "none";
		objLink.style.display = "block";
		objMin.style.display = "none";
	}
}

function  toggleAllRates(showFlag){
	//showflag = 1 is showall
	//arrayVal set  by CF	
	for(i=0;i<arrayVal.length;i++){
		objTable = document.getElementById("ratesTable" + arrayVal[i]);
		objLink = document.getElementById("linkDiv" + arrayVal[i]);
		objMin = document.getElementById("minimizeDiv" + arrayVal[i]);
		if(showFlag == 1){
			objTable.style.display = "block";
			objLink.style.display = "none";
			objMin.style.display = "block";
		}else{ 
			objTable.style.display = "none";
			objLink.style.display = "block";
			objMin.style.display = "none";
		}
	}
}

function disclaimer(passedWebsite)
{
	if(confirm('You are now leaving the Orrstown Bank site. The site you have chosen is independent from Orrstown Bank. Orrstown Bank does not control these sites and does not guarantee the accuracy, completeness, or efficiency or timeliness of the information contained therein.'))
	{
		window.open(passedWebsite,'NewWin','toolbar,status,resizable,location,scrollbars,menubar')
	}
}
function evalLink(linkURL,linkTarget,disclaimerFlag,disclaimerText) {
	var regexp = /&quote;/g;
	disclaimerText = disclaimerText.replace(regexp,"\"");
	switch(linkTarget) {
		case 0: //Same window
			if(disclaimerFlag == 1) {
				if(confirm(disclaimerText)) window.location = linkURL;
			}else window.location = linkURL;		
		break;
		case 1: // New Window
			if(disclaimerFlag == 1) {
				if(confirm(disclaimerText)) window.open(linkURL);
			}else window.open(linkURL);		
		break;
		case 2: // Popup Window
			if(disclaimerFlag == 1) {
				if(confirm(disclaimerText)) void myOpen(linkURL,500,450);
			}else void myOpen(linkURL,500,450);
		break;
	}
}
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');
}

