$(function(){

	$('.menugauche ul li a').click(function(){
		$(".menugauche ul li ul").hide();
		$(this).parent().children("ul").slideDown(500);		
	});	
	
	//affiche les sous menus photos lorsqu'on visite une des pages photos
	//$('.menugauche ul li.current-menu-parent, .menugauche ul li.current-menu-item, .menugauche ul li.current-menu-ancestor').children("ul").show();

	$(".menugauche ul li ul li").hover(
	  function () {			
		$(this).find("ul").stop(true, true).slideDown(500);	
	  }, 
	  function () {		 
		$(this).find("ul").stop(true, true).slideUp(500);
	  }
	);	
	
	
	$(".menugauche ul li:not(.current-menu-item, .current-menu-parent, .current-menu-ancestor) a, .menudroite ul li:not(.current-menu-item, .current-menu-parent, .current-menu-ancestor) a, .menugauche ul li ul li:not(.current-menu-item, .current-menu-parent, .current-menu-ancestor) a, .menudroite ul li ul li:not(.current-menu-item, .current-menu-parent, .current-menu-ancestor) a").hover(
	  function () {		
		$(this).animate({opacity: 1}, {duration:500, queue:false});	
	  }, 
	  function () {		 
		$(this).animate({opacity: 0.5}, {duration:500, queue:false});
	  }
	);
	
	var EspaceClientAffiche = false;
	$('.espaceclient a').click(function(){
		if(EspaceClientAffiche == false){
			$(".protected-client-form").css({"z-index":"999"});
			$(".protected-client-form").animate({opacity:1},{duration:500,queue:false});
			$(".protected-post-form").animate({opacity:0},{duration:500,queue:false, complete:function(){
				EspaceClientAffiche = true;
			}});
		}else{			
			$(".protected-client-form").animate({opacity:0},{duration:500,queue:false});
			$(".protected-post-form").animate({opacity:1},{duration:500,queue:false, complete:function(){
				$(".protected-client-form").css({"z-index":"-999"});
				EspaceClientAffiche = false;
			}});
			
		}
	});

});
