$(document).ready(function() {
	// Menu principal	$("#menu ul li").hover(function(){
		$(this).find("ul").slideDown();
	}, 
		function () {
			$(this).find("ul").hide();
		}
	);		// Menu secondaire	$('.nav-prog li span.bg').hover(function() {	    $(this).stop().animate({ 'paddingLeft':'10px' }, 100);	}, function() {	    $(this).stop().animate({	        'paddingLeft':'0px'	      }, 300, 'linear');	});    		// Lien impression	$('.lnk-print').click(function() {		window.print();	  	return false;	});

	// Images en surimpression
	$("a[rel='lightbox']").fancybox();		// Formulaire d'envoi a un ami	$("a[rel='formbox']").fancybox({		'titleShow': false,		'height': 550,		'width': 400	});
		// Diaporama accueil	$('#diapo-home').cycle({		fx: 'fade'	});

	// Tabs
	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();
		var activeTab = $(this).find("a").attr("href");
		$(activeTab).show();
		return false;
	});
	
	// Default value for inputs fields
	$("input.text").each(function() {
		var searchInput = $(this);
		var defaultValue = searchInput.attr('value');
		searchInput.focus( function() {
			if ($(this).val() == defaultValue) {
				$(this).attr('value','');
			}
		}).blur( function() {
			if ($(this).val() == '') {
				$(this).attr('value',defaultValue);
			} 
		});
	});
	
	// Scroll to top
	$('#return-top').click(function(){
	    $('html,body').animate({scrollTop:0}, 'slow');
	    return false;
	});		// Adjust box height to the highest	function mySameHeight(elt) {		var heightBlockMax=0;		var propertie = (jQuery.support.opacity) ? "min-height" : "height";	    $(elt).each(function(){ 	        var height = $(this).height(); 	        if( height > heightBlockMax ) { 	            heightBlockMax = height; 	        }	    });	    $(elt).css(propertie, heightBlockMax);	};	mySameHeight(".topbox > div");		// Rollover	function imgRollover(elt) {		jQuery(elt).live('mouseover', function(e){			jQuery(this).attr("src", jQuery(this).attr("src").replace("-off","-on")); // Sous réserve que vous ayiez nommées vos images en xxx-off.png (ou .gif, .jpg, etc) et xxx-on.png (etc)		}).live('mouseout', function(e){			jQuery(this).attr("src", jQuery(this).attr("src").replace("-on","-off"));		});	}	imgRollover('.brochure');	
});
