$(document).ready(function(){
   // Global
	$("#distri").css("display","none");
	$(".pays").css("display","none");
	$("#distri").hide();
   
   
   // Distributors slide
	$("#distributeurs").click(function(){
		if ($("#distri").is(":hidden")) {
			$("#distri").slideDown("slow");
			$(this).addClass("active");
			return false;
		}else {
			$("#distri").slideUp("slow");
			$(this).removeClass("active");
			return false;
		}
	});
	
	// Show/hide distributors
	function p(obj) {var el = document.getElementById(obj);if(el.style.display != "block"){el.style.display = "block";}else{el.style.display = "none";}}
	$("#pays a").click(function(){
		$(".pays").hide();
		p($(this).attr("class"));
	});
	
	
   // Anchor links
	$("a[href*=#]").click(function() {
		if (location.pathname.replace(/^\//,") == this.pathname.replace(/^\//,") && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $("[name=' + this.hash.slice(1) +']");
			if ($target.length) { var targetOffset = $target.offset().top; $("html,body").animate({scrollTop: targetOffset}, 1000); return false; }
		}
	});
});