    $(document).ready(function() {
        var url =  document.location.href;
        if (url.match("#") != null) {
            var reg = new RegExp(".+fiche-produit\.jsp\?.+#(.*)&?dispo=.+&dispoCity=.+", "g");
            var parameters = url.replace(reg,"$1");
            if (parameters !== "") {
                jQuery("#productTitle").before("<a href='retour-moteur.jsp?" + parameters + "'>\u00BB Votre recherche</a>");
            }
        }
    });

    /**
    * Generic open popup.
    *
    * @param {class} popup,
    * @param {class} w, [optional] width popup number
    * @param {class} h, [optional] height popup number
    * @param {class} sb, [optional] scrollbars number 1(yes) or 0(no)
    * @use <a href="http:www.mylink.com" class="popup w750 h480 sb1">my link</a>
    */
    $("a.popup").click(function() {
        var classAttr = $(this).attr("class"),
            URL = $(this).attr("href"),
            options = "fullscreen=no",
            reg,
            popup;
        // set width parameter
        reg = /w([\d]+)/.exec(classAttr);
        if (reg && reg.length > 1) {
          options += ", width=" + reg[1];
        } else {
          options += ", width=800";
        }
        // set height parameter
        reg = /h([\d]+)/.exec(classAttr);
        if (reg && reg.length > 1) {
          options += ", height=" + reg[1];
        } else {
          options += ", height=600";
        }
        // set scrollbars parameter
        reg = /sb([\d]+)/.exec(classAttr);
        if (reg && reg.length > 1) {
          options += ", scrollbars=" + reg[1];
        } else {
          options += ", scrollbars=yes";
        }
        // call popup
        if (URL) {
          popup = window.open(URL, "popup", options);
          popup.window.focus();
        }
        return false;
    });

    $("p.buttonSubmit input").click(function() {
            var form = $(this).parents("form").get(0);
            $("img.loader").show();
            $("p.buttonSubmit input").hide();
            form.submit();
            return false;
        });

    jQuery(window).unload(function() {});


