var MenuStrip=Class.create({css:{linkContainer:"menuLinks",dropDownLink:"dropDownLink",dropDown:"dropDown"},html:{menu:null,linkContainer:null,links:null,dropDowns:null},initialize:function(b,a){this.html.menu=$(b);this.initElements();this.initEvents()},initElements:function(){this.html=Object.clone(this.html);this.html.linkContainer=this.html.menu.down("."+this.css.linkContainer);this.html.links=this.html.linkContainer.select("."+this.css.dropDownLink);this.html.dropDowns=this.html.menu.select("."+this.css.dropDown)},initEvents:function(){this.html.linkContainer.select("a").each(function(d){if(!d.hasClassName(this.css.dropDownLink)){Event.observe(d,"mouseenter",this.evLinkHover.bindAsEventListener(this))}}.bind(this));for(var b=0;b<this.html.links.length;++b){var c=this.html.links[b];var a=this.html.dropDowns[b];
Event.observe(a,"mouseenter",this.evShowDropDown.bindAsEventListener(this,a));Event.observe(a,"mouseleave",this.evHideDropDown.bindAsEventListener(this,a,true));Event.observe(c,"mouseenter",this.evLinkHover.bindAsEventListener(this,a));Event.observe(c,"mouseleave",this.evHideDropDown.bindAsEventListener(this,a,true))}},clearDropDownTimer:function(a){if(a.timer){clearTimeout(a.timer);a.timer=null}},showDropDown:function(a){this.clearDropDownTimer(a);a.show()},hideDropDown:function(a){this.clearDropDownTimer(a);a.hide()},hideAllDropDowns:function(){this.html.dropDowns.each(function(a){this.hideDropDown(a)}.bind(this))},evShowDropDown:function(b,a){this.showDropDown(a)},evHideDropDown:function(b,a,c){this.clearDropDownTimer(a);if(c){a.timer=setTimeout(this.hideDropDown.bind(this,a),500)}else{this.hideDropDown(a)
}},evLinkHover:function(b,a){this.hideAllDropDowns();if(a){this.showDropDown(a)}}});
