// GK MooMenu v.2.2 Copyright by GavickPro
window.addEvent("domready", function(){
	// necessary classes
				Fx.Opacity = Fx.Style.extend({initialize: function(el, options){this.now = 1;this.parent(el, 'opacity', options);},toggle: function(){return (this.now > 0) ? this.start(1, 0) : this.start(0, 1);},show: function(){return this.set(1);}});
	
	var main = $("horiz-menu");
	var levels = new Array();
	var opacityFX = new Array();			if(main){
		main.getChildren().each(function(el,i){
			levels.push(new Array());
			opacityFX.push(new Array());									
			el.getElementsBySelector("ul").each(function(elm,j){
				levels[i].push(elm.getParent());
				opacityFX[i].push(new Fx.Opacity(elm, {duration: 180, transition: Fx.Transitions.linear,wait:true}).set(0));											});
		});
		
		levels.each(function(e,k){
			e.each(function(a,l){
				a.addEvents({
					"mouseenter" : function(){
						a.getChildren()[1].setStyle("overflow","hidden");
						if(window.ie7 && (a.getChildren()[1].getParent() && a.getChildren()[1].getParent().getParent() && a.getChildren()[1].getParent().getParent().getParent() && a.getChildren()[1].getParent().getParent().getParent().hasClass("level1")) && a.getChildren()[1].getStyle("position") != 'absolute') a.getChildren()[1].setStyle("margin-top","35px");
						a.getChildren()[1].setStyle("position","absolute");
						opacityFX[k][l].toggle();																		(function(){a.getChildren()[1].setStyle("overflow","")}).delay(180);
					},
					"mouseleave" : function(){
						a.getChildren()[1].setStyle("overflow","hidden");
						opacityFX[k][l].stop().set(0);																	}
				});
			});
		});	
	}
});