/*

CSS MENU v1.0beta (c) 2001-2003 Angus Turnbull, http://www.twinhelix.com
Altering this notice or redistributing this file is prohibited.

*/

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null;};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null;};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";'+'with(this){'+f+'}');};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');if(!self.page)var page={win:self,minW:0,minH:0,MS:isIE&&!isOp};page.elmPos=function(e,p){var x=0,y=0,w=p?p:this.win;e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}else if(e&&e.focus&&e.href&&this.MS&&navigator.platform.indexOf('Mac')>-1){e.onfocus=new Function('with(event){self.tmpX=clientX-offsetX;'+'self.tmpY=clientY-offsetY}');e.focus();x=tmpX;y=tmpY;e.blur()}else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}return{x:x,y:y};};function CSSMenu(myName,nested,cssProp,cssVis,cssHid){this.myName=myName;this.nested=nested;this.cssProp=cssProp;this.cssVis=cssVis;this.cssHid=cssHid;this.menus={root:new CSSMenuNode('root',this)};this.menuToShow=[];this.mtsTimer=null;this.showDelay=0;this.hideDelay=500;};CSSMenu.prototype.show=function(mN){with(this){menuToShow=arguments;clearTimeout(mtsTimer);mtsTimer=setTimeout(myName+'.menus.root.over()',50);}};CSSMenu.prototype.hide=function(mN){with(this){clearTimeout(mtsTimer);if(menus[mN])menus[mN].out();}};function CSSMenuNode(id,obj){this.id=id;this.obj=obj;this.lyr=this.child=this.args=this.par=this.timer=null;var node=this;this.over=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);if(menuToShow){clearTimeout(mtsTimer);var a=menuToShow,m=a[0];menuToShow=null;if(!menus[m]||!menus[m].lyr.ref)menus[m]=new CSSMenuNode(m,obj);var c=menus[m];if(c==node)return;clearTimeout(c.timer);if(c!=child&&c.lyr.ref){c.args=a;c.par=node;if(showDelay)c.timer=setTimeout(myName+'.menus["'+c.id+'"].show()',showDelay);	else c.show();}}if(!nested&&par)par.over();}};this.out=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);timer=setTimeout(myName+'.menus["'+id+'"].hide()',hideDelay);if(!nested&&par)par.out();}};if(id!='root')with(this)with(lyr=getLyr(id))if(ref){if(ref.addEventListener){ref.addEventListener('mouseover',this.over,false);ref.addEventListener('mouseout',this.out,false);}else{if(isNS4)ref.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);ref.onmouseover=this.over;ref.onmouseout=this.out;}}};CSSMenuNode.prototype.show=function(){with(this)with(obj){if(!par)return;if(par.child&&par.child!=this)par.child.hide();par.child=this;var offR=args[1],offX=args[2],offY=args[3],lX=0,lY=0;if(offR)with(page.elmPos(offR,par.lyr?par.lyr.ref:0))lX=x,lY=y;if(typeof(lX+lY)=='number'){lyr.x(lX+eval(offX));lyr.y(lY+eval(offY))}lyrVis(1);}};CSSMenuNode.prototype.hide=function(){with(this)with(obj){if(!par)return;if(isNS4&&self.isMouseIn&&isMouseIn(lyr.ref))return show();if(lyr)lyrVis(0);if(child)child.hide();if(par&&par.child==this)par.child=null;par=null;}};CSSMenuNode.prototype.lyrVis=function(sh){with(this)with(obj){lyr.sty[cssProp]=sh?cssVis:cssHid;if(args[1])args[1].className=sh?'highlighted':'';}};if(isNS4){var csmMouseX,csmMouseY,csmOR=self.onresize,nsWinW=innerWidth,nsWinH=innerHeight;document.csmMM=document.onmousemove;self.onresize=function(){if(csmOR)csmOR();if(nsWinW!=innerWidth||nsWinH!=innerHeight)location.reload();};document.captureEvents(Event.MOUSEMOVE);document.onmousemove=function(e){csmMouseX=e.pageX;csmMouseY=e.pageY;return document.csmMM?document.csmMM(e):document.routeEvent(e);};function isMouseIn(sty){with(sty)return((csmMouseX>left)&&(csmMouseX<left+clip.width)&&(csmMouseY>top)&&(csmMouseY<top+clip.height));};}