var MenuBar={opening:false,closing:false,intToClose:null,tweenY:0,mousePosition:0,init:function(){var c=$id("menubar_button");var a=$id("menubar_content");c.style.position=a.style.position="absolute";c.style.top=a.style.top="0px";c.style.left=a.style.left="0px";var b=coordinates.clientSize();a.onmousemove=function(){if(MenuBar.intToClose!=null){clearTimeout(MenuBar.intToClose)}MenuBar.intToClose=setTimeout("MenuBar.close();",600)};c.firstChild.onmouseover=function(){if(MenuBar.opening||MenuBar.closing){return}MenuBar.opening=true;MenuBar.tweenY=a.offsetHeight;a.style.visibility="visible";a.style.top=(coordinates.scrollOffset().y-MenuBar.tweenY)+"px";setTimeout('MenuBar.tween();$id("menubar_button").style.display = "none";',50);a.onmousemove()};events.register(document,"scroll",function(){var d=coordinates.scrollOffset();c.style.top=d.y+"px";a.style.top=(d.y-MenuBar.tweenY)+"px"});events.register(document,"resize",function(){var d=coordinates.clientSize()});events.register(document,"mousemove",function(d){MenuBar.mousePosition=coordinates.mousePosition(d)})},tween:function(){var a=$id("menubar_content");if(this.opening){this.tweenY/=2;if(this.tweenY<=1){this.tweenY=0;this.opening=false}else{setTimeout("MenuBar.tween();",60)}}else{if(this.closing){if(this.tweenY==0){this.tweenY=1}this.tweenY*=2;if(this.tweenY>=a.offsetHeight){this.tweenY=a.offsetHeight;a.style.visibility="hidden";this.closing=false}else{setTimeout("MenuBar.tween();",60)}}}a.style.top=(coordinates.scrollOffset().y-this.tweenY)+"px"},close:function(){if(this.closing){return}var a=$id("menubar_content");if(this.mousePosition.y<a.offsetHeight||this.opening){this.intToClose=setTimeout("MenuBar.close();",600);return}this.closing=true;this.intToClose=null;MenuBar.tween();$id("menubar_button").style.display="block"}};var ToolMan={events:function(){return ToolMan._eventsFactory},coordinates:function(){return ToolMan._coordinatesFactory}};ToolMan._eventsFactory={fix:function(a){if(!a){a=window.event}if(a.target){if(a.target.nodeType==3){a.target=a.target.parentNode}}else{if(a.srcElement){a.target=a.srcElement}}return a},register:function(d,b,c){if(b=="mousewheel"&&window.gecko){b="DOMMouseScroll"}if(d.addEventListener){d.addEventListener(b,c,false)}else{if(d.attachEvent){if(!d._listeners){d._listeners=new Array()}if(!d._listeners[b]){d._listeners[b]=new Array()}var a=function(){c.apply(d,new Array())};d._listeners[b][c]=a;d.attachEvent("on"+b,a)}}},unregister:function(c,a,b){if(a=="mousewheel"&&window.gecko){a="DOMMouseScroll"}if(c.removeEventListener){c.removeEventListener(a,b,false)}else{if(c.detachEvent){if(c._listeners&&c._listeners[a]&&c._listeners[a][b]){c.detachEvent("on"+a,c._listeners[a][b]);delete c._listeners[a][b]}}}},stop:function(a){if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}}};ToolMan._coordinatesFactory={create:function(a,b){return new _ToolManCoordinate(this,a,b)},scrollOffset:function(){if(window.pageXOffset){return this.create(window.pageXOffset,window.pageYOffset)}else{if(document.documentElement){return this.create(document.documentElement.scrollLeft,document.documentElement.scrollTop)}else{if(document.body.scrollLeft>=0){return this.create(document.body.scrollLeft,document.body.scrollTop)}else{return this.create(0,0)}}}},widthCharlie:function(){return"100%"},clientSize:function(){if(window.innerHeight>=0){return this.create(window.innerWidth,window.innerHeight)}else{if(document.documentElement){return this.create(document.documentElement.clientWidth,document.documentElement.clientHeight)}else{if(document.body.clientHeight>=0){return this.create(document.body.clientWidth,document.body.clientHeight)}else{return this.create(0,0)}}}},mousePosition:function(a){a=ToolMan.events().fix(a);return this.create(a.clientX,a.clientY)},_size:function(a){return this.create(a.offsetWidth,a.offsetHeight)},_offset:function(a){return this.create(a.offsetLeft,a.offsetTop)}};function _ToolManCoordinate(b,a,c){this.factory=b;this.x=isNaN(a)?0:a;this.y=isNaN(c)?0:c}_ToolManCoordinate.prototype={plus:function(a){return this.factory.create(this.x+a.x,this.y+a.y)}};function $id(a){return document.getElementById(a)}var coordinates=ToolMan.coordinates();var events=ToolMan.events();
