$(document).ready(
	function()
	{
		if($(".mydds").length>0){
			try {
				oHandler = $(".mydds").msDropDown().data("dd");
				oHandler.visible(true);
				//alert($.msDropDown.version);
				//$.msDropDown.create("body select");
				$("#ver").html($.msDropDown.version);
			} catch(e) {
			//	alert("Error: "+e.message);
			}	
			
			
			$(".ouvert").next("ul.liste-fleches").slideToggle("slow");
			
			$("span.accordion").click(function()
		    {	
				$(".ouvert").removeClass("ouvert");
				$(this).next("ul.liste-menu-contextuel").slideToggle(300).siblings("ul.liste-menu-contextuel").slideUp("slow");
				$(this).addClass("ouvert");
				return false;
		       	//$(this).siblings().css({backgroundImage:"url(left.png)"});
			});
			
			$('#rechercher').focus(function() {
				if($(this).val()=='Rechercher'){
					$(this).val('');
				}
			});
			
			$("#gotoMenu").click(function(){
				slideTo('#menu');
				return false;
			});
			
			$("#gotoContent").click(function(){
				slideTo('#content');
				return false;
			});	

		}
		
		// Gestion de l'envoi à un ami
		if($("#partage-email").length>0){
			$("#partage-email").fancybox({
				'width'		: 300,
				'height'	: 90,
				'type'		:'iframe'
			});
		}

});

function slideTo(cible){	
	var hauteur = $(cible).offset().top;
	$("html,body").animate({scrollTop : hauteur},{duration:1000,queue:false}); 
}
