﻿//<![CDATA[
// => au chargement de la page, on appelle initEvenements
jQuery(document).ready(initEvenements);

function initEvenements(event) {
    jQuery("div#recapitulatif-recherche-offre").show();
    
    if (jQuery('input#typecontrat').val() != '') {
        jQuery("li#recapitulatif-recherche-type").show();
        jQuery("span#recapitulatif-recherche-type-valeur").html(jQuery('input#typecontrat').val());
    }
    else { jQuery("li#recapitulatif-recherche-type").hide();}
    
    if (jQuery('input#filiere').val() != '') {
        jQuery("li#recapitulatif-recherche-filiere").show();
        jQuery("span#recapitulatif-recherche-filiere-valeur").html(jQuery('input#filiere').val());
    }
    else { jQuery("li#recapitulatif-recherche-filiere").hide();}
    
    if (jQuery('input#region').val() != '') {
        jQuery("li#recapitulatif-recherche-region").show();
        jQuery("span#recapitulatif-recherche-region-valeur").html(jQuery('input#region').val());
    }
    else { jQuery("li#recapitulatif-recherche-region").hide();}
    
    jQuery("a#recapitulatif-recherche-href").attr("href", jQuery('input#lienhref').val());
    
    if (jQuery('input#typecontrat').val() != '' 
        | jQuery('input#filiere').val() != ''
        | jQuery('input#region').val() != ''){
        
        if (jQuery('input#lienhrefresultat').val() != '' && jQuery('input#pagedetail').val() == "1") {
            jQuery("a#retour-recherche-href").attr("href", jQuery('input#lienhrefresultat').val());
            jQuery("a#retour-recherche-href-bis").attr("href", jQuery('input#lienhrefresultat').val());
            jQuery("a#retour-recherche-href-tiere").attr("href", jQuery('input#lienhrefresultat').val());
        }
        else { 
            jQuery("li#retour-liste").hide();
        }
    }
    else {
        if (jQuery('input#pagedetail').val() == "1") {
            jQuery("a#retour-recherche-href").attr("href", "javascript:history.go(-1)");
            jQuery("a#retour-recherche-href-bis").attr("href", "javascript:history.go(-1)");
            jQuery("a#retour-recherche-href-tiere").attr("href", "javascript:history.go(-1)");
        }
    }
}
//]]>
