jQuery.noConflict();
jQuery(document).ready(function(){
    //gestion champ vide recherche
    if(jQuery("#btn_search")) {
        jQuery("#btn_search").focusin(function(){
            if(this.getAttribute("rel") == this.value)
                this.value = "";
        });
        jQuery("#btn_search").focusout(function(){
            if(this.value == "")
                this.value = this.getAttribute("rel");
        });
    }

    if(jQuery("#search_by")) {
        function redirectList(evt) {
            if(evt.target.value == "" || evt.target.value == "0")
                return;
            window.location.href = evt.target.value;
        }

        if(jQuery("#product_name"))
            jQuery("#product_name").bind("change",redirectList);

        if(jQuery("#product_reference"))
            jQuery("#product_reference").bind("change",redirectList);

    }
});

