var menus={
disappeardelay: 250,
disablemenuclick: false,
downsymbol: '',
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null,
getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},
showhide:function(obj, e, obj2){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (obj2.parentNode.className.indexOf("default")==-1)
obj2.parentNode.className="selected"
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},
iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},
clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure)
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
this.dropmenuobj.style.borderTopWidth=(edgeoffset==0)? 0 : "1px"
}
return edgeoffset
},
dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null){
this.dropmenuobj.style.visibility="hidden"
if (this.previousmenuitem!=null && this.previousmenuitem!=obj){
if (this.previousmenuitem.parentNode.className.indexOf("default")==-1)
this.previousmenuitem.parentNode.className=""
menus.togglehiddenobj(this.previousmenuitem, 'visible')
}
}
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){menus.delayhidemenu(obj)}
obj.onclick=function(){return !menus.disablemenuclick}
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){menus.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){menus.dynamichide(e, obj)}
this.dropmenuobj.onclick=function(){menus.delayhidemenu(obj)}
this.showhide(this.dropmenuobj.style, e, obj)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
this.previousmenuitem=obj
menus.togglehiddenobj(obj, "hidden")
}
},
togglehiddenobj:function(obj2, visible){
var revvalue=obj2.getAttribute("rev")
if (typeof revvalue=="string" && revvalue.length>0 && document.getElementById(revvalue)!=null)
document.getElementById(revvalue).style.visibility=visible
},
contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},
dynamichide:function(e, obj2){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu(obj2)
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu(obj2)
},
delayhidemenu:function(obj2){
this.delayhide=setTimeout(function(){menus.dropmenuobj.style.visibility='hidden'; if (obj2.parentNode.className.indexOf('default')==-1) obj2.parentNode.className=''; menus.togglehiddenobj(obj2, 'visible')},this.disappeardelay)
},
clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},
initializemenus:function(menuid, opt_selectedmenuitem){
var menuitems=document.getElementById(menuid).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (parseInt(opt_selectedmenuitem)==i)
menuitems[i].parentNode.className+=" selected default"
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
menus.dropit(this, event, this.getAttribute("rel"))
}
if (menus.downsymbol!="")
menuitems[i].innerHTML+=menus.downsymbol
}
}
}
}

function externalSite(url){
	agree=confirm(
	"You are about to leave Kappa Alpha Psi Federal Credit Union's Web site.\n\n" +
	"Any external site listed here is not under the control of Kappa Alpha Psi Federal Credit Union, and The Credit Union makes no representation concerning the content of this site, nor does a link serve as an endorsement by Kappa Alpha Psi Federal Credit Union of any site. Kappa Alpha Psi Federal Credit Union does not represent either the third party or the member if the two enter into a transaction.\n\n" +
	"Please note that when you exit our site, our Privacy Policy is no longer in effect.  Privacy and security policies may differ from those practiced by the Credit Union.\n\n" +
	"Thank you for visiting.  Please return when you need information about Kappa Alpha Psi Federal Credit Union's products and services."
	);
	if (agree)
		x=window.open(url);
}
