function liFormat (row, i, num) { var result = ''+row[2]+''+row[0]+''+ row[1] +'
'+row[3]+''; return result; } function selectItem(li) { if( !!li.extra ) var sValue = li.extra[1]; else var sValue = li.selectValue; window.location = li.extra[3]; } $( document ).ready(function(){ $("#searchstring").autocomplete("/published/SC/html/scripts/prompt/new_search.php", { delay:10, minChars:2, matchSubset:1, autoFill:false, matchContains:1, cacheLength:1, selectFirst:true, formatItem:liFormat, maxItemsToShow:15, onItemSelect:selectItem, extraParams :{lang : "ru", curr: 3 } }); });