function autocompleteCityName(obj,callBackFn){

   $(obj).autocomplete(_contextpath + "/common/citySuggestWithCrossDomain.action",
    {
        delay:200,
        minChars:2,
        matchSubset:1,
        matchContains:1,
        cacheLength:10,
        onItemSelect:callBackFn || selectItem,
        formatItem:formatItem,
        maxItemsToShow:20,
        width:300,
        autoFill:false
    });
}

function csCity(o) {
    var datas = o.split('[');
    var names = datas[0].split('-');
    this.chsName = names[0];
    this.enuName = names[1];
    this.countryName = datas[1];
    this.countryCode = o.split('#')[1];
    this.cityCode = o.split('#')[2];
}


function selectItem(li) {
    var city = new csCity(li.innerHTML);
    $("#cityName").val(city.chsName);
    $("#cityEnuName").val(city.enuName);
    $("#countryCode").val(city.countryCode);
    $("#cityCode").val(city.cityCode);
}

function formatItem(row) {
    return row[0];
}