var logimg=new Image();
youdao.maps.basis.baseurl="js/pack147214M/";
youdao.maps.basis.Log.enabled=false;
youdao.maps.lingtu.Default.imageHosts=["http://m1.youdao.com/mp/","http://m2.youdao.com/mp/","http://m3.youdao.com/mp/","http://m4.youdao.com/mp/","http://m5.youdao.com/mp/","http://m6.youdao.com/mp/"];
function cLog(_1,_2,_3){
logimg.src="/clog?tag="+_1+"&action="+_2+"&pos="+_3;
}
function updataCityNavi(_4,_5){
if(_4.length<6||!_4.match("\\d{6}")){
_4="000000";
}
var _6=_4.substr(0,2);
var _7=_4.substr(2,2);
var _8=_4.substr(4,2);
admin_codes=[];
if(_6!="00"){
admin_codes.push(_6);
if(_7!="00"){
admin_codes.push(_7);
if(_8!="00"){
admin_codes.push(_8);
}
}
}
var _9="";
var _a="";
var _b="";
var _c=adminjson;
var _d="";
var _e=" > ";
for(var i=-1;i<admin_codes.length;i++){
_9=_9+_d;
if(i>=0){
_c=_c[admin_codes[i]];
}
if(_c["__view__"]=="nodata"){
_d="&nbsp;"+_c["__name__"];
}else{
if(_c["__view__"]!="hide"){
if(i==1){
citypara=_c["__name__"];
}
_d="<a style=\"white-space:nowrap;word-break:keep-all;zoom:1;\" onclick=\"javascript:updataCityNavi('"+_c["__code__"]+"');searchCity('"+_c["__code__"]+"')\">"+_c["__name__"]+"</a>";
if(_9!=""){
_d=_e+_d;
}
}
}
}
var _10=getSubCode(_c);
if(_10.bodyHtml!=""){
_d="<a style=\"white-space:nowrap;text-decoration:none;word-break:keep-all;zoom:1;\" onclick=\"showOrHide(document.getElementById('cbody'));switchMark();\">"+_c["__name__"]+"<span id=\"expand\">\u25bc</span></a>";
if(_9!=""){
_d=_e+_d;
}
_9=_9+_d;
}else{
_d="<a style=\"white-space:nowrap;text-decoration:none;word-break:keep-all;zoom:1;\">"+_c["__name__"]+"</a>";
if(_9!=""){
_d=_e+_d;
}
_9=_9+_d;
}
_9="<span  style=\"white-space:nowrap;\">\u641c\u7d22\u8303\u56f4: </span>"+_9;
inputcity=_c["__code__"];
citypara=_c["__name__"];
document.getElementById("chead").innerHTML=_9;
var _11=document.getElementById("cbodyinner");
var _12=_10.bodyHtml;
if(_10.bottomHtml!=""){
if(_10.bodyHtml!=""){
_12=_12+"<br>"+_10.bottomHtml;
}else{
_12=_12+_10.bottomHtml;
}
}
_11.innerHTML=_12;
document.getElementById("cbottom").style.display="none";
if(_5==false){
showSubCities(false);
}else{
showSubCities(true);
}
}
function showSubCities(_13){
var _14=document.getElementById("cbody");
if(_14==undefined){
return;
}
if(_13==false){
_14.style.display="none";
switchMark("\u25bc");
}else{
if(_13==true){
var _15=document.getElementById("cbodyinner");
if(_15==undefined||_15.innerHTML==""){
_14.style.display="none";
return;
}
_14.style.display="";
switchMark("\u25b2");
}
}
}
function switchMark(tag){
var el=document.getElementById("expand");
if(el==undefined){
return;
}
if(tag){
el.innerHTML=tag;
return;
}
var p="\u25bc";
var f="\u25b2";
if(el.innerHTML==p){
el.innerHTML=f;
return;
}
if(el.innerHTML==f){
el.innerHTML=p;
return;
}
}
function getSubCode(obj){
var _1b=" ";
var _1c={};
var _1d="";
var _1e="";
for(var _1f in obj){
if(_1f.indexOf("__")<0){
var _20=obj[_1f];
if(_20["__view__"]=="hide"){
_1d=_1d+getSubCode(_20).bodyHtml;
}else{
if(_20["__view__"]=="nodata"){
if(_1e!=""){
_1e=_1e+_1b;
}
_1e=_1e+_20["__name__"];
}else{
if(_1d!=""){
_1d=_1d+_1b;
}
_1d+="<a style=\"word-break:keep-all;zoom:1;white-space:nowrap;margin-right:.5em;\" onclick=\"javascript:updataCityNavi('"+_20["__code__"]+"');searchCity('"+_20["__code__"]+"')\">"+_20["__name__"]+"</a>";
}
}
}
}
_1c.bodyHtml=_1d;
_1c.bottomHtml=_1e;
return _1c;
}
function searchCity(_21,qry){
if(_21==city){
return;
}
if(_21=="000000"){
showCountryView();
}else{
localSearch.search(_21,"",city,"","","",range,_21,"keyfrom=admintree&admin=true");
}
}
function showCountryView(){
fDiv.style.display="none";
tDiv.style.display="none";
cDiv.style.display="none";
cityDiv.style.display="none";
city="000000";
showDefaultMap(map);
updataCityNavi("000000");
introDiv.style.display="";
if(setDefaultLocDiv!=undefined){
setDefaultLocDiv.style.display="none";
}
}
function showUserSelBusPage(_23,_24){
var _25=document.createElement("div");
_25.id="citySelDiv";
_25.className="listdiv text75";
_23.appendChild(_25);
var _26=document.createElement("span");
_26.style.display="block";
_26.innerHTML="\u516c\u4ea4\u7ebf\u8def\uff1a<br>\u4ece<b>"+_24.from+"</b>\u5230<b>"+_24.to+"</b><br>\u5019\u9009\u57ce\u5e02";
_25.appendChild(_26);
showCitySelList(_25,_24.candidateCityList,"busCitySel");
_23.appendChild(_25);
var _27=document.createElement("button");
_27.innerHTML="\u67e5\u770b\u7ebf\u8def";
_27.onclick=function(){
var _28=document.getElementById("busCitySel");
var _29=_28.selectedIndex;
var _2a=_28.options[_29].text;
var _2b=_24.from;
var to=_24.to;
cLog("","search","busCitySel");
busSearch.goSearch(_2b,to,_2a,"","","",fromIndex,toIndex,0,inputcity);
};
_23.appendChild(_27);
}
function showUserSelNaviPage(_2d,_2e){
_2d.innerHTML+="<span class='text75'>\u884c\u8f66\u7ebf\u8def\uff1a</span>";
var _2f=false,_30=false;
var _31=_2e.fromPoiResults.resultCityList;
if(_31!=undefined&&_31.length>0){
_2f=true;
var _32=document.createElement("div");
_32.id="fromSelDiv";
_2d.appendChild(_32);
_32.className="listdiv text75";
var _33=document.createElement("span");
_33.style.display="block";
_33.innerHTML="\u8d77\u70b9: <b>"+_2e.from+"</b> <br>\u5019\u9009\u57ce\u5e02";
_32.appendChild(_33);
showCitySelList(_32,_31,"fromCitySel");
}
var _34=_2e.toPoiResults.resultCityList;
if(_34!=undefined&&_34.length>0){
_30=true;
var _35=document.createElement("div");
_35.id="toSelDiv";
_35.className="listdiv text75";
_2d.appendChild(_35);
var _36=document.createElement("span");
_36.style.display="block";
_36.innerHTML="\u7ec8\u70b9: <b>"+_2e.to+"</b> <br>\u5019\u9009\u57ce\u5e02";
_35.appendChild(_36);
showCitySelList(_35,_2e.toPoiResults.resultCityList,"toCitySel");
}
if(_2f||_30){
var _37=document.createElement("button");
_37.innerHTML="\u67e5\u770b\u7ebf\u8def";
_37.onclick=function(){
var _38=document.getElementById("fromCitySel");
var _39="";
if(_38!=undefined){
var _3a=_38.selectedIndex;
_39=_38.options[_3a].text;
}
var _3b=document.getElementById("toCitySel");
var _3c="";
if(_3b!=undefined){
var _3d=_3b.selectedIndex;
_3c=_3b.options[_3d].text;
}
var _3e=_2e.from;
var to=_2e.to;
cLog("","search","naviCitySel");
naviSearch.goSearch(_3e,to,"","",inputValue,0,0,_39,_3c,city,inputcity);
};
_2d.appendChild(_37);
}else{
showErrMsgPage(_2e);
}
}
function showCitySelList(_40,_41,id){
if(_41){
var _43=document.createElement("select");
_43.id=id;
_43.size=10;
_43.style.width="90%";
var _44="";
for(var i=0;i<_41.length;i++){
var _46=_41[i];
var _47=document.createElement("option");
_47.innerHTML=_46;
if(i==0){
_47.selected=true;
}
_43.appendChild(_47);
}
_40.appendChild(_43);
}
}
function showBusPointSelPage(_48,_49){
map.removeAllMark();
_48.innerHTML="";
_48.innerHTML+="<span class='text75'>\u8bf7\u9009\u62e9\u516c\u4ea4\u8d77\u6b62\u70b9\uff1a</span>";
var _4a=document.createElement("div");
_4a.id="fromPoiSelDiv";
_48.appendChild(_4a);
_4a.className="listdiv text75";
var _4b=document.createElement("span");
_4b.style.display="block";
_4b.innerHTML="\u8d77\u70b9: <b>"+_49.from+"</b><br>";
_4a.appendChild(_4b);
showPoiSelList(_4a,_49.fromPoiResults.poiList,"fromPoiSel","start");
var _4c=document.createElement("div");
_4c.id="toPoiSelDiv";
_4c.className="listdiv text75";
_48.appendChild(_4c);
var _4d=document.createElement("span");
_4d.style.display="block";
_4d.innerHTML="\u7ec8\u70b9: <b>"+_49.to+"</b><br>";
_4c.appendChild(_4d);
showPoiSelList(_4c,_49.toPoiResults.poiList,"toPoiSel","end");
var _4e=document.createElement("button");
_4e.innerHTML="\u786e\u5b9a";
_4e.onclick=function(){
var _4f=document.getElementById("fromPoiSel");
var _50=_4f.selectedIndex;
var _51=_49.fromPoiResults.poiList[_50].id;
var _52=document.getElementById("toPoiSel");
var _53=_52.selectedIndex;
var _54=_49.toPoiResults.poiList[_53].id;
busSearch.goSearch(_51,_54,"","","","",0,0,0,inputcity);
cLog("","search","busPoiSel");
};
_48.appendChild(_4e);
}
function showPoiSelList(_55,_56,id,_58){
if(_56){
var _59=document.createElement("select");
_59.id=id;
_59.size=6;
_59.style.width="90%";
var _5a="";
for(var i=0;i<_56.length;i++){
var poi=_56[i];
var _5d=document.createElement("option");
_5d.innerHTML="<span>"+poi.name+"&nbsp;-&nbsp;"+poi.location+"</span>";
_5d.onclick=function(){
var poi=_56[_59.selectedIndex];
var _5f=new youdao.maps.GeoPoint(poi.lo,poi.la);
iconmapurl=(_58=="start"?"icon/start.gif":"icon/end.gif");
var _60=new youdao.maps.Icon(null,{"img":iconmapurl});
if(_56.marker==undefined){
_56.marker=new youdao.maps.Marker("",_5f,_60);
map.addOverlay(_56.marker);
}else{
_56.marker.setPoint(_5f);
}
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,1);
};
if(i==0){
_5d.selected=true;
}
_59.appendChild(_5d);
}
_55.appendChild(_59);
}
}
function LocalSearcher(_61,_62){
var ls=this;
this.xmlHttp=null;
this.searchResult=null;
this.callback=_61;
this.goSearchCallback=_62;
this.q="";
this.lq="";
this.URL="";
this.createXMLHttpRequest=function(){
if(window.ActiveXObject){
this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
if(window.XMLHttpRequest){
this.xmlHttp=new window.XMLHttpRequest();
this.xmlHttp.overrideMimeType("text/html; charset=utf-8");
}
}
};
this.fillResult=function(){
var _64=ls.xmlHttp;
if(_64.readyState==4){
window.clearTimeout(ls.timeout);
if(_64.status==200){
ls.searchResult=eval("("+_64.responseText+")");
ls.callback(ls.searchResult);
}else{
errtext="{\"resultNum\":0,\"errCode\":500,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u670d\u52a1\u6682\u65f6\u4e0d\u80fd\u8bbf\u95ee\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
ls.searchResult=eval("("+errtext+")");
ls.callback(ls.searchResult);
}
}else{
if(_64.readyState==0){
window.clearTimeout(ls.timeout);
errtext="{\"resultNum\":0,\"errCode\":500,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u65e0\u6cd5\u5efa\u7acb\u8fde\u63a5\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8bbe\u7f6e\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
}
if(_64.readyState>5||_64.readyState<0){
window.clearTimeout(ls.timeout);
errtext="{\"resultNum\":0,\"errCode\":500,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u53d1\u751f\u4e0d\u660e\u539f\u56e0\u7684\u9519\u8bef\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
}
}
};
this.search=function(_65,_66,_67,_68,_69,iq,_6b,_6c,_6d){
this.lq=this.q;
this.q=_65;
this.URL="q="+_65+"&center="+_66+"&city="+_67+"&curPage="+_68+"&pageCap="+_69+"&iq="+iq+"&lq="+this.lq+"&radius="+_6b+"&inputcity="+_6c;
if(_6d){
this.URL+="&"+_6d;
}
this.URL=youdao.maps.basis.utils.encodeUrlStr(this.URL);
this.searchURL(ls.URL);
};
this.searchURL=function(url){
this.goSearchCallback();
this.createXMLHttpRequest();
this.URL=url;
window.clearTimeout(ls.timeout);
this.xmlHttp.abort();
this.xmlHttp.open("GET","localsearch?"+ls.URL+"&"+(new Date()).getTime(),true);
this.xmlHttp.onreadystatechange=ls.fillResult;
this.xmlHttp.send(null);
this.timeout=window.setTimeout(ls.handleTimeout,10000);
};
this.handleTimeout=function(){
ls.xmlHttp.abort();
errtext="{\"resultNum\":0,\"errCode\":600,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u7f51\u7edc\u8fde\u63a5\u8017\u65f6\u8fc7\u957f\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
ls.searchResult=eval("("+errtext+")");
ls.callback(ls.searchResult);
};
}
function NaviSearcher(_6f,_70){
var bs=this;
this.xmlHttp=null;
this.searchResult=null;
this.callback=_6f;
this.goSearchCallback=_70;
this.q="";
this.lq="";
this.fromindex=0;
this.toindex=0;
this.URL="";
this.createXMLHttpRequest=function(){
if(window.ActiveXObject){
this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
if(window.XMLHttpRequest){
this.xmlHttp=new window.XMLHttpRequest();
}
}
};
this.fillResult=function(){
var _72=bs.xmlHttp;
if(_72.readyState==4){
if(_72.status==200){
bs.searchResult=eval("("+_72.responseText+")");
bs.callback(bs.searchResult);
}else{
errtext="{\"resultNum\":0,\"errCode\":500,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u670d\u52a1\u6682\u65f6\u4e0d\u80fd\u8bbf\u95ee\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
bs.searchResult=eval("("+errtext+")");
bs.callback(bs.searchResult);
}
}
};
this.goSearch=function(_73,to,_75,_76,iq,_78,_79,_7a,_7b,_7c,_7d){
if(_73==""||to==""){
return;
}
this.goSearchCallback();
this.fromindex=_78;
this.toindex=_79;
this.lq=this.q;
this.q="from:"+_73+"  to:"+to;
if(_7a==undefined){
_7a="";
}
if(_7b==undefined){
_7b="";
}
var URL="from="+_73+"&to="+to+"&curPage="+_75+"&pageCap="+_76+"&fromindex="+this.fromindex+"&toindex="+this.toindex+"&iq="+iq+"&lq="+this.lq+"&fromcity="+_7a+"&tocity="+_7b+"&inputcity="+_7d+"&city="+_7c;
URL=youdao.maps.basis.utils.encodeUrlStr(URL);
bs.searchURL(URL);
};
this.search=function(_7f,to,_81,_82,iq){
this.goSearch(_7f,to,_81,_82,iq,0,0);
};
this.searchURL=function(url){
this.URL="searchtype=navi&"+url;
localSearch.searchURL(this.URL);
};
}
function BusSearcher(_85,_86,_87){
var bs=this;
this.xmlHttp=null;
this.searchResult=null;
this.callback=_85;
this.exceptionHandler=_87;
this.goSearchCallback=_86;
this.q="";
this.lq="";
this.fromindex=0;
this.toindex=0;
this.URL="";
this.createXMLHttpRequest=function(){
if(window.ActiveXObject){
this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
if(window.XMLHttpRequest){
this.xmlHttp=new window.XMLHttpRequest();
}
}
};
this.fillResult=function(){
var _89=bs.xmlHttp;
if(_89.readyState==4){
if(_89.status==200){
bs.searchResult=eval("("+_89.responseText+")");
this.fromindex=bs.searchResult.fromIndex;
this.toindex=bs.searchResult.toIndex;
bs.callback(bs.searchResult);
}else{
errtext="{\"resultNum\":0,\"errCode\":500,\"keyword\":\""+ls.q+"\",\"currentQuery\":\"\",\"lastQuery\""+":\"\",\"query\":\"\",\"searchType\":1,\"resultCityList\":[],\"curPage\":1,\"errMsg\":\"\u670d\u52a1\u6682\u65f6\u4e0d\u80fd\u8bbf\u95ee\",\"poiList\""+":[],\"needUserSel\":false,\"tag\":0,\"description\":\"\",\"center\":\"\",\"city\":\"\"}";
bs.searchResult=eval("("+errtext+")");
bs.callback(bs.searchResult);
}
}
};
this.goSearch=function(_8a,to,_8c,_8d,_8e,iq,_90,_91,_92,_93){
if(_8a==""||to==""){
return;
}
this.goSearchCallback();
this.fromindex=_90;
this.toindex=_91;
this.lineindex=_92;
this.lq=this.q;
this.q="from:"+_8a+"to:"+to+"city:"+_8c;
var URL="from="+_8a+"&to="+to+"&city="+_8c+"&curPage="+_8d+"&pageCap="+_8e+"&fromindex="+_90+"&toindex="+_91+"&lineindex="+_92+"&iq="+iq+"&lq="+this.lq+"&inputcity="+_93;
URL=youdao.maps.basis.utils.encodeUrlStr(URL);
this.searchURL(URL);
};
this.search=function(_95,to,_97,_98,_99,iq,_9b){
this.goSearch(_95,to,_97,_98,_99,iq,0,0,0,_9b);
};
this.searchURL=function(url){
this.URL="searchtype=bus&"+url;
localSearch.searchURL(this.URL);
};
}
function showOrHide(div){
this.div=div;
if(this.div.style.display=="none"){
this.div.style.display="";
}else{
this.div.style.display="none";
}
}
function CitySelector(_9e,_9f,_a0){
this.curCitySpan=document.createElement("span");
this.div=document.createElement("div");
this.searchFunc=_9f;
this.parentDiv=_9e;
this.parentDiv.appendChild(this.div);
this.allCityBoolean=true;
if(_a0==true){
this.allCityBoolean=true;
}
if(_a0==false){
this.allCityBoolean=false;
}
this.refresh=function(_a1,_a2,_a3){
this.hide();
return;
if(_a3!=undefined){
if(_a3==true){
this.allCityBoolean=true;
}else{
if(_a3==false){
this.allCityBoolean=false;
}
}
}
this.city=_a1;
this.cityList=_a2;
this.div.className="left_city_info";
this.div.innerHTML="";
this.div.style.display="block";
this.table=document.createElement("table");
this.table.className="left_city_table";
this.tbody=document.createElement("tbody");
this.table.appendChild(this.tbody);
this.tr=document.createElement("tr");
this.tbody.appendChild(this.tr);
cityStr="\u5f53\u524d\u57ce\u5e02:"+this.city.bold();
if(this.city==undefined||this.city==""){
this.city="\u5168\u56fd";
cityStr="\u5f53\u524d\u57ce\u5e02:"+this.city.bold();
}
this.cityinfoTD=document.createElement("td");
this.cityinfoTD.innerHTML=cityStr;
this.cityinfoTD.width="55%";
this.cityinfoTD.className="text90";
this.allCountryTD=document.createElement("td");
this.allCountryTD.width="30%";
if(this.city=="\u5168\u56fd"){
this.allCityBoolean=false;
}
if(this.allCityBoolean){
this.allCityA=document.createElement("a");
this.allCityA.innerHTML="\u5728\u5168\u56fd\u67e5\u627e";
this.allCityA.style.align="right";
this.allCityA.selector=this;
this.allCityA.onclick=function(){
cLog("","search","allCountryLink");
this.selector.searchFunc("\u5168\u56fd");
};
this.allCityA.className="text75 linkhand";
this.allCountryTD.appendChild(this.allCityA);
}
this.modTD=document.createElement("td");
this.modTD.width="15%";
this.modifyA=document.createElement("a");
this.modifyA.innerHTML="\u4fee\u6539";
this.modifyA.className="text75 linkhand";
this.modTD.appendChild(this.modifyA);
this.moreCityDiv=document.createElement("div");
this.moreCityDiv.className="editinfo text75 lineheight20";
this.moreCityDiv.style.lineHeight="20px";
this.modifyA.ctrlDiv=this.moreCityDiv;
this.modifyA.onclick=function(){
showOrHide(this.ctrlDiv);
if(this.ctrlDiv.style.display=="none"){
this.innerHTML="\u4fee\u6539";
}else{
this.innerHTML="\u53d6\u6d88";
this.ctrlDiv.input.focus();
}
};
this.tr.appendChild(this.cityinfoTD);
this.tr.appendChild(this.allCountryTD);
this.tr.appendChild(this.modTD);
this.div.appendChild(this.table);
this.div.appendChild(this.moreCityDiv);
if(_a2!=undefined&&_a2.length>1){
for(i=0;i<_a2.length&&i<10;i++){
var _a4=document.createElement("a");
_a4.className="fixedlink";
_a4.innerHTML="<nobr>"+_a2[i]+"</nobr>";
_a4.selector=this;
_a4.onclick=function(){
cLog("","search","headCitySelectLink");
this.selector.searchFunc(this.v);
};
_a4.id="city"+i;
_a4.v=_a2[i];
_a4.style.paddingRight="9px";
this.moreCityDiv.appendChild(_a4);
}
}
this.input=document.createElement("input");
this.input.type="text";
this.input.selector=this;
this.input.className="editinput";
this.input.style.width="200px";
this.input.onkeydown=function(_a5){
var key;
if(window.event){
key=window.event.keyCode;
}else{
key=_a5.which;
}
if(key==13){
cLog("","search","headCitySelectButton");
this.selector.searchFunc(this.value);
}
};
this.button=document.createElement("input");
this.button.type="button";
this.button.value="\u786e\u5b9a";
this.button.selector=this;
this.button.onclick=function(){
cLog("","search","poiSelectorInput");
this.selector.searchFunc(this.selector.input.value);
};
this.inputdiv=document.createElement("div");
this.inputdiv.style.paddingTop="5px";
this.moreCityDiv.appendChild(this.inputdiv);
this.inputdiv.appendChild(this.input);
this.inputdiv.appendChild(this.button);
this.moreCityDiv.style.display="none";
this.moreCityDiv.input=this.input;
};
this.hide=function(){
this.div.style.display="none";
};
}
function PoiSelector(map,_a8,_a9,_aa,_ab,_ac,_ad){
this.poiList;
this.index;
this.map=map;
this.type=_a9;
this.searchFunc=_aa;
this.refineFunc=_ab;
this.div=document.createElement("div");
this.div.className="stardiv";
this.pointMark;
this.iconUrl="icon/micon.gif";
this.candiIconUrl="icon/micon.gif";
if(_ac.indexOf("start")>=0){
this.iconOffX=0;
this.miconOffX=0;
}else{
if(_ac.indexOf("end")>=0){
this.iconOffX=-27*2;
this.miconOffX=-41*2;
}else{
this.iconOffX=-27;
this.miconOffX=-41;
}
}
this.iconOffY=-45;
this.miconOffY=-70;
this.iconWidth=28;
this.miconWidth=40;
this.iconHeight=26;
this.miconHeight=36;
this.icon=new youdao.maps.Icon(new youdao.maps.GeoPoint(0,0),{"img":this.iconUrl,bgOffsetX:this.miconOffX+"px",bgOffsetY:this.miconOffY+"px","styles":{"width":this.miconWidth+"px","height":this.miconHeight+"px"}});
this.candiIcon=new youdao.maps.Icon(new youdao.maps.GeoPoint(0,0),{"img":this.candiIconUrl,bgOffsetX:this.miconOffX+"px",bgOffsetY:"0px","styles":{"width":"18px","height":"18px"}});
this.cMarker;
this.cDiv=_a8;
this.refresh=function(_ae,_af,_b0){
if(_ae==undefined||_ae==""){
this.div.style.display="none";
}else{
this.div.style.display="";
}
this.div.innerHTML="";
this.keyword=_ae;
this.poiList=_af;
this.index=_b0;
this.spanlist=new Array(_af.length);
this.headtable=document.createElement("table");
this.headtable.width="100%";
this.headtable.className="text75 linkhand";
this.headtbody=document.createElement("tbody");
this.headtr=document.createElement("tr");
this.headtbody.appendChild(this.headtr);
this.headtable.appendChild(this.headtbody);
this.imgTD=document.createElement("td");
this.img=document.createElement("div");
this.img.style.background="url("+this.iconUrl+") transparent no-repeat "+this.iconOffX+"px "+this.iconOffY+"px";
this.img.style.width=this.iconWidth+"px";
this.img.style.height=this.iconHeight+"px";
this.imgTD.appendChild(this.img);
this.imgTD.innerHTML+=this.type;
this.imgTD.width="10%";
this.nameP=document.createElement("span");
if(this.keyword!=undefined&&this.keyword!=""){
if(this.keyword.match("CIRCLE")||this.keyword.match("geo")){
this.nameP.innerHTML="<b>\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e</b>";
}else{
if(this.keyword.match("\\[ID\\]")){
this.nameP.innerHTML=_af[0].name.bold();
}else{
this.nameP.innerHTML=this.keyword.bold();
}
}
}else{
return;
}
if(this.keyword.match("geo")){
var _b1=this.keyword.replace("geo[","");
_b1=_b1.replace("]","");
var geo=_b1.split(",");
this.nameP.idx=_b0;
this.nameP.selector=this;
this.nameP.onclick=function(){
cLog("","click","poiSelectorFirst");
this.selector.showLocFunc(this.idx);
};
this.showGeoFunc(geo[0],geo[1]);
}else{
if(_af.length>0){
this.nameP.innerHTML+="&nbsp;&nbsp;<span class=\"infowenzi nowrap\">"+_af[_b0].location+"</span>";
this.nameP.idx=_b0;
this.nameP.selector=this;
this.nameP.onclick=function(){
cLog("","click","poiSelectorFirst");
this.selector.showLocFunc(this.idx,true,false,true);
};
this.showLocFunc(_b0);
}else{
this.nameP.innerHTML=this.nameP.innerHTML+"(\u6ca1\u6709\u627e\u5230)";
}
}
this.locTD=document.createElement("td");
this.locTD.width="67%";
this.locTD.appendChild(this.nameP);
this.modifyA=document.createElement("a");
this.moreDiv=document.createElement("div");
this.modifyA.innerHTML="\u4fee\u6539";
this.modifyA.selector=this;
this.modifyA.ctrlDiv=this.moreDiv;
this.moreDiv.className="editinfo";
this.modifyA.onclick=function(){
showOrHide(this.ctrlDiv);
if(this.ctrlDiv.style.display=="none"){
this.innerHTML="\u4fee\u6539";
}else{
this.innerHTML="\u53d6\u6d88";
this.ctrlDiv.input.focus();
}
if(this.selector.infowin){
this.selector.infowin.closeInfoWindow();
}
if(this.selector.candiMarker){
this.selector.candiMarker.setVisible(false);
}
};
this.modTD=document.createElement("td");
this.modTD.width="15%";
this.modTD.appendChild(this.modifyA);
this.headtr.appendChild(this.imgTD);
this.headtr.appendChild(this.locTD);
this.headtr.appendChild(this.modTD);
this.div.appendChild(this.headtable);
leng=_af.length;
this.moreTable=document.createElement("table");
this.moreTable.className="text75";
this.moreTbody=document.createElement("tbody");
this.moreTable.appendChild(this.moreTbody);
for(var i=1;i<leng;i++){
var _b4=document.createElement("tr");
this.moreTbody.appendChild(_b4);
_b4.idx=i;
_b4.selector=this;
_b4.onclick=function(){
cLog("","click","poiSelectorOption");
this.selector.showLocFunc(this.idx,true,true);
};
var _b5=document.createElement("td");
_b5.innerHTML="<a class=\"linkhand\">"+_af[i].name+"</a>";
_b5.className="leftpx linebottom";
_b5.width="50%";
var _b6=document.createElement("td");
_b6.innerHTML=_af[i].location;
_b6.className="linebottom infowenzi";
_b6.width="30%";
var _b7=document.createElement("td");
_b7.align="center";
_b7.className="linebottom";
var _b8=document.createElement("a");
_b8.innerHTML="\u786e\u8ba4";
_b8.cid=_af[i].id;
_b8.onclick=function(){
cLog("","search","poiSelectorOption");
_ab(this.cid);
};
_b7.appendChild(_b8);
_b7.width="20%";
_b4.appendChild(_b5);
_b4.appendChild(_b6);
_b4.appendChild(_b7);
}
var _b9=document.createElement("tr");
this.moreTbody.appendChild(_b9);
var _ba=document.createElement(document.all?"<td colspan='2'>":"td");
_ba.setAttribute("colspan",2);
var _bb=document.createElement("td");
this.input=document.createElement("input");
this.input.type="text";
this.input.className="editinput";
this.input.style.width="200px";
this.input.selector=this;
this.input.onkeydown=function(_bc){
if(window.event){
_bc=window.event;
}
if(_bc.keyCode==13){
this.selector.searchFunc(this.value);
}
};
_ba.appendChild(this.input);
this.button=document.createElement("input");
this.button.type="button";
this.button.value="\u786e\u5b9a";
this.button.selector=this;
this.button.onclick=function(){
cLog("","search","poiSelectorInput");
this.selector.searchFunc(this.selector.input.value);
};
_bb.appendChild(this.button);
_b9.appendChild(_ba);
_b9.appendChild(_bb);
this.moreTbody.appendChild(_b9);
this.moreDiv.style.display="none";
this.div.appendChild(this.moreDiv);
this.moreDiv.appendChild(this.moreTable);
this.moreDiv.input=this.input;
};
this.showLocFunc=function(idx,_be,_bf,_c0){
this.showGeoFunc(this.poiList[idx].lo,this.poiList[idx].la,_be,_bf,idx,_c0);
};
this.showGeoFunc=function(lo,la,_c3,_c4,idx,_c6){
var _c7=new youdao.maps.GeoPoint(lo,la);
var _c8;
if(_c4){
if(this.candiMarker==undefined){
this.candiMarker=new youdao.maps.Icon(_c7,{"img":this.candiIconUrl});
this.candiMarker=new youdao.maps.Icon(new youdao.maps.GeoPoint(0,0),{"img":this.candiIconUrl,bgOffsetX:"-97px",bgOffsetY:"0px","styles":{"width":"18px","height":"18px"}});
}
_c8=this.candiMarker;
}else{
if(this.cMarker==undefined){
this.cMarker=new youdao.maps.Icon(_c7,{"img":this.iconUrl});
this.cMarker=new youdao.maps.Icon(new youdao.maps.GeoPoint(0,0),{"img":this.iconUrl,bgOffsetX:this.miconOffX+"px",bgOffsetY:this.miconOffY+"px","styles":{"width":this.miconWidth+"px","height":this.miconHeight+"px"}});
this.cMarker.selector=this;
this.popFunc=function(){
var _c9=this.selector.poiList[this.selector.index].name;
if(_c9.match("geo")){
_c9="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
this.infowin=new youdao.maps.InfoBox(this.position,{"title":_c9});
this.infowin.setBrief("<div align='left'>\u4f4d\u7f6e\uff1a"+_c9+"<br>"+this.selector.poiList[this.selector.index].moreInfo+"</div>");
var _ca=this.selector.keyword;
if(_ca.match("geo")){
_ca="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
this.infowin.setTitle(_ca);
this.map.addOverlay(this.infowin);
};
this.cMarker.addEvent("click",this.popFunc);
}
_c8=this.cMarker;
}
this.map.addOverlay(_c8);
_c8.setPosition(_c7);
_c8.setVisible(true);
if(_c3==false){
return;
}
this.map.centerAndZoom(_c7,map.zoom);
if(_c6==true){
var _cb=this.poiList[idx].name;
if(_cb.match("geo")){
_cb="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
this.infowin=new youdao.maps.InfoBox(_c8.position,{"title":_cb});
this.infowin.setBrief("<div align='left'>\u4f4d\u7f6e\uff1a"+_cb+"<br>"+this.poiList[idx].moreInfo+"</div>");
var _cc=this.keyword;
if(_cc.match("geo")){
_cc="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
this.infowin.setTitle(_cc);
this.map.addOverlay(this.infowin);
}
};
this.appendTo=function(_cd){
this.cDiv=_cd;
this.cDiv.appendChild(this.div);
};
this.hide=function(){
this.div.style.display="none";
};
this.show=function(){
this.div.style.display="";
};
this.appendTo(this.cDiv);
}
var inputValue;
var localSearch;
var naviSearch;
var busSearch;
var cookieSearch;
var waitIcon;
var pageCap=10;
var pageNavi;
var setDefaultLoc;
var mapDiv;
var url="";
var map;
var range=1000;
var queryTerm="";
var center="";
var inputcity="";
var city="";
var citypara="";
var curPage=1;
var selObj;
var mapAreaObj;
var cDiv;
var rDiv;
var showCenterA;
var curCenterDiv;
var rangeDiv;
var moreCenterDiv;
var centerInfoDiv;
var fDiv,tDiv;
var curFromDiv,curToDiv,moreFromDiv,moreToDiv;
var setDefaultLocDiv;
var showFromsA,showTosA;
var from,to;
var fromIndex,toIndex;
var curSearchResult;
var type=0;
var state=0;
var polyCtrl;
var mapURL="";
var queryURL="";
var cookieVal="";
var pageNaviDiv;
var cityDiv;
var lastTab=0;
var lastBusDiv;
var minimap,mdiv;
var mapparentDiv,rightDiv,introDiv,leftDiv;
var cookieValue={};
var suggestDiv,adminSuggestDiv;
var inputBox,fromBox,toBox,cityBox,centerBox,qBox,fLeftBox,tLeftBox;
var inputSg,fromSg,toSg,citySg,centerSg,qSg,fLeftSg,tLeftSg;
var resultType=-1;
var sa,sb,sc;
var feedBackA;
var curMapPosition;
var cpDiv;
var citySelector;
function resizeCurMap(){
resizeMap(map,mapDiv,mapparentDiv,rightDiv,leftDiv);
}
function getSearchUrl(_ce,_cf,_d0){
var url="http://"+_cf+".youdao.com/";
if(window.RegExp&&window.encodeURIComponent){
var _d2="";
if(inputBox){
_d2=inputBox.value;
}
if(_d2!=""){
_d2=_d2.replace(/(^link:)|(^inlink:)|(^related:)/,"");
url=url+"search?q="+_d2+"&keyfrom="+_d0;
url=youdao.maps.basis.utils.encodeUrlStr(url);
}
}
return url;
}
function searchURL(_d3){
youdao.maps.basis.Log.log("searchURL() para: "+_d3);
if(_d3!=null&&(_d3.indexOf("q=")>=0||_d3.indexOf("to=")>=0||_d3.indexOf("inputcity=")>=0)){
url=_d3;
localSearch.searchURL(_d3);
youdao.maps.basis.Log.log("true! url: "+_d3);
}else{
showCookieLocation(cookieVal);
mapDiv.style.display="";
saveHistory(_d3);
youdao.maps.basis.Log.log("false! url: "+_d3);
}
}
function onLoad(_d4){
if(document.getElementById("menuMore")){
initMorePop();
}
mapparentDiv=document.getElementById("contentDiv");
mapparentDiv.style.display="block";
rightDiv=document.getElementById("rightDiv");
mapDiv=document.getElementById("mapDiv");
mapDiv.style.display="block";
leftDiv=document.getElementById("leftDiv");
introDiv=document.getElementById("introDiv");
map=mapinit("mapDiv");
fromIndex=0;
toIndex=0;
inputBox=document.getElementById("place");
fromBox=document.getElementById("fromplace");
toBox=document.getElementById("toplace");
waitIcon=new waitIcon(0.5,0.5);
localSearch=new LocalSearcher(display,wait);
naviSearch=new NaviSearcher(display,wait);
busSearch=new BusSearcher(display,wait,null);
feedBackA=document.getElementById("feedBackA");
mapAreaObj=document.getElementById("maprange");
selObj=document.getElementById("range");
cDiv=document.getElementById("curCenterDiv");
curCenterDiv=document.getElementById("curCenterDiv");
rDiv=document.getElementById("resultDiv");
moreCenterDiv=document.getElementById("moreCenterDiv");
showCenterA=document.getElementById("more");
centerInfoDiv=document.getElementById("centerInfo");
showFromsA=document.getElementById("showFrom");
showTosA=document.getElementById("showTo");
fDiv=document.getElementById("fromDiv");
tDiv=document.getElementById("toDiv");
curFromDiv=document.getElementById("curFromDiv");
curToDiv=document.getElementById("curToDiv");
moreFromDiv=document.getElementById("moreFromDiv");
moreToDiv=document.getElementById("moreToDiv");
setDefaultLocDiv=document.getElementById("setDefaultLocDiv");
suggestDiv=document.getElementById("suggestDiv");
adminSuggestDiv=document.getElementById("adminSuggestDiv");
window.onresize=resizeCurMap;
pageNavi=new pageNavi("pageNaviDiv",pageCap,5,"gotoPage");
pageNaviDiv=document.getElementById("pageNaviDiv");
cityDiv=document.getElementById("cityDiv");
centerSelector=new PoiSelector(map,curCenterDiv,"",changeCenterSearch,refineCenterSearch,"icon/center.gif","icon/marker.gif");
fromSelector=new PoiSelector(map,fDiv,"",changeFromSearch,refineFromSearch,"icon/start.gif","icon/marker.gif");
toSelector=new PoiSelector(map,tDiv,"",changeToSearch,refineToSearch,"icon/end.gif","icon/marker.gif");
citySelector=new CitySelector(cityDiv,changeCity);
cookieVal=document.getElementById("mapCookie").innerHTML;
setDefaultLoc=new SetDefaultLocDiv("setDefaultLocDiv");
getCookieCity(cookieVal);
var _d5=false;
if(top.location.hash.indexOf("q=")>0||top.location.hash.indexOf("from=")>0){
_d5=true;
}
if(_d4==undefined||_d4==""||_d5){
_d4=top.location.hash;
youdao.maps.basis.Log.log("urlpara2:"+_d4);
var _d6=_d4.split("#");
if(_d6.length==2){
_d4=_d6[1];
youdao.maps.basis.Log.log("urlpara3:"+_d4);
}
}
updataCityNavi("000000",false);
resizeMap(map,mapDiv,mapparentDiv,rightDiv,leftDiv);
_d4=youdao.maps.basis.utils.encodeUrlStr(_d4);
searchURL(_d4);
}
function getCookieCity(_d7){
if(_d7!=undefined&&_d7.indexOf(",")>0){
var _d8=_d7.split(",");
var _d9;
if(_d8.length>4){
_d9=_d8[4].replace(/(^\s*)|(\s*$)/g,"");
}
cookieValue.code=_d9;
return _d9;
}
}
function showCookieLocation(_da){
if(_da!=undefined&&_da.indexOf(",")>0){
var _db=_da.split(",");
var _dc=_db[0];
var lo=_db[1];
var la=_db[2];
var _df=_db[3];
var _e0;
if(_db.length>4){
_e0=_db[4].replace(/(^\s*)|(\s*$)/g,"");
searchCity(_e0);
cookieValue.code=_e0;
return;
}
var _e1=new youdao.maps.GeoPoint(lo,la);
map.centerAndZoom(_e1,_df);
var _e2="";
_dc=_dc.replace(/(^\s*)|(\s*$)/g,"");
if(_dc!=undefined&&_dc!=""&&_dc){
dPlaceA=document.createElement("div");
dPlaceA.className="area_div";
dPlaceA.style.padding="10px 0 10px 7px";
dPlaceA.innerHTML=_dc.bold();
city=_dc;
rDiv.innerHTML="";
rDiv.appendChild(dPlaceA);
setDefaultLoc.showRemoveLocResult();
}
}else{
showDefaultMap(map);
}
}
function showDefaultMap(map){
map.removeAllMark();
rDiv=document.getElementById("resultDiv");
rDiv.innerHTML="";
if(citySelector!=null){
centerSelector.hide();
fromSelector.hide();
toSelector.hide();
citySelector.hide();
pageNavi.hide();
}
var _e4="xian";
var pts=[];
var p=new youdao.maps.GeoPoint(13600000,5400000);
pts.push(p);
p=new youdao.maps.GeoPoint(7300000,5400000);
pts.push(p);
p=new youdao.maps.GeoPoint(13600000,1700000);
pts.push(p);
p=new youdao.maps.GeoPoint(7300000,1700000);
pts.push(p);
map.getBestView(pts);
document.getElementById("introDiv").style.display="block";
mapURL="";
}
function wait(){
var _e7=new Date().getTime();
function wt(){
waitIcon.wait(_e7);
}
setTimeout(wt,300);
}
function changeRadis(_e8){
range=_e8;
curPage="";
if(queryTerm!=""){
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
}
function golocalSearch(_e9){
if(_e9!=undefined&&_e9!=""){
this.box.value=_e9;
}
hideSuggest();
inputValue=to=document.getElementById("place").value;
if(inputValue.trim()!=""){
queryTerm=inputValue;
curPage="";
localSearch.search(queryTerm,"",city,curPage,"",inputValue,range,inputcity);
}else{
document.location="/";
}
}
function goBusSearch(_ea){
if(_ea!=undefined&&_ea!=""){
this.box.value=_ea;
}
hideSuggest();
fromvalue=document.getElementById("from").value;
if(fromvalue.trim()!="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e"){
from=fromvalue;
}
tovalue=document.getElementById("to").value;
if(tovalue.trim()!="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e"){
to=tovalue;
}
if(from.trim()!=""&&to.trim()!=""){
fromIndex=0;
toIndex=0;
busSearch.goSearch(from,to,city,"","","",fromIndex,toIndex,0,inputcity);
}else{
changeTab(1);
}
}
function goNaviSearch(_eb){
if(_eb!=undefined&&_eb!=""){
this.box.value=_eb;
}
hideSuggest();
fromvalue=document.getElementById("from").value;
if(fromvalue.trim()!="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e"){
from=fromvalue;
}
tovalue=document.getElementById("to").value;
if(tovalue.trim()!="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e"){
to=tovalue;
}
if(from.trim()!=""&&to.trim()!=""){
fromIndex=0;
toIndex=0;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}else{
changeTab(2);
}
}
var suggests=["\u6539\u53d8\u4e0a\u65b9\u7684\u641c\u7d22\u8303\u56f4\uff0c\u5728\u66f4\u5927\u8303\u56f4\u5185\u641c\u7d22","\u68c0\u67e5\u8f93\u5165\u662f\u5426\u5b58\u5728\u62fc\u5199\u9519\u8bef","\u5728\u7f51\u9875\u641c\u7d22\u4e2d\u67e5\u627e"];
function giveErrorSuggestion(_ec){
var _ed=document.createElement("div");
_ed.style.padding="3px 7px 3px 7px";
_ed.className="text85";
_ed.innerHTML="\u60a8\u53ef\u4ee5\u5c1d\u8bd5\uff1a";
rDiv.appendChild(_ed);
var ul=document.createElement("ul");
ul.style.fontSize="75%";
ul.style.paddingLeft="20px";
ul.style.marginLeft="0px";
ul.style.paddingRight="7px";
var err=_ec.errCode;
var _f0=_ec.city.trim();
if(_ec.keyword){
kw=_ec.keyword.trim();
}
kw=kw.replace(new RegExp("<","gm")," ");
kw=kw.replace(new RegExp(">","gm")," ");
if(_f0&&_f0!=""&&_f0!="\u5168\u56fd"&&kw!=""){
var _f1=document.createElement("li");
_f1.innerHTML="\u5728\u5168\u56fd\u67e5\u627e<a onclick='changeCity(\"000000\")'>"+kw+"</a>";
ul.appendChild(_f1);
}
for(var i=0;i<suggests.length;i++){
var li=document.createElement("li");
li.innerHTML=suggests[i];
if(suggests[i].indexOf("\u7f51\u9875\u641c\u7d22")>0&&kw!=""){
li.innerHTML+="<a href='http://www.youdao.com/search?q="+encodeURIComponent(kw)+"' target='_blank'>"+kw+"</a>";
}
ul.appendChild(li);
}
rDiv.appendChild(ul);
}
function code2str(_f4){
if(adminjson==undefined){
return _f4;
}
if(_f4==undefined||_f4.length==undefined||_f4.length!=6){
return _f4;
}
var obj=adminjson;
var _f6;
for(var i=0;i<3;i++){
_f6=_f4.substr(i*2,2);
obj=obj[_f6];
if(obj==undefined){
return _f4;
}
if(obj["__code__"]==_f4){
return obj["__name__"];
}
}
var str=obj["__name__"];
if(str==undefined){
return _f4;
}
return str;
}
function showErrMsgPage(_f9){
if(!map.refererCoord||map.refererCoord==null){
showCookieLocation(cookieVal);
mapDiv.style.display="";
return;
}
pageNaviDiv.style.display="none";
var _fa=_f9.resultType;
var _fb=document.createElement("div");
_fb.className="text90";
_fb.style.padding="10px 7px 10px 7px";
if(_fa==1||_fa==4){
var kw=curSearchResult.keyword;
if(kw.match("geo")){
kw="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
var _fd=curSearchResult.city;
var _fe=curSearchResult.center;
if(_fe.match("geo")){
_fe="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
kw=kw.replace(new RegExp("<","gm")," ");
kw=kw.replace(new RegExp(">","gm")," ");
if(_fe!=undefined&&_fe!=""){
_fe=_fe.replace(new RegExp("<","gm")," ");
_fe=_fe.replace(new RegExp(">","gm")," ");
}
var _ff="";
if(_fd!=undefined&&_fd!=""){
_ff+="\u62b1\u6b49\uff0c\u5728<b>"+code2str(_fd)+"</b>";
if(_fe!=undefined&&_fe!=""){
_ff+="\u7684<b>"+_fe+"</b>\u9644\u8fd1";
}
_ff+="\u672a\u627e\u5230<b>"+kw+"</b>";
}else{
_ff+="\u62b1\u6b49\uff0c";
if(_fe!=undefined&&_fe!=""){
_ff+="\u5728<b>"+_fe+"</b>\u9644\u8fd1";
}
_ff+="\u672a\u627e\u5230<b>"+kw+"</b>";
}
_fb.innerHTML=_ff;
rDiv.appendChild(_fb);
giveErrorSuggestion(_f9);
}else{
if(_f9.errCode==2&&_f9.fromPoiResults.poiList.size>0&&_f9.toPoiResults.poiList.size>0){
rDiv.innerHTML="";
showBusPointSelPage(rDiv,_f9);
}else{
_fb.innerHTML=_f9.errMsg.bold();
rDiv.appendChild(_fb);
}
}
rDiv.style.display="";
}
function firstPageClick(word){
cLog(word,"search","frontPageLink");
localSearch.search(word,"",city,"","","",range,word,"keyfrom=frontPageLink&admin=true");
}
function localsearchSuggestion(_101){
localSearch.search(_101,"",city,"","",_101,range,inputcity);
}
function localsearchAdminSuggestion(_102,term){
if(!term||term==""){
localSearch.search(_102,"",city,"","","",range,_102,"keyfrom=adminSuggest&admin=true");
}else{
localSearch.search(term,"",city,"","","",range,_102,"keyfrom=adminSuggest");
}
}
function showJumpRecommend(_104){
var _105=_104.suggestJumpCityCode;
var _106=_104.suggestJumpCityTxt;
if(!_105){
return;
}
var _107=_104.suggestJumpAdminTxt;
var _108=_104.suggestJumpAdminCode;
var _109="";
if(_107&&_108!=_105){
_109=_106.bold()+"\u7684<a href=\"javascript:void(0);\" onclick=\"javascript:localsearchAdminSuggestion('"+_105+"','"+_107+"');\">"+_107+"</a>";
}else{
_109="<a href=\"javascript:void(0);\" onclick=\"javascript:localsearchAdminSuggestion('"+_105+"');\">"+_106+"</a>";
}
adminSuggestDiv.className="text90";
adminSuggestDiv.innerHTML="\u524d\u5f80"+_109;
adminSuggestDiv.style.display="";
adminSuggestDiv.style.backgroundColor="#D0DFF4";
adminSuggestDiv.style.padding="7px 4px";
}
function showRecommend(_10a){
var _10b="<a href=\"javascript:void(0);\" onclick=\"javascript:localsearchSuggestion('"+_10a+"');\"/>"+_10a;
suggestDiv.className="text90";
suggestDiv.innerHTML="\u60a8\u8981\u627e\u7684\u662f\u4e0d\u662f: "+_10b;
suggestDiv.style.display="";
}
function setFeedBackLink(){
var link="http://feedback.youdao.com/quality_report.jsp?q=@#q&prodtype=mapsearch&url=@#url&email=@#email&cmt=@#cmt";
var q="",url="";
if(curSearchResult&&(curSearchResult.resultType==1||curSearchResult.resultType==4)){
q+="\u5730\u56fe\u641c\u7d22\uff1a";
var city=curSearchResult.city;
if(city&&city.trim()!=""){
q+=city;
q+=" ";
}
var _110=curSearchResult.center;
if(_110&&_110.trim()!=""){
q+=_110;
q+=" ";
}
var _111=curSearchResult.keyword;
if(_111&&_111.trim()!=""){
q+=_111;
}
}else{
if(curSearchResult){
if(curSearchResult.resultType==2){
q+="\u516c\u4ea4\u7ebf\u8def\uff1a";
}else{
if(curSearchResult.resultType==3){
q+="\u884c\u8f66\u7ebf\u8def\uff1a";
}
}
var city=curSearchResult.city;
if(city&&city.trim()!=""){
q+=city;
q+=" ";
}
var from=curSearchResult.from;
if(from&&from.trim()!=""){
if(curSearchResult.resultType==2){
q+="\u516c\u4ea4";
}
q+="\u4ece";
q+=from;
}
var to=curSearchResult.to;
if(to&&to.trim()!=""){
q+="\u5230";
q+=to;
}
}
}
url=encodeURIComponent("http://"+window.location.host+window.location.pathname+"?"+mapURL);
eq=encodeURIComponent(q);
cmt=encodeURIComponent("\u6211\u89c9\u5f97\u201c"+q+"\u201d\u7684\u7ed3\u679c\u4e0d\u7406\u60f3\uff0c\u539f\u56e0\u5982\u4e0b\uff1a");
email="";
if(document.getElementById("uID")){
email=document.getElementById("uID").innerHTML;
}
link=link.replace("@#q",eq);
link=link.replace("@#url",url);
link=link.replace("@#email",email);
link=link.replace("@#cmt",cmt);
feedBackA.href=link;
}
function giveTypoSuggestion(){
var _114=curSearchResult.guessquery;
if(_114!=undefined&&_114!=""){
showRecommend(_114);
}else{
if(curSearchResult.typoSuggest!=undefined){
var typo=curSearchResult.typoSuggest;
var _116=curSearchResult.typoSuggest.recommend;
if(_116!=undefined&&_116!=""){
showRecommend(_116);
}
}
}
if(curSearchResult.jumpSuggest!=undefined){
if(curSearchResult.jumpSuggest.suggestJumpCityCode!=curSearchResult.city){
showJumpRecommend(curSearchResult.jumpSuggest);
}
}
}
function display(_117){
waitend();
document.getElementById("feedbackDiv").style.display="block";
mapDiv.style.display="";
cDiv.style.display="none";
suggestDiv.style.display="none";
adminSuggestDiv.style.display="none";
introDiv.style.display="none";
setDefaultLocDiv.style.display="none";
curSearchResult=_117;
rDiv.innerHTML="";
giveTypoSuggestion();
map.removeAllMark();
if(curSearchResult&&curSearchResult.city!=undefined&&curSearchResult.city!=""){
inputcity=curSearchResult.city;
if(_117.tag>0){
updataCityNavi(curSearchResult.city);
}else{
updataCityNavi(curSearchResult.city,false);
}
updateSuggests();
}
resultType=_117.resultType;
if(_117.resultType==3){
from=_117.from;
to=_117.to;
fromValue=from;
if(fromValue.match("geo")){
fromValue="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
fromCity=_117.fromPoiResults.city;
toValue=to;
if(toValue.match("geo")){
toValue="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
toCity=_117.toPoiResults.city;
if(inputBox!=null){
inputBox.value="\u4ece"+fromValue+"\u5230"+toValue;
}
fromIndex=_117.fromIndex;
toIndex=_117.toIndex;
cDiv.style.display="none";
cityDiv.style.display="";
fDiv.style.display="";
tDiv.style.display="";
cityDiv.style.display="";
changeTab(2);
showNaviResult(_117,map,fromIndex,toIndex);
pageNaviDiv.style.display="none";
}else{
if(_117.resultType==2){
from=_117.from;
to=_117.to;
fromIndex=_117.fromIndex;
toIndex=_117.toIndex;
city=_117.city;
fromValue=from;
if(fromValue.match("geo")){
fromValue="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
toValue=to;
if(toValue.match("geo")){
toValue="\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e";
}
if(inputBox!=null){
inputBox.value="\u4ece"+fromValue+"\u5230"+toValue;
}
changeTab(1);
showBusResult(_117,map,fromIndex,toIndex);
cDiv.style.display="none";
cityDiv.style.display="";
fDiv.style.display="";
tDiv.style.display="";
cityDiv.style.display="";
pageNaviDiv.style.display="none";
}else{
fDiv.style.display="none";
tDiv.style.display="none";
cDiv.style.display="none";
cityDiv.style.display="none";
city=_117.city;
center=_117.center;
queryTerm=_117.keyword;
var _118=queryTerm;
if(center!=undefined&&center!=""){
_118=center+" "+_118;
}
changeTab(0);
showPoint(map,_117,cDiv,rDiv);
}
}
boxEventRefresh(_117.resultType-1);
suggestRefresh(_117.resultType-1);
if(_117.mapLevel>-1){
map.centerAndZoom(map.geoCenter,_117.mapLevel);
}
if(_117.centerlo>-1&&_117.centerla>-1){
var p=new youdao.maps.GeoPoint(_117.centerlo,_117.centerla);
map.centerAndZoom(p,map.zoom);
}
callSave(_117.resultType-1);
setFeedBackLink();
saveCurMapPosition();
}
function saveCurMapPosition(){
if(curMapPosition==undefined||curMapPosition==null){
curMapPosition=new Object();
}
var c=map.geoCenter;
curMapPosition.lo=c.lo;
curMapPosition.la=c.la;
curMapPosition.zoom=map.zoom;
}
function waitend(){
waitIcon.waitend();
hideSuggest();
}
function hideSuggest(){
if(sa){
sa.hide();
}
if(sb){
sb.hide();
}
if(sc){
sc.hide();
}
}
function localSearchAnotherCity(_11b){
inputcity=_11b;
if(curSearchResult!=undefined&&curSearchResult.keyword!=undefined&&curSearchResult.keyword.trim()!=""){
queryTerm=curSearchResult.keyword;
}else{
if(document.getElementById("place")!=undefined){
inputValue=document.getElementById("place").value;
queryTerm=inputValue;
}
}
curPage="";
queryTerm=inputValue;
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
function showPoint(map,_11d,cDiv,rDiv){
if(_11d.poiList.length>0){
map.removeAllMark();
var tag=parseInt(_11d.tag);
if(tag>0){
var _121=document.createElement("div");
_121.className="area_div";
_121.style.padding="10px 0 5px 7px";
_121.innerHTML=_11d.poiList[0].name.bold();
rDiv.innerHTML="";
rDiv.appendChild(_121);
pageNaviDiv.style.display="none";
youdao.maps.basis.Log.log(cookieValue.code+","+_11d.city);
if(cookieValue.code==_11d.city){
setDefaultLoc.showRemoveLocResult();
}else{
setDefaultLoc.showSetDefaultLoc();
}
setDefaultLocDiv.style.display="";
var _122=new youdao.maps.GeoPoint(_11d.poiList[0].lo,_11d.poiList[0].la);
introDiv.style.display="";
map.centerAndZoom(_122,tag);
}else{
var _123=[];
for(var k=0;k<_11d.poiList.length;k++){
var _122=new youdao.maps.GeoPoint(_11d.poiList[k].lo,_11d.poiList[k].la);
_123.push(_122);
}
map.getBestView(_123);
citySelector.refresh(city,_11d.resultCityList,true);
setDefaultLocDiv.style.display="none";
if(_11d.center!=undefined&&_11d.center!=""){
centerSelector.refresh(_11d.center,_11d.centerList,0);
cDiv.style.display="";
}
rDiv.innerHTML="";
var _125=document.createElement("div");
_125.className="text75 divheight30";
_125.innerHTML="\u5173\u4e8e<span class=\"red\">"+_11d.keyword.bold()+"</span>[ \u5171"+_11d.resultNum+"\u7ed3\u679c\uff0c\u7b2c"+_11d.curPage+"\u9875]";
rDiv.appendChild(_125);
addResultInfoList(_11d.poiList,map,rDiv,false,false,"");
showPage(_11d.curPage,_11d.resultNum);
cityDiv.style.display="";
}
}else{
if(curSearchResult.errCode!=0){
showErrMsgPage(curSearchResult);
resultType=-1;
}
}
}
function showPage(_126,_127){
pageNavi.showPageNavi(_126,_127);
pageNaviDiv.style.display="";
}
var resultInfoWin=[];
var curInfoWin;
function showResultPop(i){
map.removeOverlay(curInfoWin);
curInfoWin=resultInfoWin[i];
map.addOverlay(curInfoWin);
curInfoWin.moveToShow();
}
function callbackResultPop(_129){
curInfoWin=_129.openInfoWinHtml(_129.infoStr);
}
function busSomePlaceFromCurPoi(from,to){
fromIndex=0;
toIndex=0;
busSearch.goSearch(from,to,city,"","","",fromIndex,toIndex,0,inputcity);
}
function naviSomePlaceFromCurPoi(from,to){
fromIndex=0;
toIndex=0;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
function setCurrentZoom(lo,la,zoom){
var pt=new youdao.maps.GeoPoint(lo,la);
map.centerAndZoom(pt,zoom);
}
function setPoiMenuFuncDiv(_132,i,_134){
var _135=document.getElementById("poiMenuFuncDiv");
var html="<table>";
if(_132=="\u5468\u8fb9"){
html+="<tr><td><font size=-1>\u5728\u9644\u8fd1\u641c\u7d22:<br><input class=\"editinput\" id=s"+i+" type=text value=\"\" size=8 onKeyDown=\"javascript:var event=document.all?window.event:arguments[0];if(event.keyCode==13){searchAround("+i+",\t\t\t\tdocument.getElementById('s"+i+"').value);}\"/><input type=button value=\"\u641c\u7d22\" \t\t\t\tonclick=\"javascript:searchAround("+i+",document.getElementById('s"+i+"').value);\"/>\t\t\t\t</font></td></tr>";
}else{
if(_132=="\u524d\u5f80\u6b64\u5730"){
html+="<tr><td><font size=-1>\u4ece<input  class=\"editinput\" id=to"+i+" type=text value=\"\" size=8\t\t\t\tonKeyDown=\"var event=document.all?window.event:arguments[0];if(event.keyCode==13 ){busSomePlaceFromCurPoi(document.getElementById('to"+i+"').value, '"+_134+"');}\">\t\t\t\t\u524d\u5f80\u6b64\u5730\t\t\t\t<input type=button value=\"\u516c\u4ea4\" onclick=\"javascript:busSomePlaceFromCurPoi(document.getElementById('to"+i+"').value, '"+_134+"');\">\t\t\t\t<input type=button value=\"\u9a7e\u8f66\" onclick=\"javascript:naviSomePlaceFromCurPoi(document.getElementById('to"+i+"').value, '"+_134+"');\">\t\t\t\t</font></td></tr>";
}else{
if(_132=="\u4ece\u6b64\u5730\u51fa\u53d1"){
html+="<tr><td><font size=-1>\u4ece\u6b64\u5730\u51fa\u53d1\u53bb<input class=\"editinput\" id=from"+i+" type=text value=\"\" size=8\t\t\t\tonKeyDown=\"javascript:var event=document.all?window.event:arguments[0];if(event.keyCode==13){busSomePlaceFromCurPoi('"+_134+"', document.getElementById('from"+i+"').value);}\">\t\t\t\t<input type=button value=\"\u516c\u4ea4\" onclick=\"busSomePlaceFromCurPoi('"+_134+"', document.getElementById('from"+i+"').value)\">\t\t\t\t<input type=button value=\"\u9a7e\u8f66\" onclick=\"naviSomePlaceFromCurPoi('"+_134+"', document.getElementById('from"+i+"').value)\">\t\t\t\t</font></td></tr>";
}
}
}
html+="</table>";
_135.innerHTML=html;
}
function makeInfoStr_2(_137,i,flag){
var _13a=_137[i];
var _13b=new youdao.maps.GeoPoint(_13a.longitude,_13a.latitude);
var _13c=_13a.id;
var str="<table>";
str+="<tr><td><b>"+_13a.name+"</b><a href=\"javascript:void(0);\" onclick=\"javascript:showPoiDetail("+i+");\">\u5c55\u5f00/\u9690\u85cf\u66f4\u591a</a></td></tr>";
if(!(flag<0)){
str+="<tr><td><font size=-1>"+_137[i].moreInfo;
str+="</font></td></tr>";
str+="<tr>";
str+="<td><a href=\"javascript:void(0);\" onclick=\"javascript:setPoiMenuFuncDiv('\u5468\u8fb9',"+i+",'"+_13c+"');\">\u5468\u8fb9</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:setPoiMenuFuncDiv('\u524d\u5f80\u6b64\u5730',"+i+",'"+_13c+"');\">\u524d\u5f80\u6b64\u5730</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:setPoiMenuFuncDiv('\u6b64\u5730\u51fa\u53d1',"+i+",'"+_13c+"');\">\u6b64\u5730\u51fa\u53d1</a></td>";
str+="</tr>";
str+="<tr><td>";
str+="<div id=\"poiMenuFuncDiv\" style=\"height:22px;width:250px;\"></div>";
str+="</td></tr>";
str+="<tr>";
str+="<td>\u7f29\u653e\u5230:<a href=\"javascript:void(0);\" onclick=\"javascript:{setCurrentZoom("+_13a.longitude+","+_13a.latitude+",13);}\">\u5168\u56fd</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:{setCurrentZoom("+_13a.longitude+","+_13a.latitude+",10);}\">\u7701\u4efd</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:{setCurrentZoom("+_13a.longitude+","+_13a.latitude+",6);}\">\u57ce\u5e02</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:{setCurrentZoom("+_13a.longitude+","+_13a.latitude+",3);}\">\u533a/\u9547</a>&nbsp;";
str+="<a href=\"javascript:void(0);\" onclick=\"javascript:{setCurrentZoom("+_13a.longitude+","+_13a.latitude+",0);}\">\u8857\u9053</a></td>";
str+="</tr>";
}else{
str+="<iframe src=\"detail?id="+_137[i].id+"\" width=500 height=300/>";
}
return str;
}
function makeInfoStr(poi){
return poi.moreInfo;
}
function showPoiDetail(i){
var flag=resultInfoWin[i].flag*(-1);
resultInfoWin[i].flag=flag;
resultInfoWin[i].setLabel(makeInfoStr_2(localSearch.searchResult.poiList,i,flag));
resultInfoWin[i].moveToShow();
}
function winFunc(_141){
return function(){
map.centerAndZoom(new youdao.maps.GeoPoint(_141.poi.lo,_141.poi.la),map.zoom);
if(_141.poi.type!=3){
var _142=generateInfoDiv(_141.poi,_141);
var _143=new youdao.maps.InfoBox(new youdao.maps.GeoPoint(_141.poi.lo,_141.poi.la));
_143.setBrief(_142);
_141.infowin=_143;
}else{
var _143=new youdao.maps.InfoBox(new youdao.maps.GeoPoint(_141.poi.lo,_141.poi.la));
_143.setBrief(mdiv);
minimap.centerAndZoom(new youdao.maps.GeoPoint(_141.poi.lo,_141.poi.la),1);
}
if(curInfoWin){
curInfoWin.setVisible(false);
curInfoWin=_143;
}
map.addOverlay(_143);
if(_141.poi.type!=2){
_143.setTitle(_141.poi.name);
}else{
_143.setTitle("<img src='icon/bus_m.gif'/>&nbsp;"+_141.poi.moreInfo);
}
};
}
function addResultInfoList(_144,map,rDiv,_147,_148,mdiv){
var _14a=document.createElement("table");
_14a.style.width="100%";
_14a.cellPadding="0";
_14a.cellSpacing="0";
rDiv.appendChild(_14a);
var _14b=document.createElement("tbody");
_14a.appendChild(_14b);
_14a.style.cellPadding="0";
for(var i=0;i<_144.length;i++){
addResultInfo(_144[i],map,_14b,_147,_148,mdiv);
}
}
function addResultInfo(poi,map,rDiv,_150,_151,mdiv){
poi.iconId=(poi.iconId-1)%10+1;
var _153=new youdao.maps.GeoPoint(poi.lo,poi.la);
if(poi.type==4){
var _154="icon/aj.gif";
iconWidth=20;
iconHeight=20;
iconOffX=-((poi.iconId-1)*20);
iconOffY=0;
miconWidth=20;
miconHeight=25;
miconOffX=-((poi.iconId-1)*20);
miconOffY=-20;
}
if(poi.type==2){
var _154="icon/micon.gif";
iconWidth=20;
iconHeight=20;
miconWidth=28;
miconHeight=25;
iconOffY=-25;
miconOffY=-190;
if(poi.iconId==1){
iconOffX=0;
miconOffX=0;
}else{
iconOffX=-20;
miconOffX=0;
}
}
if(poi.type==3){
var _154="icon/turn.gif";
iconWidth=20;
iconHeight=20;
miconWidth=43;
miconHeight=40;
iconOffY=0;
miconOffY=-20;
if(poi.iconId==0){
poi.iconId+=1;
}
if(poi.iconId>9){
poi.iconId=9;
}
if(poi.name.indexOf("\u5230\u8fbe\u76ee\u7684\u5730")>=0){
poi.iconId=10;
}
iconOffX=-20*(poi.iconId-1);
miconOffX=-44*(poi.iconId-1)-1;
}
if(_151==true){
var _155=new youdao.maps.Icon(_153,{"img":_154,bgOffsetX:miconOffX+"px",bgOffsetY:miconOffY+"px","styles":{"width":miconWidth+"px","height":miconHeight+"px"}});
map.addOverlay(_155);
_155.setVisible(false);
}else{
var _155=new youdao.maps.Icon(_153,{"img":_154,bgOffsetX:miconOffX+"px",bgOffsetY:miconOffY+"px","styles":{"width":miconWidth+"px","height":miconHeight+"px"}});
map.addOverlay(_155);
}
var _156=makeInfoStr(poi);
map.addOverlay(_155);
if(mdiv!=undefined&&mdiv!=""){
var _157=new youdao.maps.Icon(_153,{"img":_154,bgOffsetX:miconOffX+"px",bgOffsetY:miconOffY+"px","styles":{"width":miconWidth+"px","height":miconHeight+"px"}});
minimap.addOverlay(_157);
}
_155.poi=poi;
var _158=document.createElement("tr");
_158.className="left_oneresult_div";
_158.onmouseover=function(){
this.defaultbgcolor=this.style.backgroundColor;
this.style.backgroundColor="#D9E5F6";
};
_158.onmouseout=function(){
this.style.backgroundColor=this.defaultbgcolor;
};
var icon=document.createElement("div");
icon.style.width=iconWidth;
icon.style.height=iconHeight;
icon.style.background="transparent url("+_154+") no-repeat scroll "+iconOffX+"px "+iconOffY+"px";
_155.poi.icon=icon.cloneNode(true);
if(poi.type==4){
var poiA=document.createElement("a");
poiA.className="text85";
}else{
var poiA=document.createElement("font");
poiA.className="text75";
}
poiA.innerHTML=poi.name;
poiA.map=map;
poiA.marker=_155;
_155.dom.poiA=poiA;
_155.dom.addEvent("click",function(e){
this.poiA.onclick(e);
});
poiA.onclick=function(){
cLog("type_"+poi.type,"click",poi.iconId);
if(poi.type==4){
_154="icon/p"+poi.iconId+".gif";
}else{
_154="icon/bus"+poi.iconId+".gif";
}
this.map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
if(poi.type==3){
var _15c=new youdao.maps.InfoBox(new youdao.maps.GeoPoint(poi.lo,poi.la));
_15c.setBrief(mdiv);
_15c.setStyles({"width":(youdao.maps.basis.utils.getSize(mdiv).width+30)+"px"});
if(curInfoWin){
curInfoWin.setVisible(false);
}
curInfoWin=_15c;
this.marker.infowin=_15c;
minimap.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
minimap.centerAndZoom(map.geoCenter,1);
map.addOverlay(_15c);
_15c.moveToShow();
}else{
if(poi.type==2){
var _15d=generateInfoDiv(this.marker.poi,this.marker);
}else{
var _15d=generateInfoDiv(this.marker.poi,this.marker);
if(this.map.zoom>2){
this.map.zoomTo(2);
}
}
var _15c=new youdao.maps.InfoBox(new youdao.maps.GeoPoint(poi.lo,poi.la),{"title":poi.name});
_15c.setBrief(_15d);
map.addOverlay(_15c);
if(curInfoWin){
curInfoWin.setVisible(false);
}
curInfoWin=_15c;
this.marker.infowin=_15c;
}
if(poi.type==2){
_15c.setTitle("<img src='icon/bus_m.gif'/>&nbsp;"+this.marker.poi.moreInfo);
}
_15c.moveToShow();
};
var td1=document.createElement("td");
_158.appendChild(td1);
td1.appendChild(icon);
td1.style.paddingTop="3px";
td1.width="5%";
td1.vAlign="top";
td1.align="center";
var td2=document.createElement("td");
_158.appendChild(td2);
td2.style.paddingLeft="7px";
td2.style.paddingRight="7px";
if(poi.type==4){
td2.style.paddingTop="7px";
td2.style.paddingBottom="7px";
}
var _160=document.createTextNode(" ");
var div1=document.createElement("div");
td2.appendChild(div1);
_158.appendChild(td2);
div1.appendChild(_160);
div1.appendChild(poiA);
_158.poiA=poiA;
if(_150!=true){
var _162=document.createElement("div");
_162.className="text75";
_162.innerHTML=poi.briefInfo;
td2.appendChild(_162);
}
rDiv.appendChild(_158);
_158.onclick=function(){
this.poiA.onclick();
};
}
var imagePath="http://mcs.youdao.com/photo/";
function generateInfoDiv(poi,_164){
var div=document.createElement("div");
div.align="left";
var _166=poi.picpath;
var _167=document.createElement("a");
_167.className="fixedlink";
if(_166!=undefined&&_166!=""){
var _168=document.createElement("table");
var _169=document.createElement("tbody");
_168.style.fontSize="12px";
var tr=document.createElement("tr");
var td1=document.createElement("td");
td1.innerHTML=poi.moreInfo+"<br>";
td1.appendChild(_167);
tr.appendChild(td1);
var td2=document.createElement("td");
td2.innerHTML="<img height=\"100px\" src=\""+imagePath+_166+"\"/>";
tr.appendChild(td2);
_169.appendChild(tr);
_168.appendChild(_169);
div.appendChild(_168);
}else{
var _16d=document.createTextNode(" ");
div.appendChild(_16d);
var info=document.createElement("div");
if(poi.type==2){
info.innerHTML=poi.name+"&nbsp;&nbsp;";
}else{
info.innerHTML=poi.moreInfo+"<br>";
}
div.appendChild(info);
div.appendChild(_167);
var _16f=document.createElement("a");
var zoom=map.zoom;
}
var id=poi.id;
if(poi.type==2){
if(map.zoom>1){
_16f.innerHTML="\u5c40\u90e8\u653e\u5927\u5730\u56fe";
}else{
_16f.innerHTML="\u67e5\u770b\u6574\u6761\u7ebf\u8def";
}
_16f.onclick=function(){
cLog("","click","busPopScaleLink");
this.zoom=map.zoom;
if(this.zoom>1){
this.innerHTML="\u67e5\u770b\u6574\u6761\u7ebf\u8def";
var _172=new youdao.maps.GeoPoint(poi.lo,poi.la);
map.centerAndZoom(_172,map.zoom);
map.centerAndZoom(map.geoCenter,0);
}else{
this.innerHTML="\u5c40\u90e8\u653e\u5927\u5730\u56fe";
var _172=new youdao.maps.GeoPoint(curMapPosition.lo,curMapPosition.la);
map.centerAndZoom(_172,map.zoom);
map.centerAndZoom(map.geoCenter,curMapPosition.zoom);
}
};
div.appendChild(_16f);
div.style.padding=" 7px 0 10px 0";
return div;
}
var _173="leftpx fixedlink space";
var _174=document.createElement("div");
_174.className="func_link_div";
var _175=document.createElement("a");
_175.className=_173;
var _176=document.createElement("a");
_176.className=_173;
var toA=document.createElement("a");
toA.className=_173;
var _178=document.createElement("div");
_178.style.borderColor="#7e9db9";
_178.style.borderWidth="1px 0 0 0";
_178.style.borderStyle="solid";
_178.style.display="none";
_178.width="100%";
var _179=document.createElement("div");
closeA=document.createElement("a");
closeA.innerHTML="\u5173\u95ed";
closeA.marker=_164;
closeA.className="text85";
closeA.ctrlDiv=_178;
closeA.onclick=function(){
cLog("","click","popWinMoreClose");
this.ctrlDiv.style.display="none";
this.parentNode.style.display="none";
this.marker.infowin.setStyles({"width":"300px"});
this.marker.infowin.moveToShow();
};
_179.appendChild(closeA);
_179.align="right";
_179.style.margin="3px 0 3px 0";
_179.style.display="none";
_178.closeDiv=_179;
_179.moreFuncDiv=_178;
var _17a=document.createElement("div");
_17a.vAlign="center";
_17a.style.margin="3px 0 0px 0";
_178.appendChild(_17a);
_167.innerHTML="\u66f4\u591a\u4fe1\u606f";
_167.marker=_164;
_167.id=poi.id;
_167.name=poi.name;
_167.telphone=poi.telphone;
_167.city=poi.city;
_167.address=poi.address;
_167.lo=poi.lo;
_167.la=poi.la;
_167.div=_178;
_167.moreDiv=_17a;
_167.type="more";
_167.onclick=function(){
cLog("","click","popWinMoreInfo");
this.div.style.display="";
this.div.type=this.type;
this.frame=document.createElement("iframe");
this.frame.setAttribute("frameBorder",0);
this.frame.src="detail?id="+id+"&n="+encodeURIComponent(this.name)+"&a="+encodeURIComponent(this.address)+"&t="+this.telphone+"&lo="+this.lo+"&la="+this.la+"&ct="+encodeURIComponent(this.city);
var wd=Math.max(550,document.body.clientWidth*0.4);
var ht=Math.max(150,document.body.clientHeight*0.3);
this.frame.width=wd+"px";
this.frame.height=ht+"px";
this.div.closeDiv.style.width=this.frame.width;
this.div.closeDiv.style.display="block";
this.frame.style.border="0";
this.moreDiv.innerHTML="";
this.moreDiv.appendChild(this.frame);
this.marker.infowin.setStyles({"width":(wd+30)+"px"});
this.marker.infowin.moveToShow();
this.w=this.div.offsetWidth;
this.h=this.div.offsetHeight;
};
_175.innerHTML="\u5468\u8fb9\u67e5\u627e";
_175.moreDiv=_17a;
_175.id=poi.id;
_175.marker=_164;
_175.div=_178;
_175.type="around";
_175.onclick=function(){
cLog("","click","popWinSearchAround");
showOrHide(this.div);
this.div.style.display="";
this.div.type=this.type;
var ta=document.createElement("span");
ta.innerHTML="\u5468\u8fb9\u67e5\u627e:";
this.moreDiv.appendChild(ta);
var box=document.createElement("input");
box.className="editinput";
box.type="text";
box.id=poi.id;
box.onkeydown=function(_17f){
cLog("","search","popWinSearchAround");
if(window.event){
_17f=window.event;
}
if(_17f.keyCode==13&&this.value.trim()!=""){
searchAround(this.id,this.value);
}
};
var _180=document.createElement("input");
_180.type="button";
_180.value="\u641c\u7d22";
_180.id=this.id;
_180.box=box;
_180.onclick=function(){
cLog("","search","popWinSearchAround");
if(this.box.value.trim()!=""){
searchAround(this.id,this.box.value);
}
};
var ta=document.createElement("span");
ta.innerHTML="\u5728\u5468\u8fb9\u67e5\u627e\uff1a";
this.moreDiv.innerHTML="";
this.moreDiv.appendChild(ta);
this.moreDiv.appendChild(box);
this.moreDiv.appendChild(_180);
this.div.closeDiv.style.width="300px";
this.div.closeDiv.style.display="block";
this.marker.infowin.setStyles({"width":"350px"});
this.marker.infowin.moveToShow();
box.focus();
};
_176.innerHTML="\u4ece\u6b64\u5730\u51fa\u53d1";
_176.moreDiv=_17a;
_176.id=poi.id;
_176.marker=_164;
_176.div=_178;
_176.type="from";
_176.onclick=function(){
cLog("","click","popWinMoveFrom");
showOrHide(this.div);
this.div.style.display="";
this.div.type=this.type;
var ta=document.createElement("span");
ta.innerHTML="\u5230\u8fbe\u70b9\uff1a";
var box=document.createElement("input");
box.type="text";
box.className="editinput";
box.id=poi.id;
box.onkeypress=function(_183){
cLog("","search","popWinMoveFrom");
if(window.event){
_183=window.event;
}
if((_183.keyCode==13)&&this.value.trim()!=""){
busSomePlaceFromCurPoi(this.id,this.value);
}
};
var _184=document.createElement("input");
_184.type="button";
_184.value="\u516c\u4ea4";
_184.id=this.id;
_184.box=box;
_184.onclick=function(){
cLog("","search","popWinMoveFrom");
if(this.box.value.trim()!=""){
busSomePlaceFromCurPoi(this.id,this.box.value);
}
};
var _185=document.createElement("input");
_185.type="button";
_185.value="\u81ea\u9a7e";
_185.id=this.id;
_185.box=box;
_185.onclick=function(){
cLog("","search","popWinMoveFrom");
if(this.box.value.trim()!=""){
naviSomePlaceFromCurPoi(this.id,this.box.value);
}
};
this.moreDiv.innerHTML="";
this.moreDiv.appendChild(ta);
this.moreDiv.appendChild(box);
this.moreDiv.appendChild(_184);
this.moreDiv.appendChild(_185);
this.div.closeDiv.style.width="300px";
this.div.closeDiv.style.display="block";
this.marker.infowin.setStyles({"width":"350px"});
this.marker.infowin.moveToShow();
box.focus();
};
toA.innerHTML="\u524d\u5f80\u6b64\u5730";
toA.moreDiv=_17a;
toA.id=poi.id;
toA.marker=_164;
toA.div=_178;
toA.type="to";
toA.onclick=function(){
cLog("","click","popWinMoveTo");
showOrHide(this.div);
this.div.style.display="";
this.div.type=this.type;
var ta=document.createElement("span");
ta.innerHTML="\u51fa\u53d1\u70b9\uff1a";
var box=document.createElement("input");
box.className="editinput";
box.type="text";
box.id=poi.id;
box.onkeypress=function(_188){
cLog("","search","popWinMoveTo");
if(window.event){
_188=window.event;
}
if((_188.keyCode==13)&&this.value.trim()!=""){
naviSomePlaceFromCurPoi(this.value,this.id);
}
};
var _189=document.createElement("input");
_189.type="button";
_189.value="\u516c\u4ea4";
_189.id=this.id;
_189.box=box;
_189.onclick=function(){
cLog("","search","popWinMoveTo");
if(this.box.value.trim()!=""){
busSomePlaceFromCurPoi(this.box.value,this.id);
}
};
var _18a=document.createElement("input");
_18a.type="button";
_18a.value="\u81ea\u9a7e";
_18a.id=this.id;
_18a.box=box;
_18a.onclick=function(){
cLog("","search","popWinMoveTo");
if(this.box.value.trim()!=""){
naviSomePlaceFromCurPoi(this.box.value,this.id);
}
};
this.moreDiv.innerHTML="";
this.moreDiv.appendChild(ta);
this.moreDiv.appendChild(box);
this.moreDiv.appendChild(_18a);
this.moreDiv.appendChild(_189);
this.marker.infowin.setStyles({"width":"350px"});
this.div.closeDiv.style.width="300px";
this.div.closeDiv.style.display="block";
this.marker.infowin.moveToShow();
box.focus();
};
_174.innerHTML+="\u529f\u80fd\u9009\u62e9\uff1a";
_174.appendChild(_175);
_174.appendChild(_176);
_174.appendChild(toA);
var _18b=document.createElement("div");
_18b.innerHTML+="\u7f29\u653e\u5730\u56fe\uff1a";
_18b.className="func_link_div";
var _18c=document.createElement("a");
_18c.className=_173;
_18c.innerHTML="\u5168\u56fd";
_18b.appendChild(_18c);
_18c.onclick=function(){
cLog("","click","popWinZoom");
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,13);
city="\u5168\u56fd";
};
var _18c=document.createElement("a");
_18c.className=_173;
_18c.innerHTML="\u7701";
_18b.appendChild(_18c);
_18c.onclick=function(){
cLog("","click","popWinZoom");
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,10);
city="\u5168\u56fd";
};
var _18c=document.createElement("a");
_18c.className=_173;
_18c.innerHTML="\u5e02";
_18b.appendChild(_18c);
_18c.onclick=function(){
cLog("","click","popWinZoom");
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,6);
city=poi.city;
};
var _18c=document.createElement("a");
_18c.className=_173;
_18c.innerHTML="\u533a\u9547";
_18b.appendChild(_18c);
_18c.onclick=function(){
cLog("","click","popWinZoom");
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,3);
city=poi.city;
};
var _18c=document.createElement("a");
_18c.className=_173;
_18c.innerHTML="\u8857\u9053 ";
_18b.appendChild(_18c);
_18c.onclick=function(){
cLog("","click","popWinZoom");
map.centerAndZoom(new youdao.maps.GeoPoint(poi.lo,poi.la),map.zoom);
map.centerAndZoom(map.geoCenter,0);
city=poi.city;
};
div.appendChild(_18b);
div.appendChild(_174);
div.appendChild(_179);
div.appendChild(_178);
return div;
}
function showResultPoiInfo(_18d,i,map,_190,rDiv){
var _192=new youdao.maps.GeoPoint(_18d[i].lo,_18d[i].la);
var _193="icon/p"+(i+1)+".gif";
var icon=new youdao.maps.Icon(_18d[i],{"img":_193});
var _195=new youdao.maps.Marker("",_192,icon);
var _196=makeInfoStr_2(_18d,i,1);
resultInfoWin[i]=new youdao.maps.InfoWindow(_195);
resultInfoWin[i].flag=1;
resultInfoWin[i].setLabel(_196);
resultInfoWin[i].moveToShow();
map.addOverlay(_195);
youdao.maps.Event.addListener(_195,"click",callbackResultPop(i));
var _197=document.createElement("span");
var icon=document.createElement("img");
icon.src=_193;
var poiA=document.createElement("a");
poiA.innerHTML=_18d[i].name.bold();
poiA.onclick=function(){
cLog("Result","click",i);
map.centerAndZoom(new youdao.maps.GeoPoint(_18d[i].lo,_18d[i].la),map.zoom);
showResultPop(i);
};
var _199=document.createElement("p");
_199.innerHTML=_18d[i].briefInfo;
_197.appendChild(icon);
_197.appendChild(poiA);
_197.appendChild(_199);
rDiv.appendChild(_197);
_197.style.width="250px";
_197.style.display="block";
}
function prepage(){
curPage=curPage-1;
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
function nextpage(){
curPage=curPage+1;
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
function gotoPage(i){
curPage=i;
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
function refineCenterSearch(_19b){
localSearch.search(queryTerm,_19b,city,"","",inputValue,range,inputcity);
}
function searchAround(id,_19d){
center=id;
localSearch.search(_19d,center,city,"","",inputValue,range,inputcity);
}
function changeCenterSearch(_19e){
localSearch.search(queryTerm,_19e,city,"","",inputValue,range,inputcity);
}
function showNaviResult(_19f,map,_1a1,_1a2){
if(_19f.needUserSel){
cityDiv.style.display="none";
fDiv.style.display="none";
tDiv.style.display="none";
map.removeAllMark();
rDiv.innerHTML="";
showUserSelNaviPage(rDiv,_19f);
}else{
if(_19f.routeList){
map.removeAllMark();
citySelector.refresh(city,_19f.resultCityList,true);
fromSelector.refresh(_19f.from,_19f.fromPoiResults.poiList,0);
toSelector.refresh(_19f.to,_19f.toPoiResults.poiList,0);
var _1a3=[];
if(_19f.fromPoiResults.poiList&&_19f.fromPoiResults.poiList.length>0){
_1a3.push(new youdao.maps.GeoPoint(_19f.fromPoiResults.poiList[0].lo,_19f.fromPoiResults.poiList[0].la));
}
if(_19f.toPoiResults.poiList&&_19f.toPoiResults.poiList.length>0){
_1a3.push(new youdao.maps.GeoPoint(_19f.toPoiResults.poiList[0].lo,_19f.toPoiResults.poiList[0].la));
}
map.getBestView(_1a3);
localZoom=null;
var _1a4="<div class=\"text75 divheight30\"><strong>\u884c\u8f66\u7ebf\u8def</strong>";
if(city!=undefined||city!=""){
_1a4+="&nbsp;-&nbsp;<a class=\"linkhand\" onclick=\"cLog('','search','resultBusLink');changeToBus();\">\u516c\u4ea4\u7ebf\u8def</a>";
}
_1a4+="</div>";
if(curSearchResult.errCode!=0){
rDiv.innerHTML=_1a4;
showErrMsgPage(curSearchResult);
resultType=-1;
return;
}
_1a4+="<div class=\"divheight30\"><table class=\"text75\" width=\"100%\" ><tr><td>\u5168\u7a0b\u603b\u957f"+_19f.overview+"</td><td align=\"right\"><input type=\"checkbox\" id=\"expandall\" value=\"yes\" onclick=\"javascript:if(this.checked == true)showall();else hideall()\">\u5168\u90e8\u5c55\u5f00</td></tr></table></div>";
rDiv.innerHTML=_1a4;
var _1a5=0;
var _1a6="";
var _1a7="";
var _1a8=0;
var _1a9=0;
var _1aa=true;
if(city!=""&&city.indexOf("\u5168\u56fd")<0){
_1aa=false;
}
var _1ab=_19f.geoPoints;
if(mdiv==undefined){
mdiv=document.createElement("div");
mdiv.style.width=450+"px";
mdiv.style.height=260+"px";
mdiv.style.margin="0 5px 0 1px";
mdiv.id="mdiv";
}
if(minimap==undefined){
minimap=new youdao.maps.Map(mdiv,1,"MiniMap");
minimap.centerAndZoom(map.geoCenter,13);
}else{
minimap.removeAllMark();
}
var _1ac=resultPoints2GeoPoints(_1ab);
minimap.addPath(_1ac);
minimap.getBestView(_1ac);
var _1ad=document.createElement("div");
_1ad.className="bgcolor linebottom text75";
rDiv.appendChild(_1ad);
document.getElementById("expandall").checked=!_1aa;
addRouteList(_19f.routeList,map,_1ad,_1aa,mdiv);
showNaviRouteOnMap(_1ab,"red",false);
}else{
if(curSearchResult.errCode!=0){
showErrMsgPage(curSearchResult);
resultType=-1;
}
}
}
}
function showall(){
detaildivs=document.getElementsByName("detail_div");
for(var i=0;i<detaildivs.length;i++){
detaildivs[i].style.display="";
}
}
function hideall(){
detaildivs=document.getElementsByName("detail_div");
for(var i=0;i<detaildivs.length;i++){
detaildivs[i].style.display="none";
}
}
function addRouteList(_1b0,map,div,_1b3,mdiv,_1b5){
for(var i=0;i<_1b0.length;i++){
var _1b7=_1b0[i];
var _1b8=document.createElement("div");
_1b8.className="iteam paddingbottom5";
var _1b9=document.createElement("div");
_1b9.className="listmain paddingleft5 linetop";
_1b9.innerHTML="&nbsp;<img src=\"icon/arr_m.gif\"/>&nbsp;"+_1b7.routeTitle;
var _1ba=document.createElement("div");
_1ba.id="detail_div";
_1ba.name="detail_div";
_1ba.setAttribute("name","detail_div");
_1b9.detaildiv=_1ba;
if(_1b5!=true){
_1b9.onmouseover=function(){
this.defaultbgcolor=this.style.backgroundColor;
this.style.backgroundColor="#D9E5F6";
};
_1b9.onmouseout=function(){
this.style.backgroundColor=this.defaultbgcolor;
};
_1b9.onclick=function(){
showOrHide(this.detaildiv);
};
}
_1b8.appendChild(_1b9);
if((i+1)==_1b0.length&&_1b7.routeInfoPoiList[_1b7.routeInfoPoiList.length-1].type==3){
_1b7.routeInfoPoiList[_1b7.routeInfoPoiList.length-1].iconId="100";
}
addResultInfoList(_1b7.routeInfoPoiList,map,_1ba,true,true,mdiv);
_1b8.appendChild(_1ba);
if(_1b3==true){
showOrHide(_1ba);
}
_1ba.className="paddingleft5 ";
div.appendChild(_1b8);
}
}
var busPolyLines=[];
function showNaviRouteOnMap(_1bb,_1bc,_1bd){
if(_1bd){
while(busPolyLines.length>0){
var _1be=busPolyLines.shift();
map.removeOverlay(_1be,false);
}
}
var _1bf=resultPoints2GeoPoints(_1bb);
map.addPath(_1bf);
}
var startMarker,toMarker;
function showNaviFromToPoiInfo(_1c0,_1c1,_1c2,_1c3,map,fDiv,tDiv){
showSelectPoiInfo(_1c2,_1c3,map,curToDiv,moreToDiv,tDiv,"\u5230:","changeToNaviSearch","refineToNaviSearch","showToLocation");
showSelectPoiInfo(_1c0,_1c1,map,curFromDiv,moreFromDiv,fDiv,"\u8d77:","changeFromNaviSearch","refineFromNaviSearch","showFromLocation");
}
var curSpanId=0;
function showRouteDetail(i){
var _1c8=document.getElementById("detail"+i);
if(_1c8.style.display==""){
_1c8.style.display="none";
}else{
_1c8.style.display="";
}
}
function showRegionZoom(i,j){
if(i==currentRoadIndex&&j==currentPartIndex){
localZoom.hideAndShow();
currentRoadIndex=-1;
currentPartIndex=-1;
return;
}
var _1cb=curSearchResult.routeList[i].routeInfoPoiList[j];
var _1cc=new youdao.maps.GeoPoint(_1cb.lo,_1cb.la);
var str=_1cb.name;
zoomRegion(_1cc,str);
currentRoadIndex=i;
currentPartIndex=j;
}
var localZoom;
var currentRoadIndex=-1;
var currentPartIndex=-1;
function zoomRegion(_1ce,_1cf){
if(localZoom==undefined){
var _1d0=resultPoints2GeoPoints(curSearchResult.geoPoints);
localZoom=new MyDivLayer(_1ce,_1cf,200,200,_1d0);
map.addOverlay(localZoom);
}else{
if(localZoom.map==null){
map.addOverlay(localZoom);
}
localZoom.showPoint(_1ce,_1cf);
}
map.centerAndZoom(_1ce,map.zoom);
}
function refineFromNaviSearch(i){
fromIndex=i;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
function refineToNaviSearch(i){
toIndex=i;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
function changeFromNaviSearch(_1d3){
from=_1d3;
fromIndex=0;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
function changeToNaviSearch(_1d4){
to=_1d4;
toIndex=0;
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
function listAllCity(){
var _1d5=document.getElementById("moreCityDiv");
if(_1d5.style.display==""){
_1d5.style.display="none";
}else{
_1d5.style.display="";
}
}
function changeCity(_1d6){
if(_1d6.trim()==""){
return;
}
if(curSearchResult.resultType==2){
changeBusCity(_1d6);
}else{
if(curSearchResult.resultType==3){
city=_1d6;
changeToNavi();
}else{
localSearchAnotherCity(_1d6);
}
}
}
function changeBusCity(_1d7){
busSearch.goSearch(from,to,city,"","","",0,0,0,_1d7);
}
function changeToNavi(){
naviSearch.goSearch(from,to,"","",inputValue,fromIndex,toIndex,city,city,city,inputcity);
}
function changeToBus(){
busSearch.goSearch(from,to,city,"","","",fromIndex,toIndex,0,inputcity);
}
function showBusResult(_1d8,map,_1da,_1db){
if(_1d8.needUserSel){
map.removeAllMark();
rDiv.innerHTML="";
showUserSelBusPage(rDiv,_1d8);
}else{
if(_1d8){
resultType=_1d8.resultType;
map.removeAllMark();
cityList=_1d8.resultCityList;
citySelector.refresh(city,cityList,false);
cityDiv.style.display="";
fromSelector.refresh(_1d8.from,_1d8.fromPoiResults.poiList,0);
toSelector.refresh(_1d8.to,_1d8.toPoiResults.poiList,0);
var _1dc=[];
if(_1d8.fromPoiResults.poiList&&_1d8.fromPoiResults.poiList.length>0){
_1dc.push(new youdao.maps.GeoPoint(_1d8.fromPoiResults.poiList[0].lo,_1d8.fromPoiResults.poiList[0].la));
}
if(_1d8.toPoiResults.poiList&&_1d8.toPoiResults.poiList.length>0){
_1dc.push(new youdao.maps.GeoPoint(_1d8.toPoiResults.poiList[0].lo,_1d8.toPoiResults.poiList[0].la));
}
map.getBestView(_1dc);
rDiv.innerHTML=" <div  class=\"text75 divheight30\"><a class=\"linkhand\" onclick=\"cLog('','search','resultNaviLink');changeToNavi();\">\u884c\u8f66\u7ebf\u8def</a>&nbsp;-&nbsp;<strong>\u516c\u4ea4\u7ebf\u8def</strong></div>";
rDiv.innerHTML+="<div class=\"text75 divheight30\">\u63a8\u8350\u7ebf\u8def"+_1d8.resultList.length+"\u6761\uff1a</div>";
if(_1d8.resultList.length>0){
for(var i=0;i<_1d8.resultList.length;i++){
showBusResultInfo(_1d8.resultList,i,map,rDiv);
}
showBusRouteOnMap(map,_1d8.resultList[_1d8.lineIndex].geoPoints,5);
showBusIconOnMap(map,getBusIconMarks(_1d8.resultList[_1d8.lineIndex]));
}else{
if(curSearchResult.errCode!=0){
showErrMsgPage(curSearchResult);
resultType=-1;
}
}
}
}
}
function showBusRouteOnMap(map,_1df,_1e0,_1e1){
while(busPolyLines.length>0){
var _1e2=busPolyLines.shift();
map.removeAllMark();
}
var _1e3=resultPoints2GeoPoints(_1df);
if(_1e1!=true){
}else{
map.getBestView(_1e3);
}
map.addPath(_1e3);
}
function showBusIconOnMap(map,_1e5){
for(i=0;i<_1e5.length;i++){
var _1e6=_1e5[i];
busPolyLines.push(_1e6);
map.addOverlay(_1e6);
_1e6.addEvent("click",winFunc(_1e6));
}
}
function getBusIconMarks(_1e7){
var _1e8=[];
for(i=0;i<_1e7.routeList.length;i++){
var gap=_1e7.routeList[i];
var _1ea=gap.routeInfoPoiList;
for(j=0;j<_1ea.length;j++){
var info=_1ea[j];
if(info.iconId==2){
offx="0px";
}else{
offx="-26px";
}
var _1ec=new youdao.maps.Icon(new youdao.maps.GeoPoint(info.lo,info.la),{"img":"icon/micon.gif",bgOffsetX:offx,bgOffsetY:"-106px","styles":{"width":"28","height":"33"}});
_1ec.poi=info;
_1e8.push(_1ec);
}
}
return _1e8;
}
function showBusResultInfo(_1ed,i,map,rDiv){
var _1f1="icon/p"+(i+1)+".gif";
var _1f2=_1ed[i];
var _1f3=document.createElement("div");
_1f3.onmouseover=function(){
this.defaultbgcolor=this.style.backgroundColor;
if(this.detailDiv.style.display=="none"){
this.style.backgroundColor="#F4F9FF";
}
};
_1f3.onmouseout=function(){
this.style.backgroundColor=this.defaultbgcolor;
};
_1f3.className="listmain bunk text75 linetop";
_1f3.style.marginTop="6px";
_1f3.style.borderColor="#ECECEC";
_1f3.style.borderStyle="solid";
_1f3.style.borderWidth="1px";
var _1f4=document.createElement("div");
addRouteList(_1f2.routeList,map,_1f4,false,"",true);
var _1f5=getBusIconMarks(_1f2);
_1f3.headdiv=document.createElement("div");
var _1f6=_1f2.title;
if(_1f6.indexOf("-")>=0){
while(_1f6.indexOf("-")>=0){
_1f6=_1f6.replace("-","<span class=\"infowenzi\" >&nbsp;<img src='icon/arr_m.gif'/>&nbsp;<img src='icon/bus_m.gif'/>&nbsp;</span>").bold();
}
}else{
_1f6=_1f6.bold();
}
_1f3.headdiv.innerHTML="&nbsp;"+(i+1)+"&nbsp;&nbsp;<img src=\"icon/bus_m.gif\"/>&nbsp;"+_1f6+"&nbsp;&nbsp;<span class=\"infowenzi\">"+_1f2.routeOverview+"</span>";
_1f3.appendChild(_1f3.headdiv);
_1f3.detailDiv=_1f4;
_1f3.headdiv.detailDiv=_1f4;
_1f3.map=map;
_1f3.headdiv.map=map;
_1f3.geoPoints=_1f2.geoPoints;
_1f3.iconMarks=getBusIconMarks(_1f2);
_1f3.headdiv.onclick=function(){
var _1f7=this.parentNode;
if(lastBusDiv!=undefined){
if(lastBusDiv==_1f7){
showOrHide(_1f7.detailDiv);
return;
}
lastBusDiv.detailDiv.style.display="none";
lastBusDiv.style.backgroundColor="#FFFFFF";
lastBusDiv=_1f7;
}
showOrHide(_1f7.detailDiv);
showBusRouteOnMap(_1f7.map,_1f7.geoPoints,5,true);
showBusIconOnMap(_1f7.map,_1f7.iconMarks);
_1f7.style.backgroundColor="#F4F9FF";
_1f7.defaultbgcolor=_1f7.style.backgroundColor;
};
_1f3.appendChild(_1f4);
rDiv.appendChild(_1f3);
showOrHide(_1f4);
if(i==0){
if(lastBusDiv!=undefined){
lastBusDiv.style.display="none";
}
_1f3.style.backgroundColor="#F4F9FF";
lastBusDiv=_1f3;
showOrHide(_1f4);
}
}
function refineBusSearch(i,j,_1fa){
if(i<0){
i=fromIndex;
}
if(j<0){
j=toIndex;
}
if(_1fa<0){
_1fa=lineIndex;
}
busSearch.goSearch(from,to,city,"","",inputValue,i,j,_1fa,inputcity);
}
function showBusFromToPoiInfo(_1fb,_1fc,_1fd,_1fe,map,fDiv,tDiv){
showSelectPoiInfo(_1fd,_1fe,map,curToDiv,moreToDiv,tDiv,"\u5230:","changeToBusSearch","refineToBusSearch","showToLocation");
showSelectPoiInfo(_1fb,_1fc,map,curFromDiv,moreFromDiv,fDiv,"\u8d77:","changeFromBusSearch","refineFromBusSearch","showFromLocation");
}
function refineFromBusSearch(i){
fromIndex=i;
refineBusSearch(fromIndex,toIndex,0);
}
function refineToBusSearch(i){
toIndex=i;
refineBusSearch(fromIndex,toIndex,0);
}
function changeFromBusSearch(_204){
from=_204;
fromIndex=0;
busSearch.goSearch(from,to,city,"","",inputValue,fromIndex,toIndex,0,inputcity);
}
function changeToBusSearch(_205){
to=_205;
toIndex=0;
busSearch.goSearch(from,to,city,"","",inputValue,fromIndex,toIndex,0,inputcity);
}
function refineToSearch(toId){
if(resultType==2){
busSearch.goSearch(from,toId,city,"","",inputValue,fromIndex,"",0,inputcity);
}else{
naviSearch.goSearch(from,toId,"","",inputValue,fromIndex,toIndex,city,city,city,inputcity);
}
}
function refineFromSearch(_207){
if(resultType==2){
busSearch.goSearch(_207,to,city,"","",inputValue,0,toIndex,"",inputcity);
}else{
naviSearch.goSearch(_207,to,"","",inputValue,fromIndex,toIndex,city,city,city,inputcity);
}
}
function changeToSearch(_208){
to=_208;
toIndex=0;
if(resultType==2){
busSearch.goSearch(from,to,city,"","",inputValue,fromIndex,toIndex,0,inputcity);
}else{
naviSearch.goSearch(from,to,city,"",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
}
function changeFromSearch(_209){
from=_209;
fromIndex=0;
if(resultType==2){
busSearch.goSearch(from,to,city,"","",inputValue,fromIndex,toIndex,0,inputcity);
}else{
naviSearch.goSearch(from,to,city,"",inputValue,fromIndex,toIndex,"","",city,inputcity);
}
}
function focusNext(){
this.tobox=document.getElementById("to");
hideSuggest();
if(this.tobox.value.trim()==""){
document.getElementById("to").focus();
}else{
if(lastTab==1){
goBusSearch();
}else{
goNaviSearch();
}
}
}
function changeTab(_20a){
if(_20a==lastTab){
return;
}
var from="";
var to="";
var _20d="";
var _20e;
if(document.getElementById("from")!=undefined){
from=document.getElementById("from").value;
to=document.getElementById("to").value;
}
if(document.getElementById("place")!=undefined){
_20d=document.getElementById("place").value;
}
if(window.ActiveXObject){
_20e=new ActiveXObject("Microsoft.XMLHTTP");
}else{
if(window.XMLHttpRequest){
_20e=new window.XMLHttpRequest();
}
}
url="tab="+_20a+"&ftab="+lastTab+"&from="+from+"&to="+to+"&q="+_20d;
_20e.abort();
_20e.open("GET","tab?"+url,true);
_20e.onreadystatechange=function(){
if(_20e.readyState==4){
if(_20e.status==200){
var a=""+_20e.responseText;
var _210=document.getElementById("headerTable");
if(_210!=undefined){
_210.innerHTML=a;
}
if(document.getElementById("menuMore")){
initMorePop();
}
}
boxEventRefresh(_20a);
if(suggestRefresh!=null){
suggestRefresh(_20a);
}
}
};
_20e.send(null);
lastTab=_20a;
}
function boxEventRefresh(_211){
inputBox=document.getElementById("place");
bindEnter(inputBox,golocalSearch);
fromBox=document.getElementById("from");
bindEnter(fromBox,focusNext);
toBox=document.getElementById("to");
if(_211==1){
bindEnter(toBox,goBusSearch);
}
if(_211==2){
bindEnter(toBox,goNaviSearch);
}
}
function bindEnter(obj,_213){
if(obj==undefined){
return;
}
obj.onkeydown=function(_214){
var key;
if(window.event){
key=window.event.keyCode;
}else{
key=_214.which;
}
if(key==13){
_213();
}
};
}
function callSave(_216){
queryURL=localSearch.URL;
saveMapURL();
}
function saveMapURL(){
if(localSearch){
mapURL=queryURL;
}else{
mapURL="";
}
saveHistory(mapURL);
}
function printLocalMap(){
var purl="maptool?"+mapURL;
window.open(purl,"\u6709\u9053\u5730\u56fe\u6253\u5370\u9884\u89c8","width=756px,height=1286px,resizable=yes,status=no,toolbar=no");
}
function mapZoomIn(){
map.zoomIn();
}
function mapZoomOut(){
map.zoomOut();
}
function emailUrl(){
var url=encodeURIComponent(mapURL);
mailcontent="http://"+window.location.host+"#"+url;
document.location="mailto:?body="+mailcontent+"";
}
function copyUrl(){
copycontent="http://"+window.location.host+window.location.pathname+"?"+mapURL;
cpDiv=document.getElementById("copyDiv");
document.getElementById("copy_input").value=copycontent;
document.getElementById("copy_input").onmousemove=function(){
this.select();
};
cpDiv.style.display="block";
}
function hideCopy(){
cpDiv.style.display="none";
}
function showDiv(div){
if(div.style.display=="none"){
div.style.display="";
}else{
div.style.display="none";
}
}
function showCitySelect(_21a,_21b,_21c){
_21b.innerHTML="";
_21b.style.display="";
var _21d=document.createElement("span");
cityStr="\u5f53\u524d\u57ce\u5e02:"+city.bold();
if(city==undefined||city==""){
cityStr="\u5f53\u524d\u57ce\u5e02:\u5168\u56fd";
}
_21d.innerHTML=cityStr;
var _21e=document.createElement("a");
_21e.innerHTML="\u4fee\u6539";
var _21f=document.createElement("div");
_21e.onclick=function(){
showDiv(_21f);
};
_21b.appendChild(_21d);
_21b.appendChild(_21e);
if(_21a!=undefined&&_21a.length>0){
for(i=0;i<_21a.length;i++){
var _220=document.createElement("a");
_220.innerHTML=_21a[i];
_21f.appendChild(_220);
}
}
var _221=document.createElement("input");
_221.type="input";
_221.onKeyDown=function(_222){
if(window.event){
_222=window.event;
}
if((_222.keyCode==13)&&_221.value.trim()!=""){
_21c(_221.value);
}
};
var _223=document.createElement("input");
_223.type="button";
_223.value="\u786e\u5b9a";
_223.onclick=function(){
if(_221.value.trim()!=""){
_21c(_221.value);
}
};
_21f.appendChild(_221);
_21f.appendChild(_223);
_21f.style.display="none";
_21b.appendChild(_21f);
}
function showSelectPoiInfoNew(_224,_225,map,cDiv,_228,_229,_22a,_22b){
cDiv.innerHTML="";
if(_224.length>0){
showLocation(_224,_225,true);
var _22c="";
var _22d=document.createElement("p");
var _22e=document.createElement("span");
_22e.innerHTML=_224[_225].name.bold()+_224[_225].location;
_22e.onclick=function(){
_22b(_225);
};
_22b(_225);
var _22f=document.createElement("a");
var _230=document.createElement("div");
_22f.innerHTML="\u4fee\u6539";
_22f.onclick=function(){
showDiv(_230);
};
_22d.appendChild(_22e);
_22d.appendChild(_22f);
cDiv.appendChild(_22d);
var leng=5;
if(_224.length<5){
leng=_224.length;
}
if(leng>1){
for(var i=0;i<leng;i++){
var _233=document.createElement("p");
var nP=document.createElement("span");
nP.innerHTML=_224[i].name.bold()+_224[i].location;
var idx=i+0;
nP.onclick=function(){
_22b(idx);
};
var _236=document.createElement("a");
_236.innerHTML="\u786e\u8ba4";
var cid=_224[i].id;
_236.onclick=function(){
_22a(cid);
};
_233.appendChild(nP);
_233.appendChild(_236);
_230.appendChild(_233);
}
}
var _238=document.createElement("input");
_238.type="input";
_238.onkeydown=function(_239){
if(window.event){
_239=window.event;
}
if((_239.keyCode==13)&&_238.value.trim()!=""){
_229(_238.value);
}
};
var _23a=document.createElement("input");
_23a.type="button";
_23a.value="\u786e\u5b9a";
_23a.onclick=function(){
if(_238.value.trim()!=""){
_229(_238.value);
}
};
_230.appendChild(_238);
_230.appendChild(_23a);
_230.style.display="none";
_230.style.background="#cccccc";
cDiv.appendChild(_230);
cDiv.style.display="";
}
}
var rightFuncWin;
function mapinit(_23b,_23c){
var _23d=document.getElementById(_23b);
var map=new youdao.maps.Map(_23b);
map.addEvent("rclick",showMenu);
map.addEvent("click",hideMenu);
menuDiscript={"\u5468\u8fb9\u67e5\u627e":rightSearch,"\u524d\u5f80\u6b64\u5730":rightNaviTo,"\u4ece\u6b64\u5730\u51fa\u53d1":rightNaviFrom,"\u653e\u5927\u5730\u56fe (+)":rightZoomIn,"\u7f29\u5c0f\u5730\u56fe (-)":rightZoomOut,"\u79fb\u52a8\u4e3a\u5730\u56fe\u4e2d\u5fc3":rightCenterTo};
return map;
}
var pmenu;
function hideMenu(e){
if(pmenu){
pmenu.setVisible(false);
}
}
function showMenu(e){
var gp=map.getPixelGeoPosition(e.client.x,e.client.y);
gp.set(Math.round(gp.lo),Math.round(gp.la));
if(!(pmenu&&pmenu.dom)){
pmenu=new youdao.maps.PopMenu(gp,{menu:menuDiscript});
}else{
pmenu.setPosition(gp);
}
pmenu.addToMap(map);
pmenu.setVisible(true);
e.preventDefault();
}
function rightZoomIn(){
map.zoomIn();
}
function rightZoomOut(){
map.zoomOut();
}
function rightCenterTo(){
var _242=this.position;
map.centerAndZoom(_242,map.zoom);
}
function rightSearch(){
var _243=this.position;
if(rightFuncWin==undefined||!rightFuncWin.existDom()){
rightFuncWin=new youdao.maps.InfoBox(_243);
}
rightFuncWin.setVisible(true);
rightFuncWin.setPosition(_243);
map.addOverlay(rightFuncWin);
var _244="rnear";
var str="<table>";
str+="<tr><td><font size=-1>\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e<br>\u9644\u8fd1\u641c\u7d22:<input id=\""+_244+"\"class=\"editinput\" type=text value=\"\" size=8 onKeyDown=\"javascript:var event=document.all?window.event:arguments[0];if(event.keyCode==13){searchAroundPoint("+_243.lo+","+_243.la+",document.getElementById('"+_244+"').value);}\"/><input type=button value=\"\u641c\u7d22\" onclick=\"javascript:cLog('','search','rightSearchAround');searchAroundPoint("+_243.lo+","+_243.la+",document.getElementById('"+_244+"').value);\"/></font></td></tr>";
str+="</table>";
rightFuncWin.setBrief(str);
rightFuncWin.moveToShow();
tempId=_244;
setTimeout("document.getElementById('"+tempId+"').focus()",200);
}
function searchAroundPoint(p1,p2,_248){
if(_248.trim()!=""){
queryTerm=_248;
curPage=1;
center="geo["+p1+","+p2+"]";
localSearch.search(queryTerm,center,city,curPage,"",inputValue,range,inputcity);
}
}
function rightNaviFrom(){
var _249=this.position;
if(rightFuncWin==undefined||!rightFuncWin.existDom()){
rightFuncWin=new youdao.maps.InfoBox(_249);
}
map.addOverlay(rightFuncWin);
rightFuncWin.setVisible(true);
rightFuncWin.setPosition(_249);
var _24a="rnf";
var str="<table>";
str+="<tr><td><font size=-1>\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e<br>\u4ece\u9644\u8fd1\u51fa\u53d1\uff0c"+"\u524d\u5f80<input id="+_24a+" class=\"editinput\" type=text value=\"\" size=8 onKeyDown=\"javascript:var event=document.all?window.event:arguments[0];if(event.keyCode==13){cLog('','search','rightMoveFrom');naviToAroundPoint("+_249.lo+","+_249.la+",document.getElementById('"+_24a+"').value,1);}\"/><br><input type=button value=\"\u9a7e\u8f66\" onclick=\"javascript:cLog('','search','rightMoveFrom');naviToAroundPoint("+_249.lo+","+_249.la+",document.getElementById('"+_24a+"').value, 1);\"/><input type=button value=\"\u516c\u4ea4\" onclick=\"javascript:cLog('','search','rightMoveFrom');busToAroundPoint("+_249.lo+","+_249.la+",document.getElementById('"+_24a+"').value, 1);\"/></font></td></tr>";
str+="</table>";
rightFuncWin.setBrief(str);
rightFuncWin.moveToShow();
tempId=_24a;
setTimeout("document.getElementById('"+tempId+"').focus()",200);
}
function rightNaviTo(){
var _24c=this.position;
if(rightFuncWin==undefined||!rightFuncWin.existDom()){
rightFuncWin=new youdao.maps.InfoBox(_24c);
}
map.addOverlay(rightFuncWin);
rightFuncWin.setVisible(true);
rightFuncWin.setPosition(_24c);
var _24d="rnt"+_24c.lo;
var str="<table>";
str+="<tr><td><font size=-1>\u5730\u56fe\u9009\u5b9a\u4f4d\u7f6e<br>\u524d\u5f80\u9644\u8fd1\uff0c\t\t\u51fa\u53d1\u70b9<input id="+_24d+" class=\"editinput\" type=text value=\"\" size=8 onKeyDown=\"javascript:var event=document.all?window.event:arguments[0];if(event.keyCode==13 ){cLog('','search','rightMoveTo');naviToAroundPoint("+_24c.lo+","+_24c.la+",document.getElementById('"+_24d+"').value,-1);}\"/>\t\t<br>\t\t<input type=button value=\"\u9a7e\u8f66\" onclick=\"javascript:cLog('','search','rightMoveTo');naviToAroundPoint("+_24c.lo+","+_24c.la+",document.getElementById('"+_24d+"').value, -1);\"/>\t\t<input type=button value=\"\u516c\u4ea4\" onclick=\"javascript:cLog('','search','rightMoveTo');busToAroundPoint("+_24c.lo+","+_24c.la+",document.getElementById('"+_24d+"').value, -1);\"/>\t\t</font></td></tr>";
str+="</table>";
rightFuncWin.setBrief(str);
rightFuncWin.moveToShow();
tempId=_24d;
setTimeout("document.getElementById('"+tempId+"').focus()",200);
}
function naviToAroundPoint(p1,p2,_251,flag){
if(flag<0){
from=_251;
to="geo["+p1+","+p2+"]";
}else{
to=_251;
from="geo["+p1+","+p2+"]";
}
naviSearch.search(from,to,"","",inputValue);
}
function busToAroundPoint(p1,p2,_255,flag){
if(flag<0){
from=_255;
to="geo["+p1+","+p2+"]";
}else{
to=_255;
from="geo["+p1+","+p2+"]";
}
fromIndex=0;
toIndex=0;
busSearch.goSearch(from,to,"","","","",fromIndex,toIndex,0,inputcity);
}
function minimapinit(_257){
var map=new youdao.maps.Maps(_257);
map.setSlideMaxZoom(0);
map.removeControl(map.progress);
var _259=document.getElementById(_257);
var _25a="xian";
map.cityNameAndZoom(_25a,13);
var _25b=new youdao.maps.StandMapControl(2);
map.addControl(_25b);
return map;
}
var menuDiscript;
var rightButtonDiv;
var polyCtrl,rightTimeout;
var myVar=new Object();
function rightClickHandler(_25c){
if(rightButtonDiv&&rightButtonDiv.div.style.display!="none"){
rightButtonDiv.hide();
}
if(cpDiv&&cpDiv.style.display!="none"){
cpDiv.style.display="none";
}
if(window.event){
_25c=window.event;
}
if(_25c.pageX){
posx=_25c.pageX+window.pageXOffset;
posy=_25c.pageY+window.pageYOffset;
}else{
if(_25c.clientX){
var _25d=document.documentElement?document.documentElement.scrollLeft:document.body.scrollLeft;
var sTop=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;
posx=_25c.clientX+_25d;
posy=_25c.clientY+sTop;
}
}
button=_25c.button;
var _25f=getElementPos("mapDiv");
point=map.getPixelGeoPosition(_25c.client.x,_25c.client.y);
document.getElementById("wlink").focus();
if(rightTimeout==null||rightTimeout==undefined){
rightTimeout=window.setTimeout(onMapClick,300,point,button);
myVar.point=point;
myVar.button=button;
}else{
window.clearTimeout(rightTimeout);
if(button==2&&this.lastButton==2){
map.zoomOut();
}else{
onMapClick(point,button);
}
rightTimeout=null;
}
this.lastButton=button;
}
function onMapClick(_260,_261){
if(_260==undefined&&myVar){
_261=myVar.button;
_260=myVar.point;
}
rightTimeout=null;
if(_261==2){
if(state==1){
polyCtrl.btnClick();
state=0;
}else{
state=2;
if(rightButtonDiv==undefined){
rightButtonDiv=new youdao.maps.PopMenu(_260,menuDiscript);
map.addOverlay(rightButtonDiv);
}else{
if(rightButtonDiv.map==null){
map.addOverlay(rightButtonDiv);
}
}
cLog("","click","righMenuShow");
rightButtonDiv.setPosition(_260);
rightButtonDiv.setVisible(true);
}
}
if(_261==1||_261==0){
if(state==1){
polyCtrl.hasline=true;
}else{
if(state==2){
rightButtonDiv.hide();
state=0;
}
}
if(cpDiv&&cpDiv.style.display!="none"){
hideCopy();
}
}
}
function resizeMap(map,_263,_264,_265,_266){
var _267=480;
var _268=320;
var _269=document.body.clientWidth;
var _26a=document.body.clientHeight;
_267=_269;
_268=_26a-120;
mapwidth=_267-293;
if(navigator.userAgent.indexOf("MSIE 6.0")>0){
mapwidth=mapwidth-6;
}else{
mapwidth=mapwidth-2;
}
mapheight=_268-23;
_264.style.height=_268+"px";
_266.style.height=_268+"px";
_264.style.width=_267+"px";
_265.style.width=mapwidth+"px";
_263.style.width=mapwidth+"px";
_263.style.height=mapheight+"px";
_264.style.display="block";
}
function addCtrollers(map){
var _26c=new youdao.maps.StandMapControl();
map.addControl(_26c);
var _26d=new youdao.maps.ScaleControl();
_26d.units=[[1000,"km"],[1,"m"]];
_26d.setColor("green");
_26d.setLeft(10);
_26d.setBottom(10);
map.addControl(_26d);
var _26e=new youdao.maps.PolyLineControl();
_26e.autoClear=false;
_26e.setVisible(false);
_26e.hasline=false;
_26e.setTips("\u5de6\u952e\u9009\u62e9\u4e0b\u4e00\u70b9\uff0c\u53f3\u952e\u7ed3\u675f");
map.addControl(_26e);
return _26e;
}
function waitIcon(_26f,_270){
var icon=this;
this.wdiv=document.createElement("div");
document.body.appendChild(icon.wdiv);
this.wdiv.style.display="none";
this.wdiv.style.position="absolute";
this.wdiv.style.width=200+"px";
this.wdiv.style.height=30+"px";
this.wdiv.style.backgroundColor="#d0dff4";
this.wdiv.style.borderColor="#588acb";
this.wdiv.style.borderStyle="solid";
this.wdiv.style.borderWidth="1px";
this.wdiv.style.zIndex="2000";
this.wdiv.innerHTML="<table id=\"wait\" style=\"{padding:2px 0 2px 0;font-size:85%}\" valign=\"center\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"25%\" align=\"center\" valign=\"middle\"><div width=\"28px\" hight=\"28px\" style=\"width:28px;height:28px;background:url(icon/micon.gif) no-repeat -97px -23px\" /></td><td align=\"left\" valign=\"middle\"><b>\u6b63\u5728\u52a0\u8f7d... </b></td></tr></table>";
this.wait=function(time){
if(time<this.opTime){
return;
}
var _273=document.body.clientWidth;
var _274=document.body.clientHeight;
icon.wdiv.style.left=_273*_26f;
icon.wdiv.style.top=_274*_270;
icon.wdiv.style.display="";
};
this.waitend=function(){
this.opTime=(new Date).getTime();
icon.wdiv.style.display="none";
};
}
function setHoverColor(e){
e.style.backgroundColor="#c4e4e4";
}
function unsetHoverColor(e){
e.style.backgroundColor="#f4f4f4";
}
function pageNavi(_277,_278,_279,_27a){
this.ndiv=document.getElementById(_277);
this.pageCap=_278;
this.maxPageNum=_279;
this.showPageNavi=function(_27b,_27c){
var _27d=this.maxPageNum;
if(this.maxPageNum*this.pageCap>_27c){
_27d=Math.ceil(_27c/_278);
}
var _27e=_27b+Math.floor(this.maxPageNum/2);
if(_27e<_27d){
_27e=_27d;
}
if(_27e*this.pageCap>_27c){
_27e=Math.ceil(_27c/_278);
}
var html="";
if(_27c>_278){
html+="<table id=\"navbar\"><tbody><tr><td>";
html+="<div style=\"border: medium none ; width: 45px;\"><nobr>";
html+="<a id=\"lpage\"  class=\"text75\" href=\"javascript:void(0)\" onclick=\"javascript:cLog('','search','pageNaviPre');"+_27a+"("+(_27b-1)+")\">\u4e0a\u4e00\u9875</a>&nbsp;&nbsp;";
html+="</nobr></div></td>";
var _280=0;
for(var i=_27e-_27d+1;i<=_27e&&_280<=_27d;i++){
if(i>0){
html+="<td>";
if(i==_27b){
html+="<div style=\"background-color: rgb(244, 244, 244);\" class=\"navbarpagenumber text75\" onmouseover=\"setHoverColor(this)\" onmouseout=\"unsetHoverColor(this)\">"+i+"</div>";
}else{
html+="<a href=\"javascript:void(0);\" onclick=\"javascript:cLog('','search','pageNavi_"+i+"');"+_27a+"("+(i)+")\"><div class=\"navbarpagenumber text75\" onmouseover=\"setHoverColor(this)\" onmouseout=\"unsetHoverColor(this)\">"+i+"</div></a>";
}
html+="</td>";
_280++;
}
}
html+="<td><div style=\"border: medium none ; width: 45px;\"><nobr>";
html+="<a id=\"npage\" class=\"text75\" href=\"javascript:void(0)\" onclick=\"javascript:cLog('','search','pageNaviNext');"+_27a+"("+(_27b+1)+")\" >\u4e0b\u4e00\u9875</a>";
html+="</nobr></div></td></tr></tbody></table>";
}
this.ndiv.innerHTML=html;
if(_27c>_278){
if(_27b<=1){
document.getElementById("lpage").style.visibility="hidden";
}
if(_27c<=_27b*_278){
document.getElementById("npage").style.visibility="hidden";
}
}
};
this.hide=function(){
this.ndiv.style.display="none";
};
}
function UserDefaultLoc(_282){
this.lo="";
this.la="";
this.name="";
this.level="";
this.code="";
if(_282!=undefined&&_282!=null){
var type=_282.resultType;
if(type==4&&_282.poiList.length>0){
var poi=_282.poiList[0];
if(poi&&poi!=null){
this.lo=poi.lo;
this.la=poi.la;
this.name=poi.name;
this.code=_282.city;
this.level=_282.tag;
}
}
}
}
function saveDefaultLocCookie(){
var obj=setDefaultLoc;
var _286=obj.defaultLoc;
var _287=new Image();
var _288="setcookie?cookie=";
var cVal=youdao.maps.basis.utils.encodeUrlStr(cookieVal);
if(_286.name&&_286.name!=""){
cVal=youdao.maps.basis.utils.encodeUrlStr(_286.name+","+_286.lo+","+_286.la+","+_286.level+","+_286.code);
cookieValue.code=_286.code;
}
_287.src=_288+cVal+"&"+(new Date()).getTime();
obj.showSetLocResult();
}
function clearDefaultLocCookie(_28a){
var obj=setDefaultLoc;
var _28c=new Image();
var _28d="setcookie?cookie=";
var _28e="";
_28c.src=_28d+_28e+"&"+(new Date()).getTime();
obj.showSetDefaultLoc();
}
function SetDefaultLocDiv(_28f){
this.div=document.getElementById(_28f);
this.div.style.paddingLeft="7px";
this.defaultLoc=new UserDefaultLoc(curSearchResult);
var html="";
this.showSetDefaultLoc=function(){
this.showMe();
html="<a href=\"javascript:saveDefaultLocCookie()\"><font size=-1>\u8bbe\u4e3a\u6211\u7684\u9ed8\u8ba4\u5730\u70b9</font></a>";
this.div.innerHTML=html;
};
this.showSetLocResult=function(){
this.showMe();
html="<font size=-1>\u5df2\u8bbe\u7f6e\u5f53\u524d\u4f4d\u7f6e\u4e3a\u60a8\u7684\u9ed8\u8ba4\u5730\u70b9\uff0c\u60a8\u4e0b\u6b21\u8bbf\u95ee\u65f6\uff0c\u5730\u56fe\u5c06\u5b9a\u4f4d\u5230\u6b64\u5904\u3002\u60a8\u53ef\u4ee5\u70b9\u51fb\u4ee5\u4e0b\u94fe\u63a5\u6e05\u9664\u6b64\u8bbe\u7f6e\u3002<br>"+"</font><a href=\"javascript:clearDefaultLocCookie()\"><font size=-1>\u6e05\u9664\u6211\u7684\u9ed8\u8ba4\u5730\u70b9"+"</font></a>";
this.div.innerHTML=html;
};
this.showRemoveLocResult=function(){
this.showMe();
html="<font size=-1>\u5f53\u524d\u663e\u793a\u60a8\u7684\u9ed8\u8ba4\u5730\u70b9\uff0c\u60a8\u53ef\u4ee5\u70b9\u51fb\u4ee5\u4e0b\u94fe\u63a5\u6e05\u9664\u6b64\u8bbe\u7f6e\u3002<br><a href=\"javascript:clearDefaultLocCookie()\"><font size=-1>\u6e05\u9664\u6211\u7684\u9ed8\u8ba4\u5730\u70b9"+"</font></a>";
this.div.innerHTML=html;
};
this.showMe=function(){
this.defaultLoc=new UserDefaultLoc(curSearchResult);
this.div.style.display="block";
};
}
function resultPoints2GeoPoints(_291){
var _292=[];
for(var i=0;i<_291.length;i++){
_292.push(new youdao.maps.GeoPoint(_291[i].longitude,_291[i].latitude));
}
return _292;
}
var tip;
function measureDist(){
map.setMode(youdao.maps.Default.MODE.MEASURE_DISTANCE);
}
function KeyPoints2GeoPoints(_294){
var _295=[];
for(var i=0;i<_294.length;i++){
_295.push(new youdao.maps.GeoPoint(_294[i].lo,_294[i].la));
}
return _295;
}
function suggestRefresh(_297){
if(sa){
sa.setInputId("place");
}
if(sc){
sc.setInputId("to");
}
if(sb){
sb.setInputId("from");
}
if(_297==1){
sc.setSelectCallBack(goBusSearch);
}
if(_297==2){
sc.setSelectCallBack(goNaviSearch);
}
}
function doPrint(){
window.print();
}
String.prototype.trim=function(){
return this.replace(/(^\s*)|(\s*$)/g,"");
};
function updateSuggests(){
var _298=code2str(citypara);
if(sa){
sa.setSugMoreParams("&key=map&city="+_298);
}
if(sb){
sb.setSugMoreParams("&key=map&city="+_298);
}
if(sc){
sc.setSugMoreParams("&key=map&city="+_298);
}
}
boxEventRefresh(1);
var suggestServer="http://ditu.youdao.com/";
sa=new AutoComplete("place","sa",true);
sa.setSugServer(suggestServer);
sa.setSearchParamName("query");
sa.setSugMoreParams("&key=test&src=first");
sa.setSelectCallBack(golocalSearch);
sc=new AutoComplete("to","sc",true);
sc.setSugServer(suggestServer);
sc.setObjectName("sc");
sc.setSearchParamName("q");
sc.setSugMoreParams("&key=test&src=first");
sc.setSelectCallBack(goBusSearch);
sb=new AutoComplete("from","sb",true);
sb.setSugServer(suggestServer);
sb.setObjectName("sb");
sb.setSearchParamName("q");
sb.setSugMoreParams("&key=test&src=first");
sb.setSelectCallBack(focusNext);
var histoory=new youdao.maps.basis.utils.History();
function saveHistory(para){
youdao.maps.basis.Log.log("saveHistory -> "+para);
if(histoory.skip){
histoory.skip=false;
}else{
histoory.save(para);
}
}
var getHis=function(e){
youdao.maps.basis.Log.log("call getHis  "+e.anchor);
if(e){
var para=e.anchor;
histoory.skip=true;
searchURL(para);
window.location.hash=para;
}
};
histoory.addStateHandler(getHis);
function getElementPos(_29c){
var ua=navigator.userAgent.toLowerCase();
var _29e=(ua.indexOf("opera")!=-1);
var isIE=(ua.indexOf("msie")!=-1&&!_29e);
var el=document.getElementById(_29c);
if(el.parentNode==null||el.style.display=="none"){
return [0,0];
}
var _2a1=null;
var pos=[];
var box;
if(el.getBoundingClientRect){
box=el.getBoundingClientRect();
var _2a4=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
var _2a5=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);
return [box.left+_2a5,box.top+_2a4];
}else{
if(document.getBoxObjectFor){
box=document.getBoxObjectFor(el);
var _2a6=(el.style.borderLeftWidth)?parseInt(el.style.borderLeftWidth):0;
var _2a7=(el.style.borderTopWidth)?parseInt(el.style.borderTopWidth):0;
pos=[box.x-_2a6,box.y-_2a7];
}else{
pos=[el.offsetLeft,el.offsetTop];
_2a1=el.offsetParent;
if(_2a1!=el){
while(_2a1){
pos[0]+=_2a1.offsetLeft;
pos[1]+=_2a1.offsetTop;
_2a1=_2a1.offsetParent;
}
}
if(ua.indexOf("opera")!=-1||(ua.indexOf("safari")!=-1&&el.style.position=="absolute")){
pos[0]-=document.body.offsetLeft;
pos[1]-=document.body.offsetTop;
}
}
}
if(el.parentNode){
_2a1=el.parentNode;
}else{
_2a1=null;
}
while(_2a1&&_2a1.tagName!="BODY"&&_2a1.tagName!="HTML"){
pos[0]-=_2a1.scrollLeft;
pos[1]-=_2a1.scrollTop;
if(_2a1.parentNode){
_2a1=_2a1.parentNode;
}else{
_2a1=null;
}
}
return pos;
}
function seturl(_2a8,_2a9,_2aa){
_2a8.href="http://"+_2a9+".youdao.com/";
if(window.RegExp&&window.encodeURIComponent){
var _2ab="";
if(inputBox){
_2ab=inputBox.value;
}
if(_2ab!=""){
_2ab=_2ab.replace(/(^link:)|(^inlink:)|(^related:)/,"");
_2a8.href=youdao.maps.basis.utils.encodeUrlStr(_2a8.href+"search?q="+_2ab+"&keyfrom="+_2aa);
}
}
return 1;
}

