//Affichage de l'arborescence

jQuery(document).ready(function() {
	
	try{
		if (id_recrutement != undefined){
			disp_formulaire(jQuery("#open_postuler_"+id_recrutement));
		}
	}
	catch(e){
	
	}
	
	jQuery("A[id^='open_postuler']").click(function (){
		disp_formulaire(jQuery(this));
        return false;
	});
	
	jQuery('#close_postuler').click(function (){
        jQuery.unblockUI(); 
	});	
});

function disp_formulaire(element_courant){
	jQuery('#id_offre').attr('value',element_courant.attr('href'));
	if(jQuery('#title_'+element_courant.attr('href')).html() != null){
		jQuery('#titre_form').html(jQuery('#title_'+element_courant.attr('href')).html());
	}
	else{
		jQuery('#titre_form').html("");
	}
    jQuery.blockUI({ css: { 
    					width: '975px',
    	                top:  ((jQuery(window).height() - 500) /2)-100 + 'px', 
    	                left: ((jQuery(window).width() - 500) /2)-240 + 'px', 
        			 	border: 'none'
        			 },
        			 overlayCSS:  { 
        			        backgroundColor: '#1c273c', 
        			        opacity: 0.7 
        			    },
        			 message: jQuery('#form_recrutement') 
        		});
}
