$(document).ready(function(){

	$(".indent1").hide();
	$(".indent2").hide();
	$(".indent1:has(.actifIndent1)").show();
	$(".indent2:has(.actifIndent2)").show();
	$(".sousMenu").click(function (){
		blnRetour = true;
		var strSelecteur = $(this).attr("class");
		strSelecteur = strSelecteur.substring(strSelecteur.indexOf("menu"));
		var strSelecteurUl = "ul." + strSelecteur;
		var strSelecteurImg = "img." + strSelecteur;
      		if ($(strSelecteurUl).css("display") == "none"){
      			$(strSelecteurUl).slideDown("normal");
      			$(strSelecteurImg).attr("src","fileadmin/cierl/gabarit/images/principale/flecheBas.gif");
      			$(strSelecteurImg).attr("alt","Réduire");
		} else{
			$(strSelecteurUl).slideUp("normal");
		      	$(strSelecteurImg).attr("src","fileadmin/cierl/gabarit/images/principale/flecheCote.gif");
      			$(strSelecteurImg).attr("alt","Développer");
		}
		return false;
	});
	
  	$(	'a.external-link-new-window,' +
		'a.internal-link-new-window,' + 
		'a.internal-file-new-window'
			).click(function(){
	   			window.open(this.href);
	    		return false;
         });
        
        $('#divContenu img').each(function() {
        
            // Récupération du title de l'image
            var titleAttribut = $(this).attr("title");
             
            if($(this).attr("title") != "") {
                // Ajout d'un DIV autour de l'image pour pouvoir y associer un texte de crédit en dessous
                $(this).wrap('<div />');            
                //$(this).after('<p class="creditImage">'+ titleAttribut + '</p>');
                $(this).after('<p class="creditImage" style="width:'+ $(this).attr("width") +'px;">'+ titleAttribut + '</p>');

                
                 // Récupération de la classe de l'image
                if($(this).attr("class") != "") {
                    
                    $(this).parent().attr("class", $(this).attr("class"));
                    $(this).removeAttr("class");
                    
                }
            
            }
        });
            
});

$(function() {
	$('.declencheur').hover(
		function() { $(this).next('.bulle').css({ display: 'block' }); },
		function() { $(this).next('.bulle').css({ display: 'none' }); }
	);
	
	$('.declencheur').mousemove(function(e) {
		var mousex = e.pageX+20;
		var mousey = e.pageY+20;
		$(this).next('.bulle').css({  top: mousey, left: mousex });
		});
	});
