$(document).ready(function(){
	
	var jourActif = 1;
	
	$('#onglets > li').click(function(){
		
		var tabJ = $(this).attr('id').split('_');
									  
		if(tabJ[1] != jourActif){
			$('#detail_date_'+jourActif).stop(true,true).hide();
			
			$('#date_'+jourActif).removeClass("active");							  
			$(this).addClass("active");
			
			$('#detail_date_'+jourActif).fadeOut("fast", function(){
				$('#detail_date_'+tabJ[1]).fadeIn("normal");
			});
		}
		jourActif = tabJ[1];
	}, function(){
		//
	});
	
	//onglets page detail lei lei_details map_canvas
	var ongletActif = 1;
	
	$('#ongletDet > li').click(function(){
		
		var tabJ = $(this).attr('id').split('_');
									  
		if(tabJ[1] != ongletActif){
			$('#lei_details_'+ongletActif).stop(true,true).hide();
			
			$('#ong_'+ongletActif).removeClass("active");							  
			$(this).addClass("active");
			
			$('#lei_details_'+ongletActif).fadeOut("fast", function(){
				$('#lei_details_'+tabJ[1]).removeClass('masque');
				$('#lei_details_'+tabJ[1]).fadeIn("normal");
			});
		}
		ongletActif = tabJ[1];
	}, function(){
		//
	});
	

	//galleries photo
	$("a.prettyPhoto").prettyPhoto({animation_speed:'normal',theme:'dark_rounded',slideshow:3000, autoplay_slideshow: false});
	$("area.prettyPhoto").prettyPhoto({animation_speed:'normal',theme:'dark_rounded',slideshow:3000, autoplay_slideshow: false});
	
	//clignotage du bloc contact quand on passe sur l'office 
	$('#lienOffice').hover(function(){
		$('#bloc_contact address').animate({
			backgroundColor: '#4582B9',
			color: '#fff'
			
		  }, {
			duration: 200,
			specialEasing: {
			  width: 'linear',
			  height: 'easeOutBounce'
			}
		  }
		);				
									
		//$('#bloc_contact address').css('background', '#4582B9');
		//$('#bloc_contact address').css('color', '#fff');
	}, function(){
		$('#bloc_contact address').stop(true, true);
		$('#bloc_contact address').css('background', '#fff');
		$('#bloc_contact address').css('color', '#333');
	});
	
	
	
});


