$(document).ready(function(){
        
	// Affichage du menu
  	MENU_Gestion('horizontal');

    // Masquer les champs anti-spam
    if($('p.robot').length) {
        $('p.robot').hide();
    }    
    
    // Affichage des recrutements
    if($('body#recrutement').length) {
        $('div.item').hide();
        
        var url = window.location.href; 
        var ancre = url.split('#');
        if(ancre.length == 2) {
            element = ancre[1];
        }
        $('div.item').hide();
        $('div#'+element).find('.item').show();
        
        var i = 0;
        $('.poste h3').each( function () {
            $(this).append(' - <a href="#" id="linkPoste'+i+'" title="Lire l\'annonce '+$(this).text()+'">Lire l\'annonce</a>');
            var poste = $(this).parent('.poste').attr('id');
            $('#linkPoste'+i).addClass(poste).attr('href', '#'+poste);
            i++;
        });

        $('.poste h3 a').click(function () {
            if ($('div#'+this.className).find('.item').is(':hidden')) {
                $('div#'+this.className).find('.item').slideDown('normal');
                return false;
            } else {
                $('div#'+this.className).find('.item').slideUp('normal');
                return false;
            }
        });
    }
        
    // Affichage des solutions
    if($('div#elementSolutions').length) {
        var url = window.location.href; 
        var ancre = url.split('#');
        var element = 'element1';
        if(ancre.length == 2) {
            element = ancre[1];
        }
        $('div.elements').not('div#'+element).hide();
        $('a.'+element).addClass('solutionActive');
        
        $('ul.elementSolutions1 li a').click(function () {
            if ($('div#'+this.className).is(':hidden')) {
                $('div.elements').slideUp('normal');
                $('ul.elementSolutions1 li a.solutionActive').removeClass('solutionActive'); 
                $('div#'+this.className).slideDown('normal');
                $(this).addClass('solutionActive'); 
                return false;
            }
        });
        
        $('div.elementSolutions2 a.action').click(function () {
            $('div.elements').slideUp('normal');
            $('ul.elementSolutions1 li a.solutionActive').removeClass('solutionActive'); 
            var element = $(this).attr('href');
            element = element.replace('#','');
            $('div#'+element).slideDown('normal');
            $('ul.elementSolutions1 a.'+element).addClass('solutionActive'); 
            return false;
        });
    }

});