';html+='';$('#live-search ul').html(html);$('#live-search').css('display','block');} var filter_name=$(live_search.selector+' input[type=\'text\']').val();clearTimeout(timer);timer=setTimeout(function(){if(filter_name.length>0){$.ajax({url:'index.php?route=product/live_search&filter_name='+filter_name,dataType:'json',beforeSend:function(){if(filter_name.length<3)return false;},success:function(result){var products=result.products;$('#live-search ul li').remove();$('.result-text').html('');if(!$.isEmptyObject(products)){var show_price=1;var show_description=1;$('.result-text').html('Всего найдено товаров ('+result.total+')');$.each(products,function(index,product){var html='';html+='
';html+='';html+=''+product.name+'
'+product.extra_info+'
';if(show_price){html+=''+product.price+'
';} html+='';$('#live-search ul').append(html);});$('#live-search ul li').css('height',live_search.height);$('#live-search').css('display','block');}else{$('#live-search').css('display','none');} return false;}});}},live_search.delay);},select:function(product){$('input[name=\'search\']').val(product.name);},});$(document).bind("mouseup touchend",function(e){var container=$('#live-search');if(!container.is(e.target)&&container.has(e.target).length===0)container.hide();});}); Модели PEUGEOT