// APSBank JavaScript Document
//Dropdown Menus
var menuids=["MainMenu"]

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var a=0; a<ultags.length; a++){
    ultags[a].parentNode.onmouseover=function(){
	 this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[a].parentNode.onmouseout=function(){
	 this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

/** News Ticker **/
var tick;
 function stop(){
   clearTimeout(tick);
}

/** Clock **/
function simpleClock(){
   var ut=new Date();
   var h,m,s;
   var time="        ";
   h=ut.getHours();
   m=ut.getMinutes();
   s=ut.getSeconds();
   if(s<=9) s="0"+s;
   if(m<=9) m="0"+m;
   if(h<=9) h="0"+h;
   time+=h+":"+m+":"+s;
   document.getElementById('clock').innerHTML=time;
   tick=setTimeout("simpleClock()",1000);    
}
   
/** Text Resize **/
var min=8;
var max=17;
var normal=11;

var h1min=15;
var h1max=22;
var h2min=12;
var h2max=20;
var h3min=10;
var h3max=18;
var h4min=8;
var h4max=16;

function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
   
   var h = document.getElementsByTagName('h');
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      h[i].style.fontSize = s+"px"
   }
   
   var h1 = document.getElementsByTagName('h1');
   for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=h1max) {
         s += 1;
      }
      h1[i].style.fontSize = s+"px"
   }
   
   var h2 = document.getElementsByTagName('h2');
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 14;
      }
      if(s!=h2max) {
         s += 1;
      }
      h2[i].style.fontSize = s+"px"
   }
   
   var h3 = document.getElementsByTagName('h3');
   for(i=0;i<h3.length;i++) {
      if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=h3max) {
         s += 1;
      }
      h3[i].style.fontSize = s+"px"
   }
   
   var h4 = document.getElementsByTagName('h4');
   for(i=0;i<h4.length;i++) {
      if(h4[i].style.fontSize) {
         var s = parseInt(h4[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=h4max) {
         s += 1;
      }
      h4[i].style.fontSize = s+"px"
   }


   var sp = document.getElementsByTagName('span');
   for(i=0;i<sp.length;i++) {
      if(sp[i].style.fontSize) {
         var s = parseInt(sp[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      sp[i].style.fontSize = s+"px"
   }
   
   var td = document.getElementsByTagName('td');
   for(i=0;i<td.length;i++) {
      if(td[i].style.fontSize) {
         var s = parseInt(td[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      td[i].style.fontSize = s+"px"
   }
   
   var ahref = document.getElementsByTagName('a');
   for(i=0;i<ahref.length;i++) {
      if(ahref[i].style.fontSize) {
         var s = parseInt(ahref[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      ahref[i].style.fontSize = s+"px"
   }
}
 
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }
   
   var h = document.getElementsByTagName('h');
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      h[i].style.fontSize = s+"px"
   } 
   
   var h1 = document.getElementsByTagName('h1');
   for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=h1min) {
         s -= 1;
      }
      h1[i].style.fontSize = s+"px"
   } 
   
   var h2 = document.getElementsByTagName('h2');
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 14;
      }
      if(s!=h2min) {
         s -= 1;
      }
      h2[i].style.fontSize = s+"px"
   } 
   
   var h3 = document.getElementsByTagName('h3');
   for(i=0;i<h3.length;i++) {
      if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=h3min) {
         s -= 1;
      }
      h3[i].style.fontSize = s+"px"
   } 
   
   var h4 = document.getElementsByTagName('h4');
   for(i=0;i<h4.length;i++) {
      if(h4[i].style.fontSize) {
         var s = parseInt(h4[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=h4min) {
         s -= 1;
      }
      h4[i].style.fontSize = s+"px"
   } 
   
   var sp = document.getElementsByTagName('span');
   for(i=0;i<sp.length;i++) {
      if(sp[i].style.fontSize) {
         var s = parseInt(sp[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      sp[i].style.fontSize = s+"px"
   }
   
   var td = document.getElementsByTagName('td');
   for(i=0;i<td.length;i++) {
      if(td[i].style.fontSize) {
         var s = parseInt(td[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      td[i].style.fontSize = s+"px"
   }
   
   var ahref = document.getElementsByTagName('a');
   for(i=0;i<ahref.length;i++) {
      if(ahref[i].style.fontSize) {
         var s = parseInt(ahref[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      ahref[i].style.fontSize = s+"px"
   }
}

/** Popups **/
function load(){
var load = window.open('printpage.asp?<%=request.querystring()%>&v=1','','scrollbars=yes,menubar=no,height=616,width=500,resizable=yes,toolbar=no,location=no,status=no');
}
function MM_openBrWindow(theURL,winName,features){
  window.open(theURL,winName,features);
}
function MM_showHideLayers(){
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
  if (obj.style){obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }obj.visibility=v; }
}
