$(document).ready(function() {
		//spheric 360 target blank
		$("li.menu-item-985 a").attr("target","_blank");
		
		// POP UP			
			$('a[name=modal]').click(function(e) {				
				e.preventDefault();			
				
				var id = $(this).attr('href');		
				
				var maskHeight = $(document).height();
				var maskWidth = $(window).width();			
				
				$('#mask').css({'width':maskWidth,'height':maskHeight});
				$('#mask').fadeIn(1000);	
				$('#mask').fadeTo("slow",0.8);			
				
				var winH = $(window).height();
				var winW = $(window).width();					  
				
				$(id).css('top',  winH/2-$(id).height()/2);
				$(id).css('left', winW/2-$(id).width()/2);			
				
				$(id).fadeIn(2000); 
			});
			
			//close button
			$('.window .close').click(function (e) {
				e.preventDefault();
				$('#mask').hide();
				$('.window').hide();
			});		
			
			//mask clicked
			$('#mask').click(function () {
				$(this).hide();
				$('.window').hide();
			});	
		
			  
		//classe active pour les menus 			
		var page = $('#page_titre').text();
		
		if (page != 'undefined') {
			if ( page === "Agence") { 
					$(".menu li a").removeClass("active");
					$("#menu2").addClass("active");
				}
				
			if ( page === "Savoir-faire") { 
					$(".menu li a").removeClass("active");
					$("#menu3").addClass("active");			
				}
				
			if ( page === "Accueil") { 
					$(".menu li a").removeClass("active");
					$("#menu1").addClass("active");			
				}
		} 
		
		else{
			$(".menu li a").removeClass("active");
		}
	

		// cache Zoom sur 
		 if ($(".breadcrumb .niveau2_bis a").html()!= null){	
			x = $(".breadcrumb .niveau2_bis a").html().replace(/Zoom sur.../,"");
			$(".breadcrumb .niveau2_bis a").html(x);
		 }
		 
		 if ($(".breadcrumb .niveau2 a").html()!= null){
			y = $(".breadcrumb .niveau2 a").html().replace(/Zoom sur.../,"");
			$(".breadcrumb .niveau2 a").html(y);
		 }
		 
		  if ($(".breadcrumb .niveau2 a").html() == ""){
		  $(".breadcrumb .niveau2 a").hide();
		  $(".breadcrumb .fleche_2").hide();
		 } 
		
		$('.cat-links a').each(function(index){
			$(this).attr('href','');
			category = $(this).html();
			if(category == 'Zoom sur...'){
				$(this).hide();
			}
			
			if(category == 'Slides'){
				$(this).parents('.post').hide();
			}
		})
		
 
 
 });
 
	function affiche(){
		document.getElementById("blocmentions").style.display = "block";
	}
	
	function fermer(){
		document.getElementById("blocmentions").style.display = "none";
	}

