Wg = {
	MINH:5,MAXH:51,
	start:function(){
		Wg.menu = $$('div#visnav div');
		Wg.activateMenu(Wg.menu);	
	},
	
	activateMenu:function(menu){
		var fx = new Fx.Elements(menu, {wait:false,duration:200,
			transition:Fx.Transitions.sineInOut,
			onStart:function(){
				Wg.deactivateMenu(Wg.active);
			},
			onComplete:function(){
				Wg.deactivate = "";
			}
			});
		
		menu.each(function(mitem,i){
			mitem.addEvent('mouseover',function(ev){
				Wg.active = this.id;
				ev = new Event(ev).stop();
				if(this.getStyle('height').toInt()==51||
				this.id == Wg.deactivate) return;
				//console.log(this.getStyle('height'));
				var obj = {};
				obj[i] = {'height':[Wg.MINH,Wg.MAXH]};
				menu.each(function(other,j){
					if(other!=mitem){
						var h = other.getStyle('height').toInt();
						if(h>Wg.MINH)obj[j]={'height':[h,Wg.MINH]};
					}
				});
				fx.start(obj);
					
			});
		});
	},
	
	deactivateMenu:function(menuItem){
		Wg.deactivate = menuItem;
	}



}

window.addEvent('domready',Wg.start);
