(function(f){f.fn.citySelect=function(a){if(!(1>this.length)){a=f.extend({prov:null,city:null,dist:null,nodata:null,required:!0,slect_all_lng:"\x3coption value\x3d''\x3e\u8bf7\u9009\u62e9\x3c/option\x3e"},a);var g=this.find(".prov"),d=this.find(".city"),c=this.find(".dist"),k=a.required?"":a.slect_all_lng,e,m=function(){var b=g.get(0).selectedIndex;a.required||b--;d.empty().attr("disabled",!0);c.empty().attr("disabled",!0);0>b||"undefined"==typeof e[b].c?"none"==a.nodata?(d.css("display","none"),c.css("display","none")):"hidden"==a.nodata&&(d.css("visibility","hidden"),c.css("visibility","hidden")):(temp_html=k,f.each(e[b].c,function(a,b){temp_html+="\x3coption value\x3d'"+b.n+"'\x3e"+b.n+"\x3c/option\x3e"}),d.html(temp_html).attr("disabled",!1).css({display:"",visibility:""}),l())},l=function(){var b=g.get(0).selectedIndex,h=d.get(0).selectedIndex;a.required||(b--,h--);c.empty().attr("disabled",!0);0>b||0>h||"undefined"==typeof e[b].c[h].a?"none"==a.nodata?c.css("display","none"):"hidden"==a.nodata&&c.css("visibility","hidden"):(temp_html=k,f.each(e[b].c[h].a,function(a,b){temp_html+="\x3coption value\x3d'"+b.s+"'\x3e"+b.s+"\x3c/option\x3e"}),c.html(temp_html).attr("disabled",!1).css({display:"",visibility:""}))};e=cityJSON;(function(){temp_html=k;f.each(e,function(a,c){temp_html+="\x3coption value\x3d'"+c.p+"'\x3e"+c.p+"\x3c/option\x3e"});g.html(temp_html);setTimeout(function(){a.prov&&(g.val(a.prov),m(),setTimeout(function(){a.city&&(d.val(a.city),l(),setTimeout(function(){a.dist&&c.val(a.dist)},1))},1))},1);g.bind("change",function(){m()});d.bind("change",function(){l()})})()}}})(jQuery);