document.observe("dom:loaded",function(){oMwJsMenu=new MwJsMenu()});var MwJsMenu=Class.create({opts:{showEffects:["Effect.Appear"],hideEffects:["Effect.Fade"],showEffectsOptions:{},hideEffectsOptions:{},parallelEffectOptions:{duration:0.3,delay:0},useClass:"ul.hmenu2"},initialize:function(a){this.opts=Object.extend(this.opts,a||{});$$(this.opts.useClass).each(function(b,c){b.writeAttribute({id:this.opts.useClass.gsub(/\w+\./,"")+"_"+c});b.up().observe("mouseover",function(d){this.show(b)}.bind(this));b.up().observe("mouseout",function(d){if(!d.relatedTarget.descendantOf(b)){this.hide(b)}}.bind(this))}.bind(this))},show:function(a){new Effect.Mixed(a,this.opts.showEffects,Object.extend(this.opts.showEffectsOptions||{},{afterSetup:function(){a.removeClassName("nodisplay")}.bind(this),}),this.opts.parallelEffectOptions)},hide:function(a){new Effect.Mixed(a,this.opts.hideEffects,Object.extend(this.opts.hideEffectsOptions||{},{afterFinish:function(){a.addClassName("nodisplay")}.bind(this)}),this.opts.parallelEffectOptions)}});Effect.Mixed=Class.create(Effect.Base,{initialize:function(ele,effects,opts,parallelopts){cEffects=effects.clone();cEffects.each(function(o,i){eval("cEffects[i] = new "+o+"(ele,Object.extend(opts||{},{sync:true}));")});new Effect.Parallel(cEffects,parallelopts||{})}});
