// navMenuBuilder
var navMenu={

init:function(openmen){
navMenu.topNav()
navMenu.sideNav(openmen)
navMenu.ie6()
//fine init
},
sideNav:function(openmen){
$$('div.side_nav').each(function(men){

men.getElements('li[class=sections]').each(function(li){

var ul=li.getElement('ul')
if(ul){//se c'è sottomenù

		var mySlider = new Fx.Slide(ul, {transition: Fx.Transitions.Cubic.easeOut,duration: 300});
		if(!ul.getElement('li[id=list_'+openmen+']')) mySlider.hide()
		li.getElement('a').addEvent('click',function(e){
			new Event(e).stop();
			mySlider.toggle()},this)

}
},this)
},this)
},
topNav:function(){
var szNormal = 200, szSmall  = 180, szFull   = 260;
 
	var kwicks = $$("#kwicks .kwick");
	var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
	kwicks.each(function(kwick, i) {
		kwick.addEvent("mouseenter", function(event) {
			var o = {};
			o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
			kwicks.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("width").toInt();
					if(w != szSmall) o[j] = {width: [w, szSmall]};
				}
			});
			fx.start(o);
		});
	});
 
	$("kwicks").addEvent("mouseleave", function(event) {
		var o = {};
		kwicks.each(function(kwick, i) {
			o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
		});
		fx.start(o);
	})
},



ie6:function(){
if (Browser.Engine.trident){
		$$('div.side_nav ul ul li').each(function(element) {
				element.addEvent('mouseenter', function(){
					this.addClass('sfhover');
				});
				element.addEvent('mouseleave', function(){
					this.removeClass('sfhover');
				});
});	
}
//fine ie6
}

//fine navMenu
}