var strCity="北京市"; var strCitySpell="beijing"; function cityOption(cityValue){ var CityMaps; CityMaps=getCityMaps(cityValue); var url='main.mapbar.com'; url=""; var arrayCity; try{ arrayCity=TextCopy(cityValue); }catch(e){} Try.these( function() { if(cityValue=="香港"){ document.getElementById("citymap").innerHTML = ''; }else{ document.getElementById("citymap").innerHTML = ''; } } ) || true; try{ if(cityValue=="香港"){ document.getElementById("mapsearchhref").href="http://service.mapbar.com/newcitymap/index_hk.jsp?citycode_ch="+arrayCity[2]; }else{ document.getElementById("mapsearchhref").href="http://service.mapbar.com/newcitymap/index.jsp?citycode_ch="+arrayCity[2]; } }catch(e){} setWeather(cityValue); try{ try{document.subform.City.value=cityValue;}catch(e){} try{document.subform2.City.value=cityValue;}catch(e){} try{document.subform3.City.value=cityValue;}catch(e){} try{document.subform3.destCity.value=cityValue;}catch(e){} try{document.subform4.selectcity.value=cityValue;}catch(e){} try{ var searchformCityValue=cityValue; if(cityValue.indexOf("市")!=-1)searchformCityValue=cityValue.substring(0,cityValue.length-1); if(cityValue.indexOf("自治区")!=-1)searchformCityValue=cityValue.substring(0,cityValue.length-3); document.searchform.q2.value=searchformCityValue; document.searchform.q.value=''; }catch(e){} try{ var subform4CityValue=cityValue; if(cityValue.indexOf("市")!=-1)subform4CityValue=cityValue.substring(0,cityValue.length-1); if(cityValue.indexOf("自治区")!=-1)subform4CityValue=cityValue.substring(0,cityValue.length-3); document.subform4.city.value=subform4CityValue; }catch(e){} }catch(e){} //alert(strCity+"=="+cityValue); if(strCity==cityValue)return; var gotoUrl="http://main.mapbar.com"; var hrefPage = document.location.href; if(hrefPage.indexOf("mapbar.com")==-1){ gotoUrl=""; } if(cityValue=='上海市')window.location.href=gotoUrl+'/city/shanghai'; if(cityValue=='广州市')window.location.href=gotoUrl+'/city/guangzhou'; if(cityValue=='沈阳市')window.location.href=gotoUrl+'/city/shenyang'; if(cityValue=='常州市')window.location.href=gotoUrl+'/city/changzhou'; if(cityValue=='无锡市')window.location.href=gotoUrl+'/city/wuxi'; if(cityValue=='廊坊市')window.location.href=gotoUrl+'/city/langfang'; if(cityValue=='济南市')window.location.href=gotoUrl+'/city/jinan'; if(cityValue=='香港')window.location.href=gotoUrl+'/city/hongkong'; if(cityValue=='青岛市')window.location.href=gotoUrl+'/city/qingdao'; if(cityValue=='南京市')window.location.href='http://nanjing.mapbar.com'; if(cityValue=='长春市')window.location.href=gotoUrl+'/city/changchun'; if(cityValue=='北京市')window.location.href=gotoUrl+'/city/beijing'; if(cityValue=='郑州市')window.location.href=gotoUrl+'/city/zhengzhou'; if(cityValue=='泉州市')window.location.href=gotoUrl+'/city/quanzhou'; if(cityValue=='烟台市')window.location.href=gotoUrl+'/city/yantai'; if(cityValue=='南宁市')window.location.href=gotoUrl+'/city/nanning'; if(cityValue=='焦作市')window.location.href=gotoUrl+'/city/jiaozuo'; if(cityValue=='三明市')window.location.href=gotoUrl+'/city/sanming'; if(cityValue=='鹤岗市')window.location.href=gotoUrl+'/city/hegang'; if(cityValue=='乌鲁木齐市')window.location.href=gotoUrl+'/city/wulumuqi'; if(cityValue=='福州市')window.location.href=gotoUrl+'/city/fuzhou'; if(cityValue=='龙岩市')window.location.href=gotoUrl+'/city/longyan'; if(cityValue=='大庆市')window.location.href=gotoUrl+'/city/daqing'; if(cityValue=='嘉兴市')window.location.href=gotoUrl+'/city/jiaxing'; if(cityValue=='梧州市')window.location.href=gotoUrl+'/city/wuzhou'; if(cityValue=='徐州市')window.location.href=gotoUrl+'/city/xuzhou'; if(cityValue=='淮安市')window.location.href=gotoUrl+'/city/huaian'; } function getCitySpell(){ try{ var href = document.location.href; var p1 = href.indexOf("/",8)+1; //city var p2 = href.indexOf("/",p1)+1; //beijing if(p2==0){href has no city charactor} var p3 = href.indexOf("/",p2); //alert(p1+"-"+p2+"-"+p3+"-"+eval(p2-p1)); if(p2=="0"||eval(p2-p1)<2){ if(href.indexOf("nanjing.mapbar.com")!=-1){ //if(href.indexOf("192.168.0.88")!=-1){ strCitySpell="nanjing"; } }else{ strCitySpell=href.substr(p2,p3-p2); } }catch(e){strCitySpell='beijing';} } function getStrCity(citySpell){ try{ strCity=getStrCityFormList(citySpell); }catch(e){strCity='北京市';} } function getStrCityFormList(strSpell){ var strCitySpells=new Array(); strCitySpells['beijing']='北京市'; strCitySpells['tianjin']='天津市'; strCitySpells['shanghai']='上海市'; strCitySpells['chongqing']='重庆市'; //广东省 strCitySpells['guangzhou']='广州市'; strCitySpells['qingyuan']='清远市'; strCitySpells['foshan']='佛山市'; strCitySpells['shenzhen']='深圳市'; strCitySpells['zhanjiang']='湛江市'; strCitySpells['zhaoqing']='肇庆市'; strCitySpells['zhongshan']='中山市'; strCitySpells['dongguan']='东莞市'; strCitySpells['shaoguan']='韶关市'; strCitySpells['shantou']='汕头市'; strCitySpells['zhuhai']='珠海市'; strCitySpells['jieyang']='揭阳市'; strCitySpells['chaozhou']='潮州市'; strCitySpells['huizhou']='惠州市'; strCitySpells['jiangmen']='江门市'; strCitySpells['maoming']='茂名市'; strCitySpells['meizhou']='梅州市'; strCitySpells['heyuan']='河源市'; strCitySpells['shanwei']='汕尾市'; strCitySpells['yangjiang']='阳江市'; strCitySpells['yunfu']='云浮市'; //辽宁省 strCitySpells['shenyang']='沈阳市'; strCitySpells['fuxin']='阜新市'; strCitySpells['panjin']='盘锦市'; strCitySpells['fushun']='抚顺市'; strCitySpells['yingkou']='营口市'; strCitySpells['dalian']='大连市'; strCitySpells['huludao']='葫芦岛市'; strCitySpells['anshan']='鞍山市'; strCitySpells['dandong']='丹东市'; strCitySpells['jinzhou']='锦州市'; strCitySpells['chaoyang']='朝阳市'; strCitySpells['liaoyang']='辽阳市'; strCitySpells['benxi']='本溪市'; strCitySpells['tieling']='铁岭市'; //江苏省 strCitySpells['nanjing']='南京市'; strCitySpells['xuzhou']='徐州市'; strCitySpells['lianyungang']='连云港市'; strCitySpells['yancheng']='盐城市'; strCitySpells['yangzhou']='扬州市'; strCitySpells['taizhou']='泰州市'; strCitySpells['zhenjiang']='镇江市'; strCitySpells['nantong']='南通市'; strCitySpells['changzhou']='常州市'; strCitySpells['wuxi']='无锡市'; strCitySpells['suzhou']='苏州市'; strCitySpells['huaian']='淮安市'; strCitySpells['suqian']='宿迁市'; //湖北省 strCitySpells['wuhan']='武汉市'; strCitySpells['jingmen']='荆门市'; strCitySpells['jingzhou']='荆州市'; strCitySpells['shiyan']='十堰市'; strCitySpells['suihzou']='随州市'; strCitySpells['xiangfan']='襄樊市'; strCitySpells['yichang']='宜昌市'; strCitySpells['xiaogan']='孝感市'; //四川省 strCitySpells['chengdu']='成都市'; strCitySpells['luzhou']='泸州市'; strCitySpells['dazhou']='达州市'; strCitySpells['guangan']='广安市'; strCitySpells['guangyuan']='广元市'; strCitySpells['leshan']='乐山市'; strCitySpells['neijiang']='内江市'; strCitySpells['panzhihua']='攀枝花市'; strCitySpells['suining']='遂宁市'; strCitySpells['yibin']='宜宾市'; strCitySpells['zigong']='自贡市'; strCitySpells['ziyang']='资阳市'; //陕西省 strCitySpells['xian']='西安市'; strCitySpells['xianyang']='咸阳市'; strCitySpells['weinan']='渭南市'; strCitySpells['yanan']='延安市'; strCitySpells['baoji']='宝鸡市'; strCitySpells['hanzhong']='汉中市'; strCitySpells['tongchuan']='铜川市'; strCitySpells['yulin']='榆林市'; strCitySpells['shangluo']='商洛市'; strCitySpells['ankang']='安康市'; //河北省 strCitySpells['shijiazhuang']='石家庄市'; strCitySpells['tangshan']='唐山市'; strCitySpells['qihuangdao']='秦皇岛市'; strCitySpells['chengde']='承德市'; strCitySpells['langfang']='廊坊市'; strCitySpells['zhangjiakou']='张家口市'; strCitySpells['baoding']='保定市'; strCitySpells['xingtai']='邢台市'; strCitySpells['handan']='邯郸市'; strCitySpells['cangzhou']='沧州市'; strCitySpells['hengshui']='衡水市'; //山西省 strCitySpells['taiyuan']='太原市'; strCitySpells['changzhi']='长治市'; strCitySpells['datong']='大同市'; strCitySpells['jincheng']='晋城市'; strCitySpells['jinzhong']='晋中市'; strCitySpells['linfen']='临汾市'; strCitySpells['lvliang']='吕梁市'; strCitySpells['shuozhou']='朔州市'; strCitySpells['xinzhou']='忻州市'; strCitySpells['yangquan']='阳泉市'; strCitySpells['yuncheng']='运城市'; strCitySpells['henan']='河南省'; strCitySpells['zhengzhou']='郑州市'; strCitySpells['luoyang']='洛阳市'; strCitySpells['pingdingshan']='平顶山市'; strCitySpells['xuchang']='许昌市'; strCitySpells['nanyang']='南阳市'; strCitySpells['zhumadian']='驻马店市'; strCitySpells['zhoukou']='周口市'; strCitySpells['shangqiu']='商丘市'; strCitySpells['kaifeng']='开封市'; strCitySpells['xinxiang']='新乡市'; strCitySpells['sanmenxia']='三门峡市'; strCitySpells['puyang']='濮阳市'; strCitySpells['xinyang']='信阳市'; strCitySpells['hebi']='鹤壁市'; strCitySpells['anyang']='安阳市'; strCitySpells['jiaozuo']='焦作市'; strCitySpells['luohe']='漯河市'; //吉林省 strCitySpells['changchun']='长春市'; strCitySpells['jilin']='吉林市'; //黑龙江省 strCitySpells['haerbin']='哈尔滨市'; strCitySpells['qiqihaer']='齐齐哈尔市'; strCitySpells['daqing']='大庆市'; strCitySpells['mudanjiang']='牡丹江市'; strCitySpells['hegang']='鹤岗市'; //内蒙古自治区 strCitySpells['huhehaote']='呼和浩特市'; strCitySpells['guolinxile']='锡林郭勒'; strCitySpells['xinganmeng']='兴安盟'; strCitySpells['tongliao']='通辽市'; strCitySpells['chifeng']='赤峰市'; strCitySpells['hulunbeier']='呼伦贝尔市'; strCitySpells['baotou']='包头市'; //山东省 strCitySpells['jinan']='济南市'; strCitySpells['liaocheng']='聊城市'; strCitySpells['yantai']='烟台市'; strCitySpells['weihai']='威海市'; strCitySpells['qingdao']='青岛市'; strCitySpells['taian']='泰安市'; strCitySpells['laiwu']='莱芜市'; strCitySpells['jining']='济宁市'; strCitySpells['heze']='菏泽市'; strCitySpells['linyi']='临沂市'; strCitySpells['dezhou']='德州市'; strCitySpells['zibo']='淄博市'; strCitySpells['weifang']='潍坊市'; strCitySpells['rizhao']='日照市'; strCitySpells['dongying']='东营市'; strCitySpells['binzhou']='滨州市'; strCitySpells['zaozhuang']='枣庄市'; //安徽省 strCitySpells['hefei']='合肥市'; strCitySpells['wuhu']='芜湖市'; strCitySpells['huangshan']='黄山市'; strCitySpells['anqing']='安庆市'; strCitySpells['bengbu']='蚌埠市'; strCitySpells['haozhou']='亳州市'; strCitySpells['chaohu']='巢湖市'; strCitySpells['chizhou']='池州市'; strCitySpells['chuzhou']='滁州市'; strCitySpells['fuyang']='阜阳市'; strCitySpells['huaibei']='淮北市'; strCitySpells['liuan']='六安市'; strCitySpells['maanshan']='马鞍山市'; strCitySpells['suzhou']='宿州市'; strCitySpells['tongling']='铜陵市'; strCitySpells['xuancheng']='宣城市'; strCitySpells['huainan']='淮南市'; //浙江省 strCitySpells['hangzhou']='杭州市'; strCitySpells['shaoxing']='绍兴市'; strCitySpells['ningbo']='宁波市'; strCitySpells['huzhou']='湖州市'; strCitySpells['jiaxing']='嘉兴市'; strCitySpells['jinhua']='金华市'; strCitySpells['lishui']='丽水市'; strCitySpells['wenzhou']='温州市'; strCitySpells['taizhou']='台州市'; strCitySpells['quzhou']='衢州市'; //福建省 strCitySpells['fuzhou']='福州市'; strCitySpells['putian']='莆田市'; strCitySpells['nanping']='南平市'; strCitySpells['xiamen']='厦门市'; strCitySpells['quanzhou']='泉州市'; strCitySpells['zhangzhou']='漳州市'; strCitySpells['sanming']='三明市'; strCitySpells['longyan']='龙岩市'; strCitySpells['ningde']='宁德市'; //湖南省 strCitySpells['changsha']='长沙市'; strCitySpells['zhangjiajie']='张家界市'; strCitySpells['yueyang']='岳阳市'; strCitySpells['zhuzhou']='株洲市'; strCitySpells['chenzhou']='郴州市'; strCitySpells['changde']='常德市'; strCitySpells['hengyang']='衡阳市'; strCitySpells['shaoyang']='邵阳市'; strCitySpells['xiangtan']='湘潭市'; strCitySpells['yiyang']='益阳市'; strCitySpells['xiangxi']='湘西'; strCitySpells['huaihua']='怀化市'; //广西壮族自治区 strCitySpells['nanning']='南宁市'; strCitySpells['guilin']='桂林市'; strCitySpells['baise']='百色市'; strCitySpells['yulin']='玉林市'; strCitySpells['wuzhou']='梧州市'; //江西省 strCitySpells['nanchang']='南昌市'; strCitySpells['jiujiang']='九江市'; strCitySpells['jingdezhen']='景德镇市'; strCitySpells['shangrao']='上饶市'; strCitySpells['yingtan']='鹰潭市'; strCitySpells['yichun']='宜春市'; strCitySpells['pingxiang']='萍乡市'; strCitySpells['ganzhou']='赣州市'; strCitySpells['jian']='吉安市'; //贵州省 strCitySpells['guiyang']='贵阳市'; strCitySpells['liupanshui']='六盘水市'; //云南省 strCitySpells['kunming']='昆明市'; strCitySpells['yuxi']='玉溪市'; strCitySpells['gejiu']='个旧市'; strCitySpells['qujing']='曲靖市'; strCitySpells['chuxiong']='楚雄市'; strCitySpells['dehong']='德宏市'; strCitySpells['diqing']='迪庆'; strCitySpells['lincang']='临沧市'; strCitySpells['nujiang']='怒江'; strCitySpells['simao']='思茅市'; //西藏自治区 strCitySpells['lasa']='拉萨市'; //海南省 strCitySpells['haikou']='海口市'; strCitySpells['sanya']='三亚市'; strCitySpells['qionghai']='琼海市'; //甘肃省 strCitySpells['lanzhou']='兰州市'; //宁夏回族自治区 strCitySpells['yinchuan']='银川市'; //青海省 strCitySpells['xining']='西宁市'; //新疆维吾尔自治区 strCitySpells['wulumuqi']='乌鲁木齐市'; //特别行政区 strCitySpells['hongkong']='香港'; strCitySpells['aomen']='澳门'; //台湾省 strCitySpells['taiwan']='台湾'; if(typeof(strCitySpells[strSpell])=="undefined"){return strSpell;} else{return strCitySpells[strSpell];} }