// Script permettant de compter le nombre de checkbox cochées function count_checkbox(champ) { // On parcours toutes les chekbox pour compter celles cochées var tab_postes = 11; var cpt = 1; var compteur = 0; var nom_input =""; for(cpt;cpt<=tab_postes;cpt++) { nom_input = "#poste" + cpt; if($(nom_input).attr("checked")) compteur++; } if($('input[name="POSTE[99]"]').attr("checked")) compteur++; if(compteur > 2) $(champ).removeAttr('checked'); } // Script gestion des evenements dom du site // Script mis en place par Jérôme STACHOWIAK // Script Créé le 14/04/2009 // Script permettant de détacher la structure du code HTML au code javascript //On charge les evenements une fois le DOM de la page chargé $(document).ready( function() { // On charge le fichier de log // Bouton permettant la gestion des selects de la fonction de l'expérience ( CV ) $("#EXPERIENCE1_FONCTION").bind("change", function() { if($("#EXPERIENCE1_FONCTION").val() == "99") $("#bloc_experience1_autre").css("display","block"); else $("#bloc_experience1_autre").css("display","none"); }); $("#EXPERIENCE2_FONCTION").bind("change", function() { if($("#EXPERIENCE2_FONCTION").val() == "99") $("#bloc_experience2_autre").css("display","block"); else $("#bloc_experience2_autre").css("display","none"); }); // Action sur les champs d'identification login et mot de passe $("#identification_login").click(function() { $("#identification_login").attr("value",""); }); $("#identification_pass").click(function() { $("#identification_pass").attr("value",""); }); $("#identification_pass_false").click(function() { $("#identification_pass_false").css("display","none"); $("#identification_pass").css("display","block"); $("#identification_pass").focus(); }); $("#identification_pass_false").focus(function() { $("#identification_pass_false").css("display","none"); $("#identification_pass").css("display","block"); $("#identification_pass").focus(); }); $('input[name="POSTE[1]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[2]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[3]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[4]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[5]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[6]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[7]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[8]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[9]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[10]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[11]"]').click(function() { count_checkbox($(this)); }); $('input[name="POSTE[99]"]').click(function() { count_checkbox($(this)); }); $("#poste99").click(function() { if($("#poste99").is(':checked')) { $("#autre_poste").css("display","block"); } else { $("#autre_poste").css("display","none"); } }); if($("#bloc_relance").css("display","block")) { // Permet de centrer le pop-up des relances //$("html").css({ overflow: "hidden" }); if(document.getElementById("bloc_relance")!=null && document.getElementById("bloc_relance").offsetHeight > screen.height) { $("html").css({ height: document.getElementById("bloc_relance").offsetHeight }); $("body").css({ height: document.getElementById("bloc_relance").offsetHeight }); } $("#boite_relance").css({ top : (screen.height-(screen.height-screen.availHeight))/4 }); $("#bouton_fermer_fenetre").bind("mouseover", function() { $("#bouton_fermer_fenetre").css("cursor","pointer"); }); $("#bouton_fermer_fenetre").click(function() { $("#bloc_relance").css("display","none"); $("#boite_relance").css("display","none"); }); } // Icone pour afficher le détail des candidats $(".bouton_detail_resultat").css("display","none"); $("#bouton_detail_resultat").bind("mouseover", function() { $("#bouton_detail_resultat").css("cursor","pointer"); }); $("#bouton_detail_resultat").click(function() { if($(".bouton_detail_resultat").css("display") == "none") { $(".bouton_detail_resultat").css("display","block"); } else { $("#bouton_detail_resultat").attr("src","/images/recruteurs/detail_candidats_aff.gif"); $(".bouton_detail_resultat").css("display","none"); } }); // Action permettant de cocher ou tout decocher les inputs $("#tout_cocher").bind("mouseover", function() { $("#tout_cocher").css("cursor","pointer"); }); $("#tout_decocher").bind("mouseover", function() { $("#tout_decocher").css("cursor","pointer"); }); $("#tout_cocher").click(function() { $(":checkbox:enabled").each(function(){ $(this).attr("checked","checked"); }); }); $("#tout_decocher").click(function() { $(":checkbox:enabled").each(function(){ $(this).removeAttr("checked"); }); }); // Bonton pour retenir les candidats selectionnés $("#bouton_retenir_candidats").bind("mouseover", function() { $("#bouton_retenir_candidats").css("cursor","pointer"); }); $("#bouton_retenir_candidats").click(function() { $("#form1").submit(); }); } );