function geoLiFormat (row, i, num) {
  var result = "<strong class='geoCity'>" + row[0] + "</strong>, " + "<em class='geoRegion'>" + row[1] + "</em>, " + "<span class='geoCountry'>" + row[2] + "</span>";
  return result;
}
function geoSelectItem(li) {
  if( li == null ) var sValue = "Ничего не выбрано!";
  else var sValue = li.selectValue;
}
mainInitFunction = function(){
  geoJson = jQuery("input#city");
  if(geoJson.length){
      jQuery(geoJson).autocomplete("/geo-json/", {
        delay:10,
        minChars:2,
        matchSubset:0,
        autoFill:true,
        matchContains:1,
        cacheLength:1000,
        selectFirst:true,
        formatItem:geoLiFormat,
        maxItemsToShow:10,
        onItemSelect:geoSelectItem
      });
  }
}
jQuery.noConflict();
jQuery(document).ready(mainInitFunction);
