$(document).ready(function() {
		$(".btn-slide").click(function(){
	   		$("#panel").slideToggle("100");
	   		$(this).toggleClass("active"); return false;
		});
		$('#RCcycle').cycle({
			fx: 'fade'
		});
		$(".formz").fancybox({
						'width'				: 650,
						'height'			: 650,
						'scrolling'			: 'no',
				        'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$(".infoleg").fancybox({
						'width'				: 650,
						'height'			: 650,
						'autoScale'     	: false,
				        'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$(".contacts").fancybox({
						'width'				: 650,
						'height'			: 450,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$("a.zoom").fancybox();
		
					$("a.zoom1").fancybox({
						'overlayOpacity'	:	0.7,
						'overlayColor'		:	'#FFF'
					});
		
					$("a.zoom2").fancybox({
						'zoomSpeedIn'		:	500,
						'zoomSpeedOut'		:	500
					});
		$("#chained").scrollable({size: 2, hoverClass: 'hover'}).circular().navigator().autoscroll({steps: 2, interval: 3000}); 
		$(".tipTip").tipTip({maxWidth: "120px", edgeOffset: 1, delay: 100});
		var msie6 = $.browser == 'msie' && $.browser.version < 7;
		
		if (!msie6) {
		  var top = $('#sidemenu').offset().top - parseFloat($('#sidemenu').css('margin-top').replace(/auto/, 0));
		  $(window).scroll(function (event) {
		    // what the y position of the scroll is
		    var y = $(this).scrollTop();
		    
		    // whether that's below the form
		    if (y >= top) {
		      // if so, ad the fixed class
		      $('#sidemenu').addClass('fixed');
		    } else {
		      // otherwise remove it
		      $('#sidemenu').removeClass('fixed');
		    }
		  });
		}
	});
animatedcollapse.addDiv('RCmenu', 'fade=1,speed=500,hide=0,group=00')
animatedcollapse.addDiv('CDC', 'fade=1,speed=500,hide=1,group=RC')
animatedcollapse.addDiv('APT', 'fade=1,speed=500,group=RC')
animatedcollapse.addDiv('SRV', 'fade=1,speed=500,group=RC')
animatedcollapse.addDiv('T1', 'fade=1,speed=500,group=4T')
animatedcollapse.addDiv('T2', 'fade=1,speed=500,group=4T')
animatedcollapse.addDiv('T3', 'fade=1,speed=500,group=4T')
animatedcollapse.addDiv('T4', 'fade=1,speed=500,group=4T')
animatedcollapse.addDiv('T5', 'fade=1,speed=500,group=4T')
animatedcollapse.addDiv('prezzi', 'fade=1,speed=500,hide=1')
animatedcollapse.init()