!function(a){a.fn.citySelect=function(b){var c,d,e,f,g,h,i,j,k;this.length<1||(b=a.extend({prov:null,city:null,dist:null,nodata:null,required:!0,slect_all_lng:"<option value=''>请选择</option>"},b),c=this,d=c.find(".prov"),e=c.find(".city"),f=c.find(".dist"),g=b.required?"":b.slect_all_lng,i=function(){var c=d.get(0).selectedIndex;return b.required||c--,e.empty().attr("disabled",!0),f.empty().attr("disabled",!0),0>c||"undefined"==typeof h[c].c?("none"==b.nodata?(e.css("display","none"),f.css("display","none")):"hidden"==b.nodata&&(e.css("visibility","hidden"),f.css("visibility","hidden")),void 0):(temp_html=g,a.each(h[c].c,function(a,b){temp_html+="<option value='"+b.n+"'>"+b.n+"</option>"}),e.html(temp_html).attr("disabled",!1).css({display:"",visibility:""}),j(),void 0)},j=function(){var c=d.get(0).selectedIndex,i=e.get(0).selectedIndex;return b.required||(c--,i--),f.empty().attr("disabled",!0),0>c||0>i||"undefined"==typeof h[c].c[i].a?("none"==b.nodata?f.css("display","none"):"hidden"==b.nodata&&f.css("visibility","hidden"),void 0):(temp_html=g,a.each(h[c].c[i].a,function(a,b){temp_html+="<option value='"+b.s+"'>"+b.s+"</option>"}),f.html(temp_html).attr("disabled",!1).css({display:"",visibility:""}),void 0)},k=function(){temp_html=g,a.each(h,function(a,b){temp_html+="<option value='"+b.p+"'>"+b.p+"</option>"}),d.html(temp_html),setTimeout(function(){b.prov&&(d.val(b.prov),i(),setTimeout(function(){b.city&&(e.val(b.city),j(),setTimeout(function(){b.dist&&f.val(b.dist)},1))},1))},1),d.bind("change",function(){i()}),e.bind("change",function(){j()})},h=cityJSON,k())}}(jQuery);