 $(function() {
				/**
				* for each menu element, on mouseenter,
				* we enlarge the image, and show both sdt_active span and
				* sdt_wrap span. If the element has a sub menu (sdt_box),
				* then we slide it - if the element is the last one in the menu
				* we slide it to the left, otherwise to the right
				*/
                $('#sdt_menu > li').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'170px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'85px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active')
					     .stop(true)
						 .animate({'height':'170px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left},200);
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},500);
				});


            //PALESTRA
            $('.menuPalestra').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'170px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'85px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active_pal')
					     .stop(true)
						 .animate({'height':'170px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box_pal');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left},200);
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box_pal');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active_pal')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},500);
				});

            //RIABILITAZIONE
            $('.menuRiabilitazione').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'170px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'85px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active_ri')
					     .stop(true)
						 .animate({'height':'125px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box_ri');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left},200);
							$elem.find('.sdt_active_ri').addClass('menuRiabilitazione');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box_ri');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active_ri')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},500);
				});
				//Centri Estivi
				$('.menuCentriEstivi').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'170px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'85px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active_ce')
					     .stop(true)
						 .animate({'height':'225px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box_ce');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left},200);
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box_ce');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');
					$elem.find('.sdt_active_ce')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},500);
				});
				//Associazioni Agonisti
				$('.menuAssociazioni').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'170px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'85px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active_aa')
					     .stop(true)
						 .animate({'height':'225px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box_aa');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left},200);
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box_aa');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active_aa')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},500);
				});
            }); //chiusura function

            $(function() {
				/**
				* for each menu element, on mouseenter,
				* we enlarge the image, and show both sdt_active span and
				* sdt_wrap span. If the element has a sub menu (sdt_box),
				* then we slide it - if the element is the last one in the menu
				* we slide it to the left, otherwise to the right
				*/
                $('#sdt_menu > li').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'145px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap2')
					     .stop(true)
						 .animate({'top':'210px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active2')
					     .stop(true)
						 .animate({'height':'120px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box2');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left,'height':'105px'},200);
							$elem.find('.sdt_active2').addClass('menuPiscina');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box2');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active2')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap2')
						 .stop(true)
						 .animate({'top':'45px'},500);
				});
				//PALESTRA
				$('.menuPalestra').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'145px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap2_pal')
					     .stop(true)
						 .animate({'top':'220px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active2_pal')
					     .stop(true)
						 .animate({'height':'120px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box2_pal');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left,'height':'105px'},200);
							$elem.find('.sdt_active2_pal').addClass('menuPalestra');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box2_pal');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active2_pal')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap2_pal')
						 .stop(true)
						 .animate({'top':'45px'},500);
				});
				//RIABILITAZIONE
				$('.menuRiabilitazione').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'145px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap2')
					     .stop(true)
						 .animate({'top':'210px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active2_ri')
					     .stop(true)
						 .animate({'height':'120px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box2_ri');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left,'height':'105px'},200);
							$elem.find('.sdt_active2_ri').addClass('menuRiabilitazione');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box2_ri');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active2_ri')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap2')
						 .stop(true)
						 .animate({'top':'45px'},500);
				});


				//CentriESTIVI
				$('.menuCentriEstivi').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'145px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap2_ce')
					     .stop(true)
						 .animate({'top':'220px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active2_ce')
					     .stop(true)
						 .animate({'height':'120px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box2_ce');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left,'height':'105px'},200);
							$elem.find('.sdt_active2_pal').addClass('menuPalestra');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box2_ce');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active2_ce')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap2')
						 .stop(true)
						 .animate({'top':'45px'},500);
				});
				//AGONISMO
				$('.menuAssociazioni').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'200px',
							'height':'145px',
							'left':'0px'
						 },400,'easeOutBack')
						 .andSelf()
						 .find('.sdt_wrap2')
					     .stop(true)
						 .animate({'top':'210px'},500,'easeOutBack')
						 .andSelf()
						 .find('.sdt_active2_aa')
					     .stop(true)
						 .animate({'height':'120px'},300,function(){
						var $sub_menu = $elem.find('.sdt_box2_aa');
						if($sub_menu.length){
							var left = '200px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-200px';
							$sub_menu.show().animate({'left':left,'height':'105px'},200);
							$elem.find('.sdt_active2_pal').addClass('menuPalestra');
						}
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sub_menu = $elem.find('.sdt_box2_aa');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');

					$elem.find('.sdt_active2_aa')
						 .stop(true)
						 .animate({'height':'0px'},300)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap2_aa')
						 .stop(true)
						 .animate({'top':'45px'},500);
				});




            });
