jQuery(document).ready(function(){var n,e,s,r,u=0;const t=cb_options.search_engine||"gnoss";function a(e,s=!0){var r;"gnoss"===t&&(r="prod"==cb_options.env?"https://serviciosinfobbva.gnoss.com/servicioexterno/Busqueda/Autocompletar":"https://preserviciosinfobbva.gnoss.com/servicioexterno/Busqueda/Autocompletar",jQuery.ajax({async:s,url:r,type:"GET",dataType:"json",data:{pBusqueda:n,pIdioma:cb_options.language,pPagina:"BBVA"},success:e,error:function(e,s){console.log("Última petición sin respuesta")}}))}function o(e,s,r){n=e.val(),s.submit(function(e){e.preventDefault(),enviarSearchHuella(n,u,""),"gnoss"!==t&&(e="/es/buscador/?s="+n,"en"==cb_options.language&&(e="/en/search/?s="+n),window.open(e,"_self"))}),e.keypress(function(e){2<=(n=jQuery(this).val()).length&&13===e.which&&a(function(e){window.open(e.url,"_self")},!1)}),r.click(function(e){"gnoss"!==t?s.submit():2<=n.length&&a(function(e){window.open(e.url,"_self")},!1)}),e.keyup(function(e){var s=(n=jQuery(this).val()).length,o=n;2<=s?a(function(e){var s=e.url.replace(e.urlBase,"");if(o===s){if(n===jQuery("#what").val()){jQuery(".resultSearch404").remove();for(var r=0;r<5;r++)jQuery(".wrapper-search .rtdosBusq_listaMostrados").append('
  • '+e.results[r].text+"
  • "),e.results[r].text.replace(e.results[r].text,jQuery(".link-result").highlight(o).html());jQuery(".wrapper-search .form_buscador_rtdos").css({display:"block"})}if(n===jQuery("#tags").val()){jQuery(".results-search").remove(),u=e.results.length;for(r=0;r'+e.results[r].text+""),e.results[r].text.replace(e.results[r].text,jQuery(".link-result").highlight(o).html())}jQuery(".icon-nav_close").on("click",function(){jQuery(".results-search").remove()})}}}):0==s?jQuery(".wrapper-search .form_buscador_rtdos").css({display:"none"}):jQuery(".rtdosBusq_listaMostrados li").remove()})}"gnoss"!==t&&(jQuery(".form_buscador_rtdos").remove(),jQuery(".rtdosBusq_listaMostrados").empty()),e=jQuery("#tags"),s=jQuery("#search-formulario"),r=jQuery(".form_buscador_enter"),e.length&&o(e,s,r),e=jQuery("#what"),s=jQuery("#search-page-error"),r=jQuery(".form-search-enter"),e.length&&o(e,s,r),jQuery('.componente_404 input[name="what"]').blur(function(e){""!==jQuery(this).val()?jQuery(this).siblings("label").css({top:"10px",color:"#666666","font-size":"12px","padding-right":"45px"}):jQuery(this).siblings("label").css({top:"16px",color:"#121212","font-size":"16px","padding-right":"0px"})}),jQuery('.componente_404 input[name="what"]').focus(function(e){jQuery(this).siblings("label").css({top:"10px",color:"#666666","font-size":"12px","padding-right":"45px"})})});