cityList = new Array();
pIndex = new Array(32);
 
var provIndex = -1;
var cityIndex;
 
 
function initProvIndex()
{
   pIndex[0] = new aProvID(-1,0);
   pIndex[1] = new aProvID(11,1);
   pIndex[2] = new aProvID(12,2);
   pIndex[3] = new aProvID(13,3);
   pIndex[4] = new aProvID(14,4);
   pIndex[5] = new aProvID(15,5);
   pIndex[6] = new aProvID(21,6);
   pIndex[7] = new aProvID(22,7);
   pIndex[8] = new aProvID(23,8);
   pIndex[9] = new aProvID(31,9);
   pIndex[10] = new aProvID(32,10);
   pIndex[11] = new aProvID(33,11);
   pIndex[12] = new aProvID(34,12);
   pIndex[13] = new aProvID(35,13);
   pIndex[14] = new aProvID(36,14);
   pIndex[15] = new aProvID(37,15);
   pIndex[16] = new aProvID(41,16);
   pIndex[17] = new aProvID(42,17);
   pIndex[18] = new aProvID(43,18);
   pIndex[19] = new aProvID(44,19);
   pIndex[20] = new aProvID(45,20);
   pIndex[21] = new aProvID(46,21);
   pIndex[22] = new aProvID(50,22);
   pIndex[23] = new aProvID(51,23);
   pIndex[24] = new aProvID(52,24);
   pIndex[25] = new aProvID(53,25);
   pIndex[26] = new aProvID(54,26);
   pIndex[27] = new aProvID(61,27);
   pIndex[28] = new aProvID(62,28);
   pIndex[29] = new aProvID(63,29);
   pIndex[30] = new aProvID(64,30);
   pIndex[31] = new aProvID(65,31);
}
 
 
function aProvID( value, index)
{
    this.value = value;
    this.index = index;
}
 
function getPIndex(value)
{
    var pNum;
    var i;
    pNum = pIndex.length;
    for ( i=0; i< pNum; i++ )
    {
       if (pIndex[i].value == value)
           return pIndex[i].index;
    }
 
    return 0;
}
 
function newProv(){
  provIndex++;
  cityList[provIndex] = new Array();
  cityIndex = 0;
}
 
function addCity( value,city ) {
  cityList[provIndex][cityIndex] = new aCity(value,city);
  cityIndex++;
}
 
function aCity( value,text ) {
  this.text = text;
  this.value = value;
}
 
 
function updatecitys( ar, topic, areavalue )
{
  with (ar) {
    newProvs = cityList[topic].length;
    oldTopics = options.length;
 
    // add new citys to the menu
    for ( i=0; i<newProvs; i++ ) {
      options[i] = new Option( cityList[topic][i].text,cityList[topic][i].value );
      options[i].selected = cityList[topic][i].value == areavalue;
    }
 
    // remove any left from previous menu
    for ( i=oldTopics-1; i>=newProvs; i-- ) {
      options[i] = null;
    }
 
    if ( areavalue == '' )
      options[0].selected = true;
  }
}
 
 
 
function initcitys ( )
{
newProv();
addCity("-1","全部市");
 
newProv();
addCity("-1","全部市");
addCity("1101","北京市辖区");
addCity("1102","北京市辖县");
 
newProv();
addCity("-1","全部市");
addCity("1201","天津市辖区");
addCity("1202","天津市辖县");
 
newProv();
addCity("-1","全部市");
addCity("1301","石家庄市");
addCity("1302","唐山市");
addCity("1303","秦皇岛市");
addCity("1304","邯郸市");
addCity("1305","邢台市");
addCity("1306","保定市");
addCity("1307","张家口市");
addCity("1308","承德市");
addCity("1309","沧州市");
addCity("1310","廊坊市");
addCity("1311","衡水市");
 
newProv();
addCity("-1","全部市");
addCity("1401","太原市");
addCity("1402","大同市");
addCity("1403","阳泉市");
addCity("1404","长治市");
addCity("1405","晋城市");
addCity("1406","朔州市");
addCity("1407","晋中市");
addCity("1408","运城市");
addCity("1409","忻州市");
addCity("1410","临汾市");
addCity("1423","吕梁地区");
addCity("1499","其他城市");
 
newProv();
addCity("-1","全部市");
addCity("1501","呼和浩特市");
addCity("1502","包头市");
addCity("1503","乌海市");
addCity("1504","赤峰市");
addCity("1505","通辽市");
addCity("1506","鄂尔多斯市");
addCity("1522","兴安盟");
addCity("1525","锡林郭勒盟");
addCity("1526","乌兰察布盟");
addCity("1528","巴彦淖尔盟");
addCity("1529","阿拉善盟");
 
newProv();
addCity("-1","全部市");
addCity("2101","沈阳市");
addCity("2102","大连市");
addCity("2103","鞍山市");
addCity("2104","抚顺市");
addCity("2105","本溪市");
addCity("2106","丹东市");
addCity("2107","锦州市");
addCity("2108","营口市");
addCity("2109","阜新市");
addCity("2110","辽阳市");
addCity("2111","盘锦市");
addCity("2112","铁岭市");
addCity("2113","朝阳市");
addCity("2114","葫芦岛市");
 
newProv();
addCity("-1","全部市");
addCity("2201","长春市");
addCity("2202","吉林市");
addCity("2203","四平市");
addCity("2204","辽源市");
addCity("2205","通化市");
addCity("2206","白山市");
addCity("2207","松原市");
addCity("2208","白城市");
addCity("2224","延边朝鲜族自治州");
 
newProv();
addCity("-1","全部市");
addCity("2301","哈尔滨市");
addCity("2302","齐齐哈尔市");
addCity("2303","鸡西市");
addCity("2304","鹤岗市");
addCity("2305","双鸭山市");
addCity("2306","大庆市");
addCity("2307","伊春市");
addCity("2308","佳木斯市");
addCity("2309","七台河市");
addCity("2310","牡丹江市");
addCity("2311","黑河市");
addCity("2312","绥化市");
addCity("2327","大兴安岭地区");
 
newProv();
addCity("-1","全部市");
addCity("3101","上海市辖区");
addCity("3102","上海市辖县");
addCity("3195","开发区");
 
newProv();
addCity("-1","全部市");
addCity("3201","南京市");
addCity("3202","无锡市");
addCity("3203","徐州市");
addCity("3204","常州市");
addCity("3205","苏州市");
addCity("3206","南通市");
addCity("3207","连云港市");
addCity("3208","淮安市");
addCity("3209","盐城市");
addCity("3210","扬州市");
addCity("3211","镇江市");
addCity("3212","泰州市");
addCity("3213","宿迁市");
 
newProv();
addCity("-1","全部市");
addCity("3301","杭州市");
addCity("3302","宁波市");
addCity("3303","温州市");
addCity("3304","嘉兴市");
addCity("3305","湖州市");
addCity("3306","绍兴市");
addCity("3307","金华市");
addCity("3308","衢州市");
addCity("3309","舟山市");
addCity("3310","台州市");
addCity("3311","丽水市");
 
 
newProv();
addCity("-1","全部市");
addCity("3401","合肥市");
addCity("3402","芜湖市");
addCity("3403","蚌埠市");
addCity("3404","淮南市");
addCity("3405","马鞍山市");
addCity("3406","淮北市");
addCity("3407","铜陵市");
addCity("3408","安庆市");
addCity("3410","黄山市");
addCity("3411","滁州市");
addCity("3412","阜阳市");
addCity("3413","宿州市");
addCity("3414","巢湖市");
addCity("3415","六安市");
addCity("3416","亳州市");
addCity("3417","池州市");
addCity("3418","宣城市");
 
newProv();
addCity("-1","全部市");
addCity("3501","福州市");
addCity("3502","厦门市");
addCity("3503","莆田市");
addCity("3504","三明市");
addCity("3505","泉州市");
addCity("3506","漳州市");
addCity("3507","南平市");
addCity("3508","龙岩市");
addCity("3509","宁德市");
 
newProv();
addCity("-1","全部市");
addCity("3601","南昌市");
addCity("3602","景德镇市");
addCity("3603","萍乡市");
addCity("3604","九江市");
addCity("3605","新余市");
addCity("3606","鹰潭市");
addCity("3607","赣州市");
addCity("3608","吉安市");
addCity("3609","宜春市");
addCity("3610","抚州市");
addCity("3611","上饶市");
 
newProv();
addCity("-1","全部市");
addCity("3701","济南市");
addCity("3702","青岛市");
addCity("3703","淄博市");
addCity("3704","枣庄市");
addCity("3705","东营市");
addCity("3706","烟台市");
addCity("3707","潍坊市");
addCity("3708","济宁市");
addCity("3709","泰安市");
addCity("3710","威海市");
addCity("3711","日照市");
addCity("3712","莱芜市");
addCity("3713","临沂市");
addCity("3714","德州市");
addCity("3715","聊城市");
addCity("3716","滨州市");
addCity("3717","菏泽市");
addCity("3799","其他城市");
 
newProv();
addCity("-1","全部市");
addCity("4101","郑州市");
addCity("4102","开封市");
addCity("4103","洛阳市");
addCity("4104","平顶山市");
addCity("4105","安阳市");
addCity("4106","鹤壁市");
addCity("4107","新乡市");
addCity("4108","焦作市");
addCity("4109","濮阳市");
addCity("4110","许昌市");
addCity("4111","漯河市");
addCity("4112","三门峡市");
addCity("4113","南阳市");
addCity("4114","商丘市");
addCity("4115","信阳市");
addCity("4116","周口市");
addCity("4117","驻马店市");
 
newProv();
addCity("-1","全部市");
addCity("4201","武汉市");
addCity("4202","黄石市");
addCity("4203","十堰市");
addCity("4205","宜昌市");
addCity("4206","襄樊市");
addCity("4207","鄂州市");
addCity("4208","荆门市");
addCity("4209","孝感市");
addCity("4210","荆州市");
addCity("4211","黄冈市");
addCity("4212","咸宁市");
addCity("4213","随州市");
addCity("4228","恩施土家族苗族自治州");
addCity("4290","省直辖县级行政单位");
 
newProv();
addCity("-1","全部市");
addCity("4301","长沙市");
addCity("4302","株洲市");
addCity("4303","湘潭市");
addCity("4304","衡阳市");
addCity("4305","邵阳市");
addCity("4306","岳阳市");
addCity("4307","常德市");
addCity("4308","张家界市");
addCity("4309","益阳市");
addCity("4310","郴州市");
addCity("4311","永州市");
addCity("4312","怀化市");
addCity("4313","娄底市");
addCity("4331","湘西土家族苗族自治州");
 
newProv();
addCity("-1","全部市");
addCity("4401","广州市");
addCity("4402","韶关市");
addCity("4403","深圳市");
addCity("4404","珠海市");
addCity("4405","汕头市");
addCity("4406","佛山市");
addCity("4407","江门市");
addCity("4408","湛江市");
addCity("4409","茂名市");
addCity("4412","肇庆市");
addCity("4413","惠州市");
addCity("4414","梅州市");
addCity("4415","汕尾市");
addCity("4416","河源市");
addCity("4417","阳江市");
addCity("4418","清远市");
addCity("4419","东莞市");
addCity("4420","中山市");
addCity("4451","潮州市");
addCity("4452","揭阳市");
addCity("4453","云浮市");
 
newProv();
addCity("-1","全部市");
addCity("4501","南宁市");
addCity("4502","柳州市");
addCity("4503","桂林市");
addCity("4504","梧州市");
addCity("4505","北海市");
addCity("4506","防城港市");
addCity("4507","钦州市");
addCity("4508","贵港市");
addCity("4509","玉林市");
addCity("4513","来宾市");
addCity("4514","宗左市");
addCity("4524","贺州市");
addCity("4526","百色地区");
addCity("4527","河池地区");
 
newProv();
addCity("-1","全部市");
addCity("4601","海口市");
addCity("4602","三亚市");
addCity("4690","省直辖县级行政单位");
 
newProv();
addCity("-1","全部市");
addCity("5100","重庆市辖区");
addCity("5200","重庆市辖县");
addCity("5300","重庆市辖市");
 
newProv();
addCity("-1","全部市");
addCity("5101","成都市");
addCity("5103","自贡市");
addCity("5104","攀枝花市");
addCity("5105","泸州市");
addCity("5106","德阳市");
addCity("5107","绵阳市");
addCity("5108","广元市");
addCity("5109","遂宁市");
addCity("5110","内江市");
addCity("5111","乐山市");
addCity("5113","南充市");
addCity("5114","眉山市");
addCity("5115","宜宾市");
addCity("5116","广安市");
addCity("5117","达州市");
addCity("5118","雅安市");
addCity("5119","巴中市");
addCity("5120","资阳市");
addCity("5132","阿坝藏族羌族自治州");
addCity("5133","甘孜藏族自治州");
addCity("5134","凉山彝族自治州");
 
newProv();
addCity("-1","全部市");
addCity("5201","贵阳市");
addCity("5202","六盘水市");
addCity("5203","遵义市");
addCity("5204","安顺市");
addCity("5222","铜仁地区");
addCity("5223","黔西南布依族苗族自治州");
addCity("5224","毕节地区");
addCity("5226","黔东南苗族侗族自治州");
addCity("5227","黔南布依族苗族自治州");
 
newProv();
addCity("-1","全部市");
addCity("5301","昆明市");
addCity("5303","曲靖市");
addCity("5304","玉溪市");
addCity("5305","保山市");
addCity("5306","昭通市");
addCity("5307","丽江市");
addCity("5323","楚雄彝族自治州");
addCity("5325","红河哈尼族彝族自治州");
addCity("5326","文山壮族苗族自治州");
addCity("5327","思茅地区");
addCity("5328","西双版纳傣族自治州");
addCity("5329","大理白族自治州");
addCity("5331","德宏傣族景颇族自治州");
addCity("5333","怒江傈僳族自治州");
addCity("5334","迪庆藏族自治州");
addCity("5335","临沧地区");
 
newProv();
addCity("-1","全部市");
addCity("5401","拉萨市");
addCity("5421","昌都地区");
addCity("5422","山南地区");
addCity("5423","日喀则地区");
addCity("5424","那曲地区");
addCity("5425","阿里地区");
addCity("5426","林芝地区");
 
newProv();
addCity("-1","全部市");
addCity("6101","西安市");
addCity("6102","铜川市");
addCity("6103","宝鸡市");
addCity("6104","咸阳市");
addCity("6105","渭南市");
addCity("6106","延安市");
addCity("6107","汉中市");
addCity("6108","榆林市");
addCity("6109","安康市");
addCity("6110","商洛市");
 
newProv();
addCity("-1","全部市");
addCity("6201","兰州市");
addCity("6202","嘉峪关市");
addCity("6203","金昌市");
addCity("6204","白银市");
addCity("6205","天水市");
addCity("6206","武威市");
addCity("6221","酒泉地区");
addCity("6222","张掖地区");
addCity("6224","定西地区");
addCity("6226","陇南地区");
addCity("6227","平凉地区");
addCity("6228","庆阳地区");
addCity("6229","临夏回族自治州");
addCity("6230","甘南藏族自治州");
 
newProv();
addCity("-1","全部市");
addCity("6301","西宁市");
addCity("6321","海东地区");
addCity("6322","海北藏族自治州");
addCity("6323","黄南藏族自治州");
addCity("6325","海南藏族自治州");
addCity("6326","果洛藏族自治州");
addCity("6327","玉树藏族自治州");
addCity("6328","海西蒙古族藏族自治州");
 
newProv();
addCity("-1","全部市");
addCity("6401","银川市");
addCity("6402","石嘴山市");
addCity("6403","吴忠市");
addCity("6404","固原市");
 
newProv();
addCity("-1","全部市");
addCity("6501","乌鲁木齐市");
addCity("6502","克拉玛依市");
addCity("6521","吐鲁番地区");
addCity("6522","哈密地区");
addCity("6523","昌吉回族自治州");
addCity("6527","博尔塔拉蒙古族自治州");
addCity("6528","巴音郭楞蒙古自治州");
addCity("6529","阿克苏地区");
addCity("6530","克孜勒苏柯尔克孜自治州");
addCity("6531","喀什地区");
addCity("6532","和田地区");
addCity("6540","伊犁哈萨克自治州");
addCity("6542","塔城地区");
addCity("6543","阿勒泰地区");
 
}
 