﻿var ms_bug_value;function mapbarInputSuggest(options){var inputid=options.inputid||"";this.inputField=document.getElementById(inputid);if(!this.inputField)return;else{this.inputField.setAttribute("autocomplete","off")}this.className="citySuggest"||"";this.suggestType=this.inputField.getAttribute("suggestType")||"";this.requestMode=options.requestMode||"script";this.requestDelegate=options.requestDelegate;this.selectDoneCbk=options.selectDoneCbk||"";this.lastKeyCode=-1;this.eventKeycode="";this.lastText=this.inputField.value;this.cursorUpDownPressed=false;this.xmlHttp=null;this.selectSuggestIndex=0;this.suggestDiv=null;this.keyupTimer=null;this.filterEnterKey=false;this.keyupTimerId="";this.lostFocus=true;this.startIndex=1;this.endIndex=0;this.divTag="div";this.suggestid=options.suggestid||"suggestDiv";this.ca=1;this.Aa=1;this.bgColor="#0000ff";this.foreColor="#FFFFFF";this.url=options.posturl||"";if(this.url=="")return;this.onBlurHandler=function(event){this.lostFocus=true;if(!event&&window.event){event=window.event}if(!this.cursorUpDownPressed){this.hidesuggestDiv();if(this.lastKeyCode==9){this.lastKeyCode=-1}}this.cursorUpDownPressed=false};this.onFocusHandler=function(){this.lostFocus=false};this.onKeyPressHandler=function(obj){var e=this.onKeyPressHandler.caller.arguments[0]||window.event;var keycode=e.keyCode||e.which;if(keycode==13&&obj.filterEnterKey){if(this.suggestDiv.style.display!="none"&&this.selectSuggestIndex!=0){if(window.event){e.returnValue=false;e.cancelBubble=true}else{e.preventDefault();e.stopPropagation()}}}};this.okuh=function(obj){var e=this.okuh.caller.arguments[0]||window.event;obj.eventKeycode=e.keyCode||e.which;obj.handleKeyEvent()};this.onChangeHandler=function(thisObj){if(thisObj.inputField.value==thisObj.inputField.defaultValue)return;var V=thisObj.inputField.value;if(thisObj.lastText!=V){if(V!=""){V=V.substring(V.length-1,V.length)}thisObj.eventKeycode=V;thisObj.handleKeyEvent()}};this.setInputFieldFocus=function(){this.inputField.focus()};this.handleKeyEvent=function(){if(this.eventKeycode==39||this.eventKeycode==37){if(this.suggestDiv==null||(this.suggestDiv!=null&&this.suggestDiv.style.display!="none")){return}}if(this.eventKeycode==40||this.eventKeycode==38){this.setInputFieldFocus()}var V=this.inputField.value;if(this.eventKeycode!=0){if(this.eventKeycode==13||this.eventKeycode==3){var d=this.inputField;if(d.createTextRange){var t=d.createTextRange();t.moveStart("character",d.value.length);t.select()}else if(d.setSelectionRange){d.setSelectionRange(d.value.length,d.value.length)}}else{if(this.inputField.value!=V){this.selectEntry(V)}}}if(this.handleCursorUpDownEnter(this.eventKeycode)&&this.eventKeycode!=0){if(this.lastText!=V||this.eventKeycode==39||this.eventKeycode==37){this.lastText=V;window.clearTimeout(this.keyupTimerId);if(V!=""){var delegate=function(thisObj,para1,para2){return function(){thisObj.getSuggestInfo(para1,para2)}};var hidectrl=document.getElementsByName("city")[0]||{value:"北京市"};this.keyupTimerId=window.setTimeout(delegate(this,V,this.inputField.getAttribute("city")||hidectrl.value),250)}else{this.showSuggestList([],this.suggestDiv)}}}};this.selectEntry=function(text){this.inputField.value=text;this.lastText=text;if(this.selectDoneCbk!="")eval(this.selectDoneCbk+"('"+text+"')")};this.getDivInnerHtml=function(div_id){var value="";if(document.getElementById(div_id))value=document.getElementById(div_id).getAttribute("value");ms_bug_value=value;return value};this.setStyleForPerElement=function(c){if(document.getElementById(c)){document.getElementById(c).style.background="";document.getElementById(c).style.color=""}};this.setStyleForElement=function(c,km){if(this.suggestType.length!=0&&this.suggestType=="city"){var temp=c;var pre=c-1;var next=c+1;c="s_"+c;if(pre==this.startIndex-1)pre=this.endIndex;if(next==this.endIndex+1)next=this.startIndex;pre="s_"+pre;next="s_"+next;if(document.getElementById(c)){document.getElementById(c).style.background=this.bgColor;document.getElementById(c).style.color=this.foreColor}if(document.getElementById(pre)&&km=="key"){document.getElementById(pre).style.background="";document.getElementById(pre).style.color=""}if(document.getElementById(next)&&km=="key"){document.getElementById(next).style.background="";document.getElementById(next).style.color=""}if(document.getElementById(c)&&km=="key")this.selectEntry(this.getDivInnerHtml(c))}else{var pre=c-1;var next=c+1;c="s_"+c;if(pre==this.startIndex-1)pre=this.endIndex;if(next==this.endIndex+1)next=this.startIndex;pre="s_"+pre;next="s_"+next;if(document.getElementById(c)){document.getElementById(c).style.background=this.bgColor;document.getElementById(c).style.color=this.foreColor}if(document.getElementById(pre)&&km=="key"){document.getElementById(pre).style.background="";document.getElementById(pre).style.color=""}if(document.getElementById(next)&&km=="key"){document.getElementById(next).style.background="";document.getElementById(next).style.color=""}if(document.getElementById(c)&&km=="key")this.selectEntry(this.getDivInnerHtml(c))}};this.highlightNewValue=function(index,km){if(index<this.startIndex){index=this.endIndex}if(index>this.endIndex){index=this.startIndex}ms_bug_value=this.getDivInnerHtml("s_"+index);this.setStyleForElement(index,km);this.selectSuggestIndex=index};this.handleCursorUpDownEnter=function(eventCode){this.clearStyle();var keyEnable=true;if(eventCode==40){this.highlightNewValue(parseInt(this.selectSuggestIndex)+1,"key");return false}else if(eventCode==38){this.highlightNewValue(parseInt(this.selectSuggestIndex)-1,"key");return false}else if(eventCode==13||eventCode==3){if(this.suggestDiv.style.display!="none"&&this.selectSuggestIndex!=0){this.hidesuggestDiv()}if(typeof ms_bug_value!="undefined"&&ms_bug_value!="undefined"){this.selectEntry(ms_bug_value);ms_bug_value="undefined"}return false}return keyEnable};this.initACPartTwo=function(){if(this.inputField.getAttribute("enterkey_bubble")=="yes"){this.filterEnterKey=true}var eventHandler=function(obj){return function(){obj.onBlurHandler(obj)}};this.inputField.onblur=eventHandler(this);eventHandler=function(obj){return function(){obj.onFocusHandler(obj)}};this.inputField.onfocus=eventHandler(this);eventHandler=function(obj){return function(){obj.onKeyPressHandler(obj)}};this.inputField.onkeypress=eventHandler(this);eventHandler=function(obj){return function(){obj.okuh(obj)}};this.inputField.onkeyup=eventHandler(this);if(!(this.suggestDiv=document.getElementById(this.suggestid))){this.suggestDiv=document.createElement("DIV");this.suggestDiv.className=this.className;this.suggestDiv.id=this.suggestid;this.suggestDiv.style.borderRight="black "+this.ca+"px solid";this.suggestDiv.style.borderLeft="black "+this.ca+"px solid";this.suggestDiv.style.borderTop="black "+this.Aa+"px solid";this.suggestDiv.style.borderBottom="black "+this.Aa+"px solid";this.suggestDiv.style.zIndex="100";this.suggestDiv.style.paddingRight="0";this.suggestDiv.style.paddingLeft="0";this.suggestDiv.style.paddingTop="0";this.suggestDiv.style.paddingBottom="0";this.setsuggestDivSize();this.suggestDiv.style.display="none";this.suggestDiv.style.position="absolute";this.suggestDiv.style.backgroundColor="white";document.body.appendChild(this.suggestDiv);eventHandler=function(obj){return function(){obj.resizeHandler(obj)}};if(window.HTMLElement){window.addEventListener("resize",eventHandler(this),false)}else{window.attachEvent("onresize",eventHandler(this))}}eventHandler=function(thisObj){return function(){thisObj.onChangeHandler(thisObj)}};window.setInterval(eventHandler(this),100)};this.resizeHandler=function(instance){instance.setsuggestDivSize()};this.setinputFieldSize=function(){var xa=document.body.scrollWidth-220;xa=0.73*xa;this.inputField.size=Math.floor(xa/6.18)};this.lb=function(n){var N=-1;if(n.createTextRange){var fa=document.selection.createRange().duplithis.cate();N=fa.text.length}else if(n.setSelectionRange){N=n.selectionEnd-n.selectionStart}return N};this.bb=function(n){var v=0;if(n.createTextRange){var fa=document.selection.createRange().duplicate();fa.moveEnd("textedit",1);v=n.value.length-fa.text.length}else if(n.setSelectionRange){v=n.selectionStart}else{v=-1}return v};this.cc=function(d){if(d.createTextRange){var t=d.createTextRange();t.moveStart("character",d.value.length);t.select()}else if(d.setSelectionRange){d.setSelectionRange(d.value.length,d.value.length)}};this.calculateWidth=function(){if(navigator&&navigator.userAgent.toLowerCase().indexOf("msie")==-1){return this.inputField.offsetWidth-this.ca*2}else{return this.inputField.offsetWidth}};this.calculateOffsetLeft=function(r){return this.Ya(r,"offsetLeft")};this.calculateOffsetTop=function(r){return this.Ya(r,"offsetTop")};this.Ya=function(r,attr){var kb=0;while(r){kb+=r[attr];r=r.offsetParent}return kb};this.setsuggestDivSize=function(){if(this.suggestDiv){this.suggestDiv.style.left=this.calculateOffsetLeft(this.inputField)+"px";this.suggestDiv.style.top=this.calculateOffsetTop(this.inputField)+this.inputField.offsetHeight-1+"px";if(null==this.suggestType||this.suggestType.length==0){this.suggestDiv.style.width=this.calculateWidth()+"px"}else{this.suggestDiv.style.width=2*this.calculateWidth()+"px"}}};this.showsuggestDiv=function(){if(!this.lostFocus){document.getElementById(this.suggestid).style.display="";this.setsuggestDivSize()}};this.hidesuggestDiv=function(){document.getElementById(this.suggestid).innerHTML="";document.getElementById(this.suggestid).style.display="none"};this.getxmlHttp=function(){var A=null;if(window.ActiveXObject){try{A=new ActiveXObject("Msxml3.XMLHTTP")}catch(e){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(oc){A=null}}}else if(window.XMLHttpRequest){A=new XMLHttpRequest();if(A.overrideMimeType)A.overrideMimeType('text/xml')}return A};this.getSuggestInfo=function(keyword,city){var para="keyword="+encodeURI(keyword)+"&city="+encodeURI(city);var posturl=this.url+para;if(this.requestMode=="ajax"){if(this.xmlHttp&&this.xmlHttp.readyState!=0)this.xmlHttp.abort();this.xmlHttp=this.getxmlHttp();if(this.xmlHttp){this.xmlHttp.open("GET",posturl,true);var stateChangeWrapper=function(){return function(){if(this.xmlHttp.readyState==4&&this.xmlHttp.responseText){if(this.xmlHttp.responseText.charAt(0)!="<"){eval(this.xmlHttp.responseText);this.createlist()}}}};this.xmlHttp.onreadystatechange=stateChangeWrapper();this.xmlHttp.send(null)}}else if(this.requestMode=="script"){this.getSuggestInfoByScriptBlock(posturl)}else if(this.requestMode=="custom"&&this.requestDelegate){var getCallback=function(thisObj){return function(){thisObj.createlist()}};this.requestDelegate(posturl,getCallback(this))}};this.getSuggestInfoByScriptBlock=function(url){var id="__suggestRequest";var head=document.getElementsByTagName("head")[0];var sT=document.getElementById(id);if(sT){sT.parentNode.removeChild(sT)}var s=document.createElement("script");head.appendChild(s);s.setAttribute("language","javascript");s.setAttribute("type","text/javascript");s.setAttribute("id",id);s.setAttribute("src",url);var cFun=function(thisObj){return function(){if(typeof ActiveXObject!="undefined"){if(s.readyState&&s.readyState=="loaded"){thisObj.createlist()}}else{thisObj.createlist()}}};s.onload=s.onreadystatechange=cFun(this)};this.createlist=function(){if(typeof jsondata=="undefined"){jsondata={results:[]}}var aSuggestions=[];for(var i=0;i<jsondata.results.length;i++){var ename=jsondata.results[i].ename;if(typeof ename=="undefined"){aSuggestions.push({'id':jsondata.results[i].id,'value':jsondata.results[i].value,'info':jsondata.results[i].info})}else{aSuggestions.push({'id':jsondata.results[i].id,'value':jsondata.results[i].value,'info':jsondata.results[i].info,'ename':jsondata.results[i].ename})}}this.showSuggestList(aSuggestions)};this.showSuggestList=function(arr){if(document.getElementById("lessCityList")){document.getElementById("lessCityList").style.display="none"}var cdiv=this.suggestDiv;while(cdiv.childNodes.length>0){cdiv.removeChild(cdiv.childNodes[0])}if(this.suggestType.length!=0&&this.suggestType=="city"){if(arr.length==0){if(this.inputField.value.length==0){this.hidesuggestDiv();return}else{this.hidesuggestDiv();return}}else{var div=document.createElement("DIV");div.className="divsuggest";var value=this.inputField.value;div.innerHTML=value+"，按拼音排序";cdiv.appendChild(div)}}else{if(arr.length==0){this.hidesuggestDiv();return}}for(var i=0;i<arr.length;i++){var u=document.createElement("DIV");u.id="s_"+arr[i].id;u.style.fontSize="13px";u.style.width="100%";u.setAttribute("value",arr[i].value);var eventWrapper=function(obj){return function(){obj.MOver(obj)}};u.onmouseover=eventWrapper(this);eventWrapper=function(obj){return function(){obj.MDown(obj)}};u.onmousedown=eventWrapper(this);eventWrapper=function(obj){return function(){obj.MOut(obj)}};u.onmouseout=eventWrapper(this);if(this.suggestType.length==0||this.suggestType==""){u.innerHTML=arr[i].value}else{u.innerHTML=("<table border='0px' style='width:100%;' id='tb_"+arr[i].id+"'><tr id='tr_"+arr[i].id+"'><td valign='top' style='width:50%' id='td_"+arr[i].id+"' value ="+arr[i].value+">"+arr[i].value+"</td><td id='td2_"+arr[i].id+"' style='text-align:right' value="+arr[i].value+">"+arr[i].ename+"</td></tr></table>")}cdiv.appendChild(u);if(i>10&&this.suggestType.length!=0&&this.suggestType=="city"){var ua=document.createElement("div");ua.style.textAlign="right";ua.style.padding="2px";var lessArr=[];lessArr.push("<a class=\"morecityspan\" style = 'color:#000000;' href ='javascript:void(0)' id=\"moreCityA\" onmousedown=\"window.open('/help/city.html','_blank')\">更多&nbsp;&raquo;</a>");ua.innerHTML=lessArr.join("");cdiv.appendChild(ua);break}}this.selectSuggestIndex=0;this.showsuggestDiv();this.getTagCountByName(this.suggestDiv)};this.getTagCountByName=function(tag){var count=tag.getElementsByTagName(this.divTag);this.endIndex=count.length};this.clearStyle=function(){if(this.selectSuggestIndex!=0){if(document.getElementById("s_"+this.selectSuggestIndex)){document.getElementById("s_"+this.selectSuggestIndex).style.background="";document.getElementById("s_"+this.selectSuggestIndex).style.color=""}}};this.MDown=function(instance){var e=this.MDown.caller.arguments[0]||window.event;var srcElement=e.srcElement||e.target;var value=document.getElementById(srcElement.id).getAttribute("value");if(this.suggestType=="city"){value=document.getElementById(srcElement.id).getAttribute("value")}this.inputField.blur();this.inputField.focus();ms_bug_value="undefined";instance.selectEntry(value);instance.hidesuggestDiv()};this.MOver=function(instance){instance.clearStyle();var e=this.MOver.caller.arguments[0]||window.event;var srcElement=e.srcElement||e.target;var s_id=srcElement.id.substring(2);if(this.suggestType.length!=0&&this.suggestType=="city"){s_id=srcElement.id.split("_")[1]}instance.highlightNewValue(s_id,"Mouse")};this.MOut=function(instance){var e=this.MOut.caller.arguments[0]||window.event;var srcElement=e.srcElement||e.target;instance.setStyleForPerElement(srcElement.id)};this.initACPartTwo()}mapbarInputSuggest.bind=function(posturl,requestMode,requestDelegate){var elements=document.getElementsByTagName("input");for(var i=0;i<elements.length;i++){if(elements[i].type=="text"&&elements[i].getAttribute("issuggest")=="yes"){var posturl2=elements[i].getAttribute("posturl")||posturl;var selectdone_callback=elements[i].getAttribute("selectdone_callback");new mapbarInputSuggest({inputid:elements[i].id,posturl:posturl2,requestMode:requestMode,requestDelegate:requestDelegate,selectDoneCbk:selectdone_callback})}}};if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.object=="undefined"){window.mapbar.object={}}(function(package){jQuery.extend(package,{createClass:function(superClass,newMethod){var parent=typeof superClass=="function"?jQuery.extend({},superClass.prototype):superClass;var newClass=function(){if(jQuery.isFunction(this.init)){this.init.apply(this,arguments)}else if(jQuery.isFunction(newClass.init)){newClass._super.init.apply(this,arguments)}};newClass._super=parent;jQuery.extend(newClass.prototype,parent,newMethod,{bind:function(name,data,func){var _j_this=jQuery(this);_j_this.bind.apply(_j_this,arguments)},one:function(name,data,func){var _j_this=jQuery(this);_j_this.one.apply(_j_this,arguments)},trigger:function(name,data){var _j_this=jQuery(this);_j_this.trigger.apply(_j_this,arguments)},triggerHandler:function(name,data){var _j_this=jQuery(this);_j_this.triggerHandler.apply(_j_this,arguments)},unbind:function(name,data){var _j_this=jQuery(this);_j_this.unbind.apply(_j_this,arguments)}});return newClass},funcToArray:function(arr,func){var array=arr||new Array();if(func){if(func instanceof Array){array=array.concact(func)}else if(jQuery.isFunction(func)){array.push(func)}}return array}})})(mapbar.object);window.mapbar=window.mapbar||{};mapbar.util=mapbar.util||{};(function(package){var _cookie={setCookie:function(name,value,option){var str=name+"="+escape(value);if(option){if(option.expireDays){var date=new Date();var ms=option.expireDays*24*3600*1000;date.setTime(date.getTime()+ms);str+="; expires="+date.toGMTString()};if(option.path){str+="; path="+option.path}if(option.domain){str+="; domain="+option.domain}if(option.secure){str+="; true"}}document.cookie=str},setMCookie:function(name,value,option){var domain=location.href.indexOf("mapbar.com")==-1?"":"mapbar.com";if(!option){option={expireDays:'30',domain:domain,path:'/'}}else{option.domain=domain}this.setCookie(name,value,option)},getCookie:function(name){var cookieRet="";var cookieArray=document.cookie.split("; ");for(var i=0;i<cookieArray.length;i++){var arr=cookieArray[i].split("=");if(arr[0]==name){cookieRet=unescape(arr[1])}};return cookieRet},deleteCookie:function(name){this.setCookie(name,"",{expireDays:-1})}};package.cookie=_cookie;var _request={getHashObj:function(newUrl){newUrl=newUrl||window.location.hash;var request={};var strs=newUrl;if(newUrl.lastIndexOf("#")>=0){strs=newUrl.substr(newUrl.lastIndexOf("#")+1);strs=strs.split("&");for(var id=0;id<strs.length;id++){if(strs[id].indexOf("=")>0){request[strs[id].split("=")[0]]=strs[id].split("=")[1]}}}return request},getParamObj:function(newUrl){newUrl=newUrl||window.location.href;var request={};var strs=newUrl;if(newUrl.indexOf("?")>=0){strs=newUrl.substr(newUrl.indexOf("?")+1);if(strs.indexOf("#")>=0){strs=strs.substr(0,strs.indexOf("#"))}strs=strs.split("&");for(var id=0;id<strs.length;id++){if(strs[id].indexOf("=")>0){request[strs[id].split("=")[0]]=strs[id].split("=")[1]}}}return request},getObj:function(newUrl){var paramObj=this.getParamObj(newUrl);var hashObj=this.getHashObj(newUrl);for(var key in paramObj){hashObj[key]=paramObj[key]}return hashObj},toHashString:function(requestObj){var newHash="";for(var i in requestObj){if(i!=""&&requestObj[i]!=undefined&&requestObj[i]!=""&&requestObj[i]!="undefined"){newHash+=(newHash==""?"":"&")+i+"="+requestObj[i]}}return newHash}};package.request=_request;var _extend=function(destination,source){for(var property in source){destination[property]=source[property]}return destination};var _createClass=function(){return function(){this.initialize.apply(this,arguments)}};var Transfer={};Transfer.Base=function(){};Transfer.Base.prototype={setOptions:function(options){if(typeof options!="object"){options={}}this.options={bCache:options.bCache||false,id:options.id||"scriptTemp",onfailure:options.onfailure||function(){},oncomplate:options.oncomplate||function(){}}}};Transfer.Request=_createClass();Transfer.Request.prototype=_extend(new Transfer.Base(),{initialize:function(url,options){this.setOptions(options);this.request(url)},request:function(url){this.url=url;this.bCache=this.options.bCache;this.id=this.options.id;this.oncomplate=this.options.oncomplate;this.onfailure=this.options.onfailure;this.symbol="?";if(this.url.indexOf("?")!=-1){this.symbol="&"}var head=document.getElementsByTagName("head")[0];var sT=document.getElementById(this.id);if(sT&&sT.src&&sT.src==this.url){this.oncomplate();return}if(sT){sT.parentNode.removeChild(sT)}var s=document.createElement("script");head.appendChild(s);s.setAttribute("language","javascript");s.setAttribute("type","text/javascript");s.setAttribute("id",this.id);s.setAttribute("src",(this.bCache&&this.bCache==true)?this.url+this.symbol+Math.random():this.url);var self=this;s.onload=s.onreadystatechange=function(){if(typeof ActiveXObject!="undefined"){if(s.readyState&&s.readyState=="loaded"){self.oncomplate()}if(s.readyState&&s.readyState=="complete"){return}}else{self.oncomplate()}};s.onerror=function(){if(s&&s.parentNode){s.parentNode.removeChild(s)}self.onfailure()}}});package.transfer={Request:Transfer.Request};function _v10toX(n,m){var ss="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@";m=String(m).replace(/ /gi,"");if(m==""){return""}if(parseInt(m)!=m){return""}var t="";var a=ss.substr(0,n);while(m!=0){var b=m%n;t=a.charAt(b)+t;m=(m-b)/n}return t};function getUtf8(str){var ret="";for(var i=0;i<str.length;i++){var charcode=String(str.charAt(i)).charCodeAt();if(charcode>256){var ccode=encodeURI(str.charAt(i));ret+=ccode}else{ret+=_v10toX(16,charcode)}}return ret};package.getUtf8=getUtf8;function toHtmlStr(str){if(typeof str!="string"){return str}str=str.replace(/</ig,"&lt;");str=str.replace(/>/ig,"&gt;");str=str.replace(/\r\n|\n\r|\n|\r/g,"<br>");str=str.replace(/\"/ig,"&quot;");str=str.replace(/\ /ig,"&nbsp;");return str};package.toHtmlStr=toHtmlStr})(mapbar.util);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.aop=="undefined"){window.mapbar.aop={}}(function(package){jQuery.extend(package,{addBefore:function(obj,methodName,func){if(typeof obj!="undefined"&&typeof methodName=="string"&&typeof func=="function"&&typeof obj[methodName]=="function"){var old=obj[methodName];obj[methodName]=function(){func.apply(this,arguments);var result=old.apply(this,arguments);return result};return old}},addAfter:function(obj,methodName,func){if(typeof obj!="undefined"&&typeof methodName=="string"&&typeof func=="function"&&typeof obj[methodName]=="function"){var old=obj[methodName];obj[methodName]=function(){var result=old.apply(this,arguments);func.apply(this,arguments);return result};return old}}})})(mapbar.aop);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.event=="undefined"){window.mapbar.event={}}(function(package){var cancelEvent=function(){try{package.cancelEvent.caller.arguments[0].cancelBubble=true}catch(e){}try{event.cancelBubble=true}catch(e){}};jQuery.extend(package,{cancelEvent:cancelEvent})})(mapbar.event);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.map=="undefined"){window.mapbar.map={}}(function(package){var InverseGeocoding=mapbar.object.createClass(null,{url:"http://geocode1.mapbar.com/inverse/json/getInverseGeocoding.jsp?",init:function(arg0){jQuery.extend(this,{url:arg0.url||this.url})},load:function(arg0){var url=arg0.url||this.url;url=(/\?$/g).test(url)?url:url+"?";url=url+"zoom="+arg0.zoom+"&latlon="+arg0.latlon;new mapbar.util.transfer.Request(url,{id:'mapbar_script_inverseGeocoding',oncomplate:function(){arg0.success(InverseGeocodingRs)}})},addCallback:function(callback){throw new Array("请实现方法:addCallBack");}});var MapletInverseGeocoding=mapbar.object.createClass(InverseGeocoding,{maplet:null,timer:null,init:function(arg0){if(!arg0.maplet){throw new Error("缺少必要的参数:maplet");}MapletInverseGeocoding._super.init.apply(this,arguments);jQuery.extend(this,{maplet:arg0.maplet||this.maplet});this._regEvent()},_regEvent:function(){var _this=this;MEvent.addListener(this.maplet,"pan",function(){_this.run(500)});MEvent.addListener(this.maplet,"zoom",function(){_this.run(500)})},run:function(defer){var _this=this;if(this.timer){window.clearTimeout(this.timer)}this.timer=setTimeout(function(){_this.load({zoom:this.maplet.getZoomLevel(),latlon:this.maplet.getCenter(),success:function(result){_this.callback(result)}})},defer||0)},callback:function(result){},addCallback:function(callback){mapbar.aop.addAfter(this,"callback",callback)}});package.InverseGeocoding=InverseGeocoding;package.MapletInverseGeocoding=MapletInverseGeocoding})(mapbar.map);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.window=="undefined"){window.mapbar.window={}}(function(package){package.conf={WINDOW_DEFAULT_CLASSNAME:"mapbar_window"};var Window=mapbar.object.createClass(null,{group:null,dom:null,init:function(arg0){var _this=this;this.dom=typeof arg0.dom=="undefined"?this.getNewDom():jQuery(arg0.dom);this.dom.addClass(package.conf.WINDOW_DEFAULT_CLASSNAME);if(typeof arg0.className=="string"){this.dom.addClass(arg0.className)}if(typeof arg0.css=="object"){this.dom.css(arg0.css)}this.dom.get(0).onclick=function(){mapbar.event.cancelEvent()};this.group=arg0.group||this.group;if(this.group){if(this.group instanceof Array){jQuery.each(this.group,function(){this.add(_this)})}else{this.group.add(this)}}},getNewDom:function(){return jQuery("<div/>").hide().appendTo(jQuery(document.body))},show:function(){this.dom.show()},hide:function(){this.dom.hide()},toggle:function(){this.dom.toggle()},css:function(css){this.dom.css(css)},addChild:function(jq){this.dom.append(jq)},removeChild:function(){this.dom.empty()},destroy:function(){this.hide();this.dom.remove();delete this},toString:function(){return"mapbar.window.Window"}});var DependWindow=mapbar.object.createClass(Window,{dependDom:null,align:"right",valign:"bottom",offset:{top:0,left:0},init:function(arg0){DependWindow._super.init.call(this,arg0);this.dependDom=typeof arg0.dependDom=="undefined"?jQuery(document.body):jQuery(arg0.dependDom);jQuery.extend(this,{align:(arg0.align=="left"||arg0.align=="right"||arg0.align=="center")?arg0.align:this.align,valign:(arg0.valign=="top"||arg0.valign=="bottom"||arg0.valign=="middle")?arg0.valign:this.valign});this.offset=jQuery.extend({},this.offset,arg0.offset)},show:function(){this.adjust();DependWindow._super.show.call(this)},toggle:function(){this.adjust();DependWindow._super.toggle.call(this)},setDependDom:function(dependDom){if(dependDom){this.dependDom=jQuery(dependDom)}},adjust:function(){var dependDomOffset=this.dependDom.offset();var top=0;var left=0;if(this.align=="right"){left=dependDomOffset.left}else if(this.align=="left"){left=dependDomOffset.left+this.dependDom.width()-this.dom.width()}else if(this.align=="center"){left=dependDomOffset.left-Math.abs(this.dependDom.width()-this.dom.width())/2}if(this.valign=="top"){top=dependDomOffset.top}else if(this.valign=="bottom"){top=dependDomOffset.top+this.dependDom.height()}else if(this.valign=="middle"){top=dependDomOffset.top-Math.abs(this.dependDom.height()-this.dom.height())/2}this.dom.css({top:top+this.offset.top,left:left+this.offset.left})},toString:function(){return"mapbar.window.DependWindow"}});var TipWindow=mapbar.object.createClass(DependWindow,{contentDom:null,closeDom:null,arrow:true,arrowDom:null,init:function(arg0){var _this=this;if(typeof arguments[0]=="undefined"){arguments[0]={}}if(typeof arguments[0].offset=="undefined"){arguments[0].offset={top:0,left:0}}if(typeof arguments[0].offset.top=="undefined"){arguments[0].offset.top=0}arguments[0].offset.top+=6;this.arrow=typeof arguments[0].arrow!="boolean"?this.arrow:arguments[0].arrow;TipWindow._super.init.apply(this,arguments);this.dom.addClass("POPNav");this.dom.empty();var div0=jQuery("<div/>").addClass("br");this.dom.append(div0);var tipImg=jQuery('<span class="arrow" />').hide();this.arrowDom=tipImg;div0.append(jQuery('<div class="tl"/>').append(jQuery('<div class="tr"/>').append(jQuery('<div/>').append(this.arrowDom))));this.adjustArrow();if(this.arrow){this.arrowDom.show()}else{this.arrowDom.hide()}this.closeDom=jQuery('<span title="关闭" class="closeThis" />').click(function(){_this.close()}).hide();div0.append(this.closeDom);if(typeof arg0.close=="undefined"||arg0.close){this.showClose()}else{this.hideClose()}var mainDiv=jQuery('<div class="theMain"/>');div0.append(mainDiv);div0.append('<div class="bLine"/>');div0.append();var content=arg0.content;if(typeof content!="undefined"){if(content instanceof Array){for(var i=0;i<content.length;i++){mainDiv.append(content[i])}}else{mainDiv.append(content)}}this.contentDom=mainDiv},close:function(){this.hide()},showClose:function(){this.closeDom.show()},hideClose:function(){this.closeDom.hide()},clean:function(){this.contentDom.empty()},adjust:function(){TipWindow._super.adjust.apply(this,arguments);this.adjustArrow()},adjustArrow:function(){var arrowDomWidth=parseInt(this.arrowDom.css("width"))||0;if(this.align=="left"){this.arrowDom.css({right:this.dependDom.width()/2-(this.arrowDom.width()||arrowDomWidth)/2})}else if(this.align=="right"){this.arrowDom.css({left:this.dependDom.width()/2-(this.arrowDom.width()||arrowDomWidth)/2})}else if(this.align=="center"){this.arrowDom.css({left:this.dom.width()/2-(this.arrowDom.width()||arrowDomWidth)/2})}},addChild:function(jq){this.contentDom.append(jq)},removeChild:function(){this.contentDom.empty()},toString:function(){return"mapbar.window.TipWindow"}});var Group=mapbar.object.createClass(null,{name:null,member:null,init:function(arg0){arg0=arg0||{};this.member=[];var _member=arg0.member||[];for(var i=0;i<_member.length;i++){this.add(_member[i])}this.name=arg0.name},add:function(win){if(win){var exist=false;for(var i=0;i<this.member.length;i++){exist=win==this.member[i];if(exist){break}}if(!exist){this.member.push(win);return true}}return false},del:function(win){this.member=jQuery.grep(this.member,function(obj){return win==obj},true)},toString:function(){return"mapbar.window.Group"}});var SingleOpenGroup=mapbar.object.createClass(Group,{add:function(win){var _this=this;var isAdd=false;if(win){isAdd=SingleOpenGroup._super.add.call(this,win);if(isAdd){mapbar.aop.addBefore(win,"show",function(){jQuery.each(_this.member,function(){this.hide()})});mapbar.aop.addBefore(win,"toggle",function(){jQuery.each(_this.member,function(){if(win!=this){this.hide()}})})}}return isAdd}});var ClickCloseGroup=mapbar.object.createClass(Group,{init:function(){var _this=this;ClickCloseGroup._super.init.apply(this,arguments);jQuery(document).click(function(event){if(jQuery.browser.mozilla&&event.button!=0){return}_this.documentClickFunc()})},documentClickFunc:function(){jQuery.each(this.member,function(){this.hide()})}});var AutoAdjustGroup=mapbar.object.createClass(Group,{init:function(){var _this=this;AutoAdjustGroup._super.init.apply(this,arguments);jQuery(window).resize(function(){_this.documentResizeFunc()})},documentResizeFunc:function(){jQuery.each(this.member,function(){if(this.adjust)this.adjust()})}});jQuery.extend(package,{Window:Window,DependWindow:DependWindow,TipWindow:TipWindow,Group:Group,SingleOpenGroup:SingleOpenGroup,ClickCloseGroup:ClickCloseGroup,AutoAdjustGroup:AutoAdjustGroup})})(mapbar.window);﻿if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.window=="undefined"){window.mapbar.window={}}if(typeof window.mapbar.window.city=="undefined"){window.mapbar.window.city={}}(function(package){var chinaCityObj={strLatLon:"GVCUSBXUIWTCR",zoom:"1",code:"086",city:"全国",ename:'china',isbus:'0'};var getCityPropertiesByCity=function(cityValue){var cityProperties=null;if(typeof cityValue!="string"||jQuery.trim(cityValue)==""){return cityProperties}for(var i=0;i<cityData.province.length;i++){for(var j=0;j<cityData.province[i].city.length;j++){var cityName=cityData.province[i].city[j].cityName;if(cityName==cityValue||cityName==cityValue+"市"){cityProperties={};cityProperties.strLatLon=cityData.province[i].city[j].citylatlon;cityProperties.zoom=cityData.province[i].city[j].cityzoom;cityProperties.code=cityData.province[i].city[j].citycode;cityProperties.ename=cityData.province[i].city[j].esname;cityProperties.isbus=cityData.province[i].city[j].isbus;cityProperties.city=cityName;return cityProperties}}}return cityProperties};var lessCity=[{name:"全国",ename:"china"},{name:"北京市",ename:"beijing",center:"北京市",zoom:7},{name:"上海市",ename:"shanghai"},{name:"天津市",ename:"tianjin"},{name:"重庆市",ename:"chongqing"},{name:"广州市",ename:"guangzhou"},{name:"深圳市",ename:"shenzhen"},{name:"武汉市",ename:"wuhan"},{name:"西安市",ename:"xian"},{name:"沈阳市",ename:"shenyang"},{name:"南京市",ename:"nanjing"},{name:"成都市",ename:"chengdu"}];var cityhistory={historyArr:[],get:function(){this.historyArr=(mapbar.util.cookie.getCookie("historycity")!=""&&mapbar.util.cookie.getCookie("historycity")!="undefined")?mapbar.util.cookie.getCookie("historycity").split(","):[]},add:function(cityValue){if(typeof cityValue=="undefined"){return}this.get();for(var i=0;i<this.historyArr.length;i++){if(this.historyArr[i]==cityValue){this.historyArr.splice(i,1);break}}if(this.historyArr.length>3)this.historyArr.splice(0,1);this.historyArr.push(cityValue);mapbar.util.cookie.setCookie("historycity",this.historyArr.join(","),{expireDays:30,path:"/"});mapbar.util.cookie.setMCookie("historycity",this.historyArr.join(","),{expireDays:30,path:"/"})},exist:function(cityValue){for(var i=0;i<lessCity.length;i++){if(lessCity[i].name==cityValue){return true}}return false},contain:function(cityValue){for(var i=0;i<this.historyArr.length;i++){if(this.historyArr[i]==cityValue){return true}}return false},clear:function(){this.historyArr=[];mapbar.util.cookie.setCookie("historycity","",{expireDays:30,path:"/"});mapbar.util.cookie.setMCookie("historycity","",{expireDays:30,path:"/"})},toString:function(){this.get();return this.historyArr.join(",")},toArray:function(){this.get();return this.historyArr}};var LessCity=mapbar.object.createClass(null,{lessCity:null,dom:null,historyDom:null,historyParentDom:null,cityItemMaxNum:-1,init:function(arg0){var _this=this;if(!arg0.dom)throw new Error("缺少必要的参数:dom");this.cityItemMaxNum=typeof arg0.cityItemMaxNum=="number"?arg0.cityItemMaxNum:this.cityItemMaxNum;this.dom=jQuery(arg0.dom);this.historyParentDom=jQuery(arg0.historyDom);this.historyDom=jQuery("[name=mapbar_city_history_content]",this.historyParentDom);this.lessCity=arg0.lessCity||[].concat(lessCity);this.getCityItem=arg0.getCityItem||this.getCityItem;this.getHistoryCityItem=arg0.getHistoryCityItem||this.getHistoryCityItem;this.refresh()},refresh:function(){var _this=this;this.dom.empty();this.historyDom.empty();var newhistorycity=cityhistory.toArray();var temphistorycity=[];for(var i=0;i<newhistorycity.length;i++){temphistorycity.push(newhistorycity[i])}if(temphistorycity.length>0){for(var i=temphistorycity.length-1,j=0;j<3&&i>=0;i--,j++){if(temphistorycity[i]&&temphistorycity[i]!="undefined")_this.historyDom.append(_this.getHistoryCityItem({name:temphistorycity[i]})).append(" ")}_this.historyDom.show();_this.historyParentDom.show()}else{_this.historyDom.hide();_this.historyParentDom.hide()}for(var i=0;i<this.lessCity.length;i++){if(this.cityItemMaxNum>0&&i>=this.cityItemMaxNum){break}var cityObj=lessCity[i];_this.dom.append(_this.getCityItem({name:cityObj.name,ename:cityObj.ename}))}},show:function(){this.dom.show()},hide:function(){this.dom.hide()},getCityItem:function(cityInfo){return"请实现getCityItem方法"},getHistoryCityItem:function(cityInfo){return"请实现getHistoryCityItem方法"}});var newCitySuggest={selected:function(cityInfo){},setsuggestDivSize:function(){},divTag:"li",bgColor:"#E5EBF9",MDown:function(instance){var e=this.MDown.caller.arguments[0]||window.event;var srcElement=e.srcElement||e.target;var value=document.getElementById(srcElement.id).getAttribute("value");if(this.suggestType=="city"){value=document.getElementById(srcElement.id).getAttribute("value")}this.inputField.blur();this.inputField.focus();ms_bug_value="undefined";instance.selectEntry(value);instance.selected({name:value,ename:""});return false},highlightNewValue:function(index,km){if(index<this.startIndex){index=this.endIndex}if(index>this.endIndex){index=this.startIndex}ms_bug_value=this.getDivInnerHtml("s_"+index);this.setStyleForElement(index,km);this.selectSuggestIndex=index;this.selectSuggestIndexValue=ms_bug_value},onBlurHandler:function(event){this.lostFocus=true;if(!event&&window.event){event=window.event}if(!this.cursorUpDownPressed){if(this.lastKeyCode==9){this.lastKeyCode=-1}}this.cursorUpDownPressed=false},showSuggestList:function(arr){this.lessCity.hide();this.selectCityWindow.suggestCityArray=arr;var cdiv=this.suggestDiv;while(cdiv.childNodes.length>0){cdiv.removeChild(cdiv.childNodes[0])}if(this.suggestType.length!=0&&this.suggestType=="city"){if(arr.length==0){if(this.inputField.value.length==0){this.hidesuggestDiv();this.lessCity.show();return}else{this.hidesuggestDiv();this.lessCity.show();return}}else{var div=document.createElement("DIV");div.className="divsuggest";var value=this.inputField.value;div.innerHTML=value+"，按拼音排序"}}else{if(arr.length==0){this.hidesuggestDiv();return}}for(var i=0;i<arr.length;i++){if(this.cityItemMaxNum>0&&i>=this.cityItemMaxNum){break}var u=document.createElement("li");cdiv.appendChild(u);u.id="s_"+arr[i].id;u.setAttribute("value",arr[i].value);var eventWrapper=function(obj){return function(){obj.MOver(obj)}};u.onmouseover=eventWrapper(this);eventWrapper=function(obj){return function(){mapbar.event.cancelEvent();return obj.MDown(obj)}};u.onclick=eventWrapper(this);eventWrapper=function(obj){return function(){obj.MOut(obj)}};u.onmouseout=eventWrapper(this);if(this.suggestType.length==0||this.suggestType==""){u.innerHTML=arr[i].value}else{u.innerHTML='<a href="javascript:void(0);" onclick="return false;" id="td_'+arr[i].id+'" value="'+arr[i].value+'">'+arr[i].ename+' <span id="td2_'+arr[i].id+'" value="'+arr[i].value+'" style="cursor:pointer;">'+arr[i].value+'</span></a>'}if(i>10&&this.suggestType.length!=0&&this.suggestType=="city"){var ua=document.createElement("div");ua.style.textAlign="right";ua.style.padding="2px";var lessArr=[];ua.innerHTML=lessArr.join("");cdiv.appendChild(ua);break}}this.selectSuggestIndex=0;this.lostFocus=false;this.showsuggestDiv();this.getTagCountByName(this.suggestDiv)},handleCursorUpDownEnter:function(eventCode){this.clearStyle();var keyEnable=true;if(eventCode==40){this.highlightNewValue(parseInt(this.selectSuggestIndex)+1,"key");return false}else if(eventCode==38){this.highlightNewValue(parseInt(this.selectSuggestIndex)-1,"key");return false}else if(eventCode==13||eventCode==3){if(this.suggestDiv.style.display!="none"&&this.selectSuggestIndex!=0){if(this.selectSuggestIndexValue&&this.selectSuggestIndexValue.length>0){var d=this.inputField;this.selected({name:this.selectSuggestIndexValue})}}if(typeof ms_bug_value!="undefined"&&ms_bug_value!="undefined"){this.selectEntry(ms_bug_value);ms_bug_value="undefined"}return false}return keyEnable},handleKeyEvent:function(){if(this.eventKeycode==39||this.eventKeycode==37){if(this.suggestDiv==null||(this.suggestDiv!=null&&this.suggestDiv.style.display!="none")){return}}if(this.eventKeycode==40||this.eventKeycode==38){this.setInputFieldFocus()}var V=this.inputField.value;if(this.eventKeycode!=0){if(this.eventKeycode==13||this.eventKeycode==3){var d=this.inputField;if(d.createTextRange){var t=d.createTextRange();t.moveStart("character",d.value.length);t.select()}else if(d.setSelectionRange){d.setSelectionRange(d.value.length,d.value.length)}}else{if(this.inputField.value!=V){this.selectEntry(V)}}}if(this.handleCursorUpDownEnter(this.eventKeycode)&&this.eventKeycode!=0){if(this.lastText!=V||this.eventKeycode==39||this.eventKeycode==37){this.lastText=V;window.clearTimeout(this.keyupTimerId);if(V!=""){var delegate=function(thisObj,para1,para2){return function(){thisObj.getSuggestInfo(para1,para2)}};var hidectrl=document.getElementsByName("city")[0]||{value:"北京市"};this.keyupTimerId=window.setTimeout(delegate(this,V,this.inputField.getAttribute("city")||hidectrl.value),250)}else{this.showSuggestList([],this.suggestDiv);this.hidesuggestDiv();this.lessCity.refresh();this.lessCity.show()}}}}};var selectCityWindowId=0;var getSelectCityWindowId=function(){return selectCityWindowId++};var SelectCityWindow=mapbar.object.createClass(mapbar.window.TipWindow,{moreLinkDom:null,moreCityWindow:null,suggestDomId:null,lessCityDomId:null,inputDomId:null,historyCityDomId:null,dosearch:null,isCreateInputDom:true,moreCityWindowMinHeight:200,cityItemMaxNum:-1,showedViewLessCity:true,init:function(arg0){var _this=this;this.moreCityWindowMinHeight=typeof arg0.moreCityWindowMinHeight=="number"?arg0.moreCityWindowMinHeight:this.moreCityWindowMinHeight||0;this.cityItemMaxNum=typeof arg0.cityItemMaxNum=="number"?arg0.cityItemMaxNum:this.cityItemMaxNum;this.showedViewLessCity=typeof arg0.showedViewLessCity=="boolean"?arg0.showedViewLessCity:this.showedViewLessCity;var selected=function(cityInfo){if(cityInfo&&cityInfo.name){cityhistory.add(cityInfo.name);lessCity.refresh()}_this.selected(cityInfo)};this.moreLinkDom=jQuery('<a href="javascript:void(0);">更多&raquo;</a>').click(function(){if(!_this.moreCityWindow){_this.moreCityWindow=new mapbar.window.TipWindow({dependDom:_this.dom,align:"right",valign:"top",arrow:false,close:true,offset:{top:-6,left:_this.dom.width()+3},css:{width:500}});_this.moreCityWindow.contentDom.css({height:300,overflow:"auto"});_this.moreCityWindow.closeDom.css({right:20});var changeMoreCityLinkTextFunc=function(){if(_this.moreCityWindow.dom.is(":visible")){_this.moreLinkDom.html("收起更多&laquo;")}else{_this.moreLinkDom.html("更多&raquo;")}};mapbar.aop.addAfter(_this.moreCityWindow,"toggle",changeMoreCityLinkTextFunc);mapbar.aop.addAfter(_this.moreCityWindow,"show",changeMoreCityLinkTextFunc);mapbar.aop.addAfter(_this.moreCityWindow,"hide",changeMoreCityLinkTextFunc);var viewMorCity=function(cityData){var cityDl=document.createElement("dl");cityDl.className="moreCity";_this.moreCityWindow.contentDom.append(cityDl);var china=document.createElement("dt");var china_a=document.createElement("a");with(china_a){href="javascript:void(0);";innerHTML="全国"}china_a.style.fontWeight="normal";china_a.onclick=function(){selected({name:"全国",ename:"china"});return false};china.appendChild(china_a);cityDl.appendChild(china);for(var i=0;i<cityData.province.length;i++){var needAdd=false;if(!cityData.province[i].city||cityData.province[i].city.length<=0)continue;var dt=document.createElement("dt");var proviceName=cityData.province[i].pname;proviceName=proviceName.replace("内蒙古自治区","内蒙古").replace("西藏自治区","西藏").replace("新疆维吾尔自治区","新疆").replace("新疆维吾尔族自治区","新疆").replace("宁夏回族自治区","宁夏").replace("广西壮族自治区","广西").replace("省","");dt.innerHTML=proviceName;var dd=document.createElement("dd");for(var j=0;j<cityData.province[i].city.length;j++){needAdd=true;var a=document.createElement("a");with(a){href="javascript:void(0);";innerHTML=cityData.province[i].city[j].cityName}a.onclick=(function(i,j){return function(){selected({name:cityData.province[i].city[j].cityName,ename:cityData.province[i].city[j].esname});return false}})(i,j);dd.appendChild(a)}if(needAdd){cityDl.appendChild(dt);cityDl.appendChild(dd)}}_this.adjustMoreCity();_this.moreCityWindow.toggle()};if(cityData&&typeof cityData!="undefined"){viewMorCity(cityData)}else{new mapbar.data.DataSource({url:json_hotelcity,requestType:"script",success:viewMorCity,transform:function(){return cityData}}).load()}}else{_this.adjustMoreCity();_this.moreCityWindow.toggle()}return false});var num=getSelectCityWindowId();this.suggestDomId="mapbar_selectCity_suggest_"+num;this.lessCityDomId="mapbar_selectCity_lessCity_"+num;this.isCreateInputDom=typeof arg0.inputDomId!="undefined"?false:true;this.inputDomId=arg0.inputDomId||"mapbar_selectCity_input_"+num;this.historyCityDomId="mapbar_selectCity_history_"+num;arg0.content=arg0.content||[];arg0.content=arg0.content instanceof Array?arg0.content:[arg0.content];var content=this.getContent();content=content||[];content=content instanceof Array?content:[content];arg0.content=arg0.content.concat(content);SelectCityWindow._super.init.apply(this,arguments);this.dosearch=[];if(arg0.dosearch instanceof Array||typeof arg0.dosearch=="function"){if(arg0.dosearch instanceof Array){for(var i=0;i<arg0.dosearch.length;i++){this.dosearch.push(arg0.dosearch[i])}}else{this.dosearch.push(arg0.dosearch)}}var lessCity=this.lessCity=new LessCity({dom:"#"+this.lessCityDomId,historyDom:"#"+this.historyCityDomId,cityItemMaxNum:this.cityItemMaxNum,getCityItem:function(cityInfo){var _this=this;var dom=jQuery('<li style="cursor:pointer;"/>');dom.get(0).cityInfo=cityInfo;return dom.mouseover(function(){jQuery(this).css({backgroundColor:"#E5EBF9"})}).mouseout(function(){jQuery(this).css({backgroundColor:""})}).click(function(){mapbar.event.cancelEvent();selected(cityInfo);return false}).append('<a href="javascript:void(0);" onclick="return false;">'+(cityInfo.ename||"")+' <span style="cursor:pointer;">'+(cityInfo.name||"")+'</span></a>')},getHistoryCityItem:function(cityInfo){var _this=this;var dom=jQuery('<a href="javascript:void(0);"></a>');dom.get(0).cityInfo=cityInfo;return dom.mouseover(function(){jQuery(this).css({backgroundColor:"#E5EBF9"})}).mouseout(function(){jQuery(this).css({backgroundColor:""})}).click(function(){mapbar.event.cancelEvent();selected(cityInfo);return false}).html(cityInfo.name||"")}});jQuery("#"+this.inputDomId).attr("suggestType","city");var suggest=this.suggest=new mapbarInputSuggest({inputid:this.inputDomId,suggestid:this.suggestDomId,posturl:json_url_city_suggest||"http://suggest.mapbar.com/json/citySuggest.jsp?",requestMode:"script",selectDoneCbk:""});jQuery.extend(suggest,newCitySuggest,{selectCityWindow:this,cityItemMaxNum:this.cityItemMaxNum,lessCity:lessCity,selected:selected});if(!this.isCreateInputDom){jQuery("#"+this.inputDomId).keydown(function(evt){if(evt.keyCode==13){return false}})}if(this.showedViewLessCity){var showLessCity=function(){if(_this.isShow()){_this.showLessCity()}};mapbar.aop.addAfter(this,"toggle",showLessCity);mapbar.aop.addAfter(this,"show",showLessCity)}jQuery("#"+this.inputDomId).click(function(){jQuery(this).focus().select()})},showLessCity:function(){this.lessCity.show();this.suggest.hidesuggestDiv()},isShow:function(){return this.dom.is(":visible")},getContent:function(){var _this=this;var topDom=jQuery('<div class="TBorder"></div>');if(_this.isCreateInputDom){topDom.append(jQuery('<input type="text" suggestType="city" style="width:85%;border:2px solid #ddf;" />').attr("id",this.inputDomId).click(function(){this.select();this.focus()}))}topDom.append(jQuery('<div class="historyA">您浏览过的城市：</div>').attr("id",this.historyCityDomId).append(jQuery('<span></span>').attr("name","mapbar_city_history_content")));return[topDom,jQuery('<ul class="POPul"></ul>').attr("id",this.suggestDomId).hide(),jQuery('<ul class="POPul"></ul>').attr("id",this.lessCityDomId),jQuery('<p class="more1"></p>').append(this.moreLinkDom)]},show:function(){SelectCityWindow._super.show.call(this)},hide:function(){SelectCityWindow._super.hide.call(this);this.suggest.hidesuggestDiv();if(this.moreCityWindow){this.moreCityWindow.hide()}},toggle:function(){SelectCityWindow._super.toggle.call(this);if(this.dom.css("display")=="none"){if(this.moreCityWindow){this.moreCityWindow.hide()}}else{jQuery("#"+this.inputDomId).focus().select()}},adjust:function(){var _this=this;SelectCityWindow._super.adjust.call(this);setTimeout(function(){_this.adjustMoreCity()},10)},adjustMoreCity:function(){if(this.moreCityWindow){this.moreCityWindow.adjust();this.moreCityWindow.contentDom.height(Math.max(this.contentDom.height(),this.moreCityWindowMinHeight||0))}},selected:function(cityInfo){this.hide();jQuery("#"+this.inputDomId).attr("defaultValue",cityInfo.name);for(var i=0;i<this.dosearch.length;i++){this.dosearch[i].call(this,cityInfo)}}});jQuery.extend(package,{SelectCityWindow:SelectCityWindow,getCityPropertiesByCity:getCityPropertiesByCity,chinaCityObj:chinaCityObj,history:{add:function(city){cityhistory.add(city)}}})})(mapbar.window.city);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.map=="undefined"){window.mapbar.map={}}(function(package){var cityDataLoader={mapcenter_city_url:"http://202.152.183.82/json/getCityListByName.jsp?",loadData:function(parm){var url=this.mapcenter_city_url+"name="+encodeURI(parm.name)+"&type="+encodeURI(parm.type)+"&sonType="+encodeURI(parm.sonType);var script_id='mapbar_script_mapcenter_city_'+new Date().getTime();new mapbar.util.transfer.Request(url,{id:script_id,oncomplate:function(){jQuery("#"+script_id).remove();parm.success(cityListResult)}})},loadProvince:function(callback){this.loadData({name:"",type:"zone",sonType:"province",success:function(data){callback(data)}})},loadCity:function(name,callback){this.loadData({name:name,type:"province",sonType:"city",success:function(data){callback(data)}})},loadArea:function(name,callback){this.loadData({name:name,type:"city",sonType:"area",success:function(data){callback(data)}})}};var clickCloseGroup=new mapbar.window.ClickCloseGroup();var MapCenter=mapbar.object.createClass(null,{maplet:null,countryDom:null,provinceDom:null,cityDom:null,areaDom:null,streetDom:null,countryContentDom:null,provinceContentDom:null,cityContentDom:null,areaContentDom:null,streetContentDom:null,currCountry:null,currProvince:null,currCity:null,currArea:null,currStreet:null,inverseGeocoding:null,clickUpdateMap:true,init:function(arg0){jQuery.extend(this,{maplet:arg0.maplet,countryDom:jQuery(arg0.countryDom),provinceDom:jQuery(arg0.provinceDom),cityDom:jQuery(arg0.cityDom),areaDom:jQuery(arg0.areaDom),streetDom:jQuery(arg0.streetDom),countryContentDom:jQuery(arg0.countryContentDom||arg0.countryDom),provinceContentDom:jQuery(arg0.provinceContentDom||arg0.provinceDom),cityContentDom:jQuery(arg0.cityContentDom||arg0.cityDom),areaContentDom:jQuery(arg0.areaContentDom||arg0.areaDom),streetContentDom:jQuery(arg0.streetContentDom||arg0.streetDom),inverseGeocoding:arg0.inverseGeocoding,provinceSelected:arg0.provinceSelected||this.provinceSelected,citySelected:arg0.citySelected||this.citySelected,areaSelected:arg0.areaSelected||this.areaSelected,clickUpdateMap:typeof arg0.clickUpdateMap=="undefined"?this.clickUpdateMap:arg0.clickUpdateMap});this._regMapletEdit();if(this.inverseGeocoding){}if(this.clickUpdateMap){this._regClickUpdateMap()}},setMapCenterAndZoom:function(parm){if(this.maplet){if(parm.center){this.maplet.setCenter(parm.center)}if(parm.zoom){this.maplet.setZoomLevel(parm.zoom)}}},setCountry:function(country){this.currCountry=country},setProvince:function(province){this.currProvince=province},setCity:function(city){this.currCity=city},setArea:function(area){this.currArea=area},setStreet:function(street){this.currStreet=street},_regMapletEdit:function(){var _this=this;if(this.inverseGeocoding){this.inverseGeocoding.addCallback(function(result){_this.inverseGeocodingEnd(result)})}},_regClickUpdateMap:function(){var _this=this;this.provinceDom.click(function(){if(_this.currProvince){_this.setMapCenterAndZoom({center:_this.currProvince.centerlatlon,zoom:_this.currProvince.zoom})}});this.cityDom.click(function(){if(_this.currCity){_this.setMapCenterAndZoom({center:_this.currCity.centerlatlon,zoom:_this.currCity.zoom})}});this.areaDom.click(function(){if(_this.currArea){_this.setMapCenterAndZoom({center:_this.currArea.centerlatlon,zoom:_this.currArea.zoom})}})},inverseGeocodingEnd:function(result){if(result.province==""&&result.city==""){this.countryDom.hide()}else{this.countryDom.show()}if(!result.province||result.province.length==0||result.province=="特别行政区"||result.province=="中国"){this.provinceDom.hide();if(result.city&&result.city.length>0){this.setCity({name:result.city,centerlatlon:result.cityCenter,zoom:result.cityScale});this.provinceContentDom.html(result.city)}}else{this.setProvince({name:result.province,centerlatlon:result.provinceCenter,zoom:result.provinceScale});this.provinceDom.show();this.provinceContentDom.html(result.province)}if(!result.city||result.city.length==0){this.cityDom.hide();this.cityContentDom.html("");this.setCity(null)}else{this.setCity({name:result.city,centerlatlon:result.cityCenter,zoom:result.cityScale});this.cityDom.show();this.cityContentDom.html(result.city)}if(!result.dist||result.dist.length==0){this.areaDom.hide();this.areaContentDom.html("");this.setArea(null)}else{this.setArea({name:result.dist,centerlatlon:result.distCenter,zoom:result.distScale});this.areaDom.show();this.areaContentDom.html(result.dist)}if(!result.area||result.area.length==0){this.streetDom.hide();this.streetContentDom.html("");this.setStreet(null)}else{this.setStreet({name:result.area});this.streetDom.show();this.streetContentDom.html(result.area)}},loadProvince:function(callback){var _this=this;cityDataLoader.loadProvince(function(data){_this.showProvince(data);if(typeof callback=="function"){callback.apply(_this)}})},loadCity:function(name,callback){if(jQuery.isFunction(name)){callback=name;name=null}var _this=this;cityDataLoader.loadCity(name||this.currProvince.name,function(data){_this.showCity(data.zonelist[0].provincelist[0]);if(typeof callback=="function"){callback.apply(_this)}})},loadArea:function(name,callback){if(jQuery.isFunction(name)){callback=name;name=null}var _this=this;cityDataLoader.loadArea(name||this.currCity.name,function(data){_this.showArea(data.zonelist[0].provincelist[0].citylist[0]);if(typeof callback=="function"){callback.apply(_this)}})},showProvince:function(data){throw new Error("请实现showProvince方法！");},showCity:function(data){throw new Error("请实现showCity方法！");},showArea:function(data){throw new Error("请实现showArea方法！");},provinceSelected:function(province){},citySelected:function(city){},areaSelected:function(area){}});var WindowMapCenter=mapbar.object.createClass(MapCenter,{provinceWin:null,cityWin:null,areaWin:null,provinceClassName:null,cityClassName:null,areaClassName:null,init:function(arg0){WindowMapCenter._super.init.apply(this,arguments);jQuery.extend(this,{provinceWin:arg0.provinceWin||this._createWin(),cityWin:arg0.cityWin||this._createWin(),areaWin:arg0.areaWin||this._createWin(),provinceClassName:arg0.provinceClassName,cityClassName:arg0.cityClassName,areaClassName:arg0.areaClassName})},_createWin:function(){return new mapbar.window.Window()},showProvince:function(data){this.provinceWin.removeChild();if(this.provinceWin&&data&&data.zonelist){for(var i=0;i<data.zonelist.length;i++){var zone=data.zonelist[i];this.provinceWin.addChild(jQuery("<div/>").addClass(this.provinceClassName).html(zone.name));for(var j=0;zone.provincelist&&j<zone.provincelist.length;j++){var province=zone.provincelist[j];var provinceDom=this.getProvinceDom(province);if(provinceDom){this.provinceWin.addChild(provinceDom)}}}}},getProvinceDom:function(province){var _this=this;var provinceObj=null;var isCity=false;if(province.name=="直辖市"||province.name=="特别行政区"){provinceObj=province.citylist[0];isCity=true}else{provinceObj=province}if(provinceObj){var clickFunc=isCity?function(){_this.selectProvince(provinceObj);_this.provinceDom.hide();_this.provinceWin.hide();return false}:function(){_this.selectProvince(provinceObj);_this.provinceWin.hide();return false};return jQuery("<div/>").addClass(this.provinceClassName).append(jQuery("<a href='javascirpt:void(0);'>"+provinceObj.name+"</a>").click(clickFunc))}else{return null}},selectProvince:function(province){var _this=this;this.setMapCenterAndZoom({center:province.centerlatlon,zoom:province.zoom});this.setProvince(province);this.provinceContentDom.html(province.name);this.provinceDom.show();this.cityDom.hide();this.areaDom.hide();this.streetDom.hide();if(jQuery.isFunction(this.provinceSelected)){this.provinceSelected(province)}},provinceSelected:function(province){},showCity:function(data){this.cityWin.removeChild();if(this.cityWin&&data&&data.citylist){for(var i=0;i<data.citylist.length;i++){var city=data.citylist[i];this.cityWin.addChild(this.getCityDom(city))}}},getCityDom:function(city){var _this=this;var cityObj=null;cityObj=city;return jQuery("<div/>").addClass(this.cityClassName).append(jQuery("<a href='javascirpt:void(0);'>"+cityObj.name+"</a>").click(function(){_this.selectCity(cityObj);_this.cityWin.hide();return false}))},selectCity:function(city){var _this=this;this.setMapCenterAndZoom({center:city.centerlatlon,zoom:city.zoom});this.setCity(city);this.cityContentDom.html(city.name);this.cityDom.show();this.areaDom.hide();this.streetDom.hide();if(jQuery.isFunction(this.citySelected)){this.citySelected(city)}},citySelected:function(city){},showArea:function(data){this.areaWin.removeChild();if(this.areaWin&&data&&data.arealist){for(var i=0;i<data.arealist.length;i++){var area=data.arealist[i];this.areaWin.addChild(this.getAreaDom(area))}}},getAreaDom:function(area){var _this=this;var areaObj=area;return jQuery("<div/>").addClass(this.areaClassName).append(jQuery("<a href='javascirpt:void(0);'>"+areaObj.name+"</a>").click(function(){_this.selectArea(areaObj);_this.areaWin.hide();return false}))},selectArea:function(area){var _this=this;this.setMapCenterAndZoom({center:area.centerlatlon,zoom:area.zoom});this.setArea(area);this.areaContentDom.html(area.name);this.areaDom.show();this.streetDom.hide();if(jQuery.isFunction(this.areaSelected)){this.areaSelected(area)}},areaSelected:function(area){}});var DependWindowMapCenter=mapbar.object.createClass(WindowMapCenter,{singleOpenGroup:null,init:function(arg0){this.singleOpenGroup=this.singleOpenGroup||arg0.singleOpenGroup||new mapbar.window.SingleOpenGroup();DependWindowMapCenter._super.init.apply(this,arguments)},_createWin:function(){return new mapbar.window.DependWindow({group:[clickCloseGroup,this.singleOpenGroup],css:{border:"red solid 1px"}})}});var TipWindowMapCenter=mapbar.object.createClass(DependWindowMapCenter,{init:function(arg0){TipWindowMapCenter._super.init.apply(this,arguments)},_createWin:function(){return new mapbar.window.TipWindow({group:[clickCloseGroup,this.singleOpenGroup]})}});package.WindowMapCenter=WindowMapCenter;package.DependWindowMapCenter=DependWindowMapCenter;package.TipWindowMapCenter=TipWindowMapCenter})(mapbar.map);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.map=="undefined"){window.mapbar.map={}}if(typeof window.mapbar.map.panel=="undefined"){window.mapbar.map.panel={}}(function(package){package=package||window;var Panel=mapbar.object.createClass(null,{maplet:null,dom:null,width:200,height:null,top:null,left:null,right:null,bottom:null,className:null,init:function(args){var _this=this;if(typeof args!="undefined"){this.maplet=args.maplet;this.dom=jQuery(typeof args.dom=="undefined"?this.getNewDom():args.dom).css({position:"absolute"});this.width=args.width||this.width;this.height=args.height||this.height;this.top=args.top;this.left=args.left;this.right=args.right;this.bottom=args.bottom}else{throw new Error("缺少参数！");}if(args.className){this.dom.addClass(args.className)}if(args.css){this.css(args.css)}if(args.content){if(args.content instanceof Array){for(var i=0;i<args.content.length;i++){this.append(args.content[i])}}else{this.append(args.content)}}if(this.width){this.dom.width(this.width)}if(this.height){this.dom.height(this.height)}this._creatPanelOnMap();this.adjust()},adjust:function(){if(typeof this.top!="undefined"){this.dom.css({top:this.top})}if(typeof this.left!="undefined"){this.dom.css({left:this.left})}if(typeof this.right!="undefined"){this.dom.css({right:this.right})}if(typeof this.bottom!="undefined"){this.dom.css({bottom:this.bottom})}},show:function(){this.showDom(this.dom)},hide:function(){this.hideDom(this.dom)},showDom:function(dom){jQuery(dom).show()},hideDom:function(dom){jQuery(dom).hide()},toggleDom:function(dom){jQuery(dom).toggle()},getNewDom:function(){return jQuery("<div/>").css({zIndex:200})},css:function(css){this.dom.css(css)},append:function(dom){this.dom.append(dom)},empty:function(){this.dom.empty()},_creatPanelOnMap:function(){jQuery(this.maplet.map).append(this.dom)}});package.Panel=Panel})(mapbar.map.panel);if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.tab=="undefined"){window.mapbar.tab={}}(function(package){var Tab=mapbar.object.createClass(null,{name:null,showItem:null,items:null,init:function(arg0){arg0=arg0||{};var _this=this;jQuery.extend(this,{name:arg0.name,items:[]});jQuery.each(arg0.items||[],function(i,item){_this.addItem(item)});if(arg0.defaultShow){this.show(arg0.defaultShow)}},addItem:function(arg0){this.items.push(arg0)},show:function(itemName){var showItem=null;var showItemNum=-1;if(typeof itemName=="string"){jQuery.each(this.items,function(i,item){if(itemName==item.name){item.show();showItem=item;showItemNum=i}else{item.hide()}})}else if(typeof itemName=="number"){jQuery.each(this.items,function(i,item){if(itemName==i){item.show();showItem=item;showItemNum=i}else{item.hide()}})}if(showItem){this.showItem=showItem}this.trigger("onshow",[showItem,showItemNum])}});var TabItem=mapbar.object.createClass(null,{name:null,dom:null,init:function(arg0){jQuery.extend(this,{name:arg0.name,dom:jQuery(arg0.dom)});if(typeof arg0.event!="undefined"){for(var o in arg0.event){if(o&&/^on/g.test(o)&&typeof arg0.event[o]=="function"){this.bind(o,arg0.event[o])}}}},show:function(){this.dom.show();this.trigger("onshow")},hide:function(){this.dom.hide();this.trigger("onhide")}});jQuery.extend(package,{Tab:Tab,TabItem:TabItem})})(mapbar.tab);function EvalAny(num00,fromRadix,toRadix){var num01=parseInt(num00,fromRadix);return num01.toString(toRadix)};function n10To64(num){if(num<10){return String.fromCharCode(48+num)}else if(num>=10&&num<=35){return String.fromCharCode(55+num)}else if(num>=36&&num<=61){return String.fromCharCode(61+num)}else if(num==62){return"-"}else if(num==63){return"_"}return""};function n64To10(num){var j=num.charCodeAt();if(num=="_"){return 63}else if(num=="-"){return 62}else if(j>=97&&j<=122){return j-61}else if(j>=65&&j<=90){return j-55}else if(j>=48&&j<=57){return j-48}return""};function w16To64(num){var a2=EvalAny(num,16,2);while(a2.length<16){a2="0"+a2}var b1=parseInt(EvalAny(a2.substring(0,4),2,10));var b2=parseInt(EvalAny(a2.substring(4,10),2,10));var b3=parseInt(EvalAny(a2.substring(10,16),2,10));return n10To64(b1)+n10To64(b2)+n10To64(b3)};function w64To16(num){var a=0;for(var n=0;n<num.length;n++){var x=n64To10(num.charAt(n));for(var m=0;m<(num.length-n-1);m++){x=x*64}a+=x}var a1=EvalAny(a,10,16);while(a1.length<4){a1="0"+a1}return a1};function toUnicode(text){text=escape(text.toString()).replace(/\+/g,"%2B");var matches=text.match(/(%([0-9A-F]{2}))/gi);if(matches){for(var matchid=0;matchid<matches.length;matchid++){var code=matches[matchid].substring(1,3);text=text.replace(matches[matchid],'%u00'+code)}}return text};function toZipUnicode(text){text=toUnicode(text);var tmp="";for(var i=0;i<text.length;i++){if(text.charAt(i)=="%"&&text.charAt(i+1)=="u"){tmp+=w16To64(text.substring(i+2,i+6));i+=5}else{tmp+=("$"+text.charAt(i))}}return tmp};function unZipUnicode(text){var tmp="";for(var i=0;i<text.length;i++){if(text.charAt(i)=="$"){tmp+=text.substring(i+1,i+2);i++}else{tmp+="\\u"+w64To16(text.substring(i,i+3));i+=2}}var unTmp="";eval("unTmp=\""+tmp+"\"");return unTmp};if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.conf){window.mapbar.ls.conf={}}(function(package){package.imageslib="images/icon/";package.remoteUrl="http://202.152.183.82/json/";package.json_keyword=package.remoteUrl+"getPoiByKeyword.jsp";package.json_smallmap="json/smallMap.jsp";package.json_poi_detail="http://www.mapbar.com/localsearch/json/getPicByNid.jsp";package.json_cityInfo="http://202.152.183.82/json/getCityByIp.jsp";package.json_eg="http://211.157.24.143:8186/search/json/eg.jsp?";package.json_line=package.remoteUrl+"getRouteNamesByKeyword.jsp";package.json_url_suggest_keyword="http://suggest.mapbar.com/json/getAutoSuggestKeyword.jsp?";package.getMapsJson="http://www.mapbar.com/mapjson/getMapsJson.jsp?";package.autoSaveUrlProxy="json/proxy.jsp";package.poi_url_format_out="http://img.mapbar.com/web/icon/td{0}.gif";package.poi_url_format_over="http://img.mapbar.com/web/icon/td_{0}.gif";package.json_bus_line=package.remoteUrl+"getRouteNamesByKeyword.jsp";package.json_bus_lineInfo=package.remoteUrl+"getRouteByRouteName.jsp";package.json_bus_passLine=package.remoteUrl+"getRouteByStationName.jsp";package.json_bus_station=package.json_keyword;package.json_bus_select=package.remoteUrl+"getPoiNameList.jsp";package.json_bus_result=package.remoteUrl+"getBusByNid.jsp";package.json_bus_roadByKeyword=package.remoteUrl+"getRoadByKeyword.jsp"})(mapbar.ls.conf);maplitelib="http://img.mapbar.com/maplite/mapbank/ditu/image/icon/maplite/gif1/";mapliteSuffix="gif";wwwurl="http://www.mapbar.com";busurl="http://bus.mapbar.com";navurl="http://nav.mapbar.com";nburl="http://nb.mapbar.com";mymap="http://202.152.183.83:7084/imap/map.jsp";json_url_city_suggest="http://suggest.mapbar.com/json/citySuggest.jsp?";if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.util){window.mapbar.ls.util={}}function isIE(){if(window.navigator.userAgent.toLowerCase().indexOf("msie")>=1)return true;else return false};if(!isIE()){HTMLElement.prototype.__defineGetter__("innerText",function(){var anyString="";var childS=this.childNodes;for(var i=0;i<childS.length;i++){if(childS[i].nodeType==1)anyString+=childS[i].tagName=="BR"?'\n':childS[i].innerText;else if(childS[i].nodeType==3)anyString+=childS[i].nodeValue}return anyString});HTMLElement.prototype.__defineSetter__("innerText",function(sText){this.textContent=sText})}if(typeof(HTMLElement)!="undefined"){HTMLElement.prototype.contains=function(obj){while(obj!=null&&typeof(obj.tagName)!="undefind"){if(obj==this)return true;obj=obj.parentNode}return false}}function encodeDURI(uri,com){if(com){return encodeURIComponent(decodeURIComponent(uri))}return encodeURI(decodeURI(uri))};function decodeDURI(uri,com){if(com){return decodeURIComponent(decodeURIComponent(uri))}return decodeURI(decodeURI(uri))};function splitPara(para,key){if(typeof key!="undefined"){return"&"+para+"="+encodeDURI(key)}else{return""}};function cutStr(str,len){if(str.length>len)return str.substring(0,len)+"...";else return str};function getLcName(name,key){if(name.length>0){if(name.indexOf(key)!=-1){name=name.replace(key,"<b>"+key+"</b>")}}return name};function getRandom(){var date=new Date();var r=date.getYear()+"-"+date.getMonth()+"-"+date.getDate()+"-"+date.getHours();return r};function addfavorite(){var title=document.title;var url=document.location.href;if(window.sidebar)window.sidebar.addPanel(title,url,"");else if(window.opera&&window.print){var mbm=document.createElement('a');mbm.setAttribute('rel','sidebar');mbm.setAttribute('href',url);mbm.setAttribute('title',title);mbm.click()}else if(document.all)window.external.AddFavorite(url,title)};mapbar.ls.util.format=function(str,arr){if(typeof str!="string"||typeof arr=="array"){return str}for(var i=0;i<arr.length;i++){var re=new RegExp('\\{'+(i)+'\\}','gm');str=str.replace(re,arr[i])}return str};function feedback(){var url=window.location.href;var errorUrl="http://www.mapbar.com/feedback/feedback.jsp";window.open(errorUrl+"?reffer="+encodeURIComponent(url),"","")};if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.map){window.mapbar.ls.map={}}(function(package){jQuery.extend(package,{initMap:function(arg0){if(!window.maplet){mapbar.ls.docResize();window.maplet=new Maplet(arg0.mapDomId);maplet.addControl(new MStandardControl());var inverseGeocoding=mapbar.ls.geo.init({maplet:maplet});var mapCenter=mapbar.ls.mapcenter.init({maplet:maplet,inverseGeocoding:inverseGeocoding});maplet.addHotspot("mapPanel","HSHWUDXBAHARIG","哈尔滨市",1,5);maplet.addHotspot("mapPanel","HTJTRBXWTBGET","沈阳市",1,5);maplet.addHotspot("mapPanel","HTESJCVBACCRUU","长春市",1,5);maplet.addHotspot("mapPanel","GTCIEDWVIRJSI","呼和浩特市",1,5);maplet.addHotspot("mapPanel","HETCUFWVVHUEE","北京市",0,5);maplet.addHotspot("mapPanel","HHCIWHXVVJDBG","天津市",1,5);maplet.addHotspot("mapPanel","IJSRVJXVIWCHC","上海市",1,5);maplet.addHotspot("mapPanel","IJITUVWUABJGJ","广州市",1,5);maplet.addHotspot("mapPanel","HFISFCXTWJRFB","重庆市",1,5);maplet.addHotspot("mapPanel","HRRRBTWVRIHDU","济南市",1,5);maplet.addHotspot("mapPanel","HCAFICWVFITUB","太原市",1,5);maplet.addHotspot("mapPanel","GHIEETXUTURWF","银川市",1,5);maplet.addHotspot("mapPanel","HESUBVWVITTHS","石家庄市",1,5);maplet.addHotspot("mapPanel","GDIATWXUDCTBA","西宁市",1,5);maplet.addHotspot("mapPanel","GHFHGUWUFFUUV","兰州市",1,5);maplet.addHotspot("mapPanel","HBWSJFXURIERE","西安市",1,5);maplet.addHotspot("mapPanel","HIGSCCWVCHAHF","郑州市",1,5);maplet.addHotspot("mapPanel","IEGDCTWVGDBVS","南京市",1,5);maplet.addHotspot("mapPanel","ICGAACWVDIGSD","合肥市",1,5);maplet.addHotspot("mapPanel","HWTARHXUUAIWI","武汉市",1,5);maplet.addHotspot("mapPanel","IJDAJAWVFJGCB","杭州市",1,5);maplet.addHotspot("mapPanel","HABIJDVTUJEGA","成都市",1,5);maplet.addHotspot("mapPanel","IBGRTCVUHGRSF","长沙市",1,5);maplet.addHotspot("mapPanel","IFCEUTVUTJJDU","南昌市",1,5);maplet.addHotspot("mapPanel","IVGDHIXUUTREW","福州市",1,5);maplet.addHotspot("mapPanel","HRFBHUVTSGBFI","贵阳市",1,5);maplet.addHotspot("mapPanel","HGIVRBXTCWBDG","昆明市",1,5);maplet.addHotspot("mapPanel","FUUVCJWSIEVAR","拉萨市",1,5);maplet.addHotspot("mapPanel","ICIFVTWTIBCAU","南宁市",1,5);maplet.addHotspot("mapPanel","IJTRTWXTGUUSR","海口市",1,5);maplet.addHotspot("mapPanel","ITDUCVZUADIUW","香港",1,5);maplet.addHotspot("mapPanel","ISGWHFZTWBWWE","澳门",1,5);maplet.addHotspot("mapPanel","JDDVURZUWREDH","台湾",1,5);maplet.addHotspot("mapPanel","ECUVDCXTIIWGF","乌鲁木齐市",1,5);MEvent.addListener(maplet,'hotspot',function(obj){var r=mapbar.util.request.getObj("?"+obj);if(typeof r.hotspot!="undefined"){package.hotCityCallback(r.hotspot)}});MEvent.addListener(maplet,"snapshot_select",function(dataObj){maplet.setMode("pan")});MEvent.addListener(maplet,"snapshot",function(url){window.open(url)});try{new com.mapbar.handtagging.Panel({maplet:maplet,right:35})}catch(e){}mapbar.ls.fullScreen.init({maplet:maplet,hotkey:true})}if(arg0&&typeof arg0.center!="undefined"&&typeof arg0.zoom!="undefined"){maplet.centerAndZoom(new MPoint(arg0.center),arg0.zoom)}},showDefaultMap:function(){var showMap=function(center,zoom){center=center||mapbar.ls.city.currentCity.center||"北京市";center=center||mapbar.ls.city.currentCity.zoom||"8";package.initMap({mapDomId:"mapbar",center:center,zoom:zoom})};var request=mapbar.util.request.getObj();if(request.city){var cityObj=mapbar.ls.city.getCityPropertiesByCity(request.city);showMap(cityObj.strLatLon,cityObj.zoom)}else if(mapbar.util.cookie.getCookie("city")==""){var cityObj=mapbar.ls.city.getCityPropertiesByCity(mapbar.util.cookie.getCookie("city"));showMap(cityObj.strLatLon,cityObj.zoom)}else{mapbar.ls.city.getLocalCityProperties(function(cityObj){if(cityObj){showMap(cityObj.strLatLon,cityObj.zoom)}else{showMap()}})}},setCenterAndZoom:function(center,zoom){package.initMap({mapDomId:"mapbar",center:center,zoom:zoom})},mapletResize:function(x,y){x=x?parseInt(x):0;y=y?parseInt(y):0;var mapPNode=document.getElementById("mapbar").parentNode;var w=mapPNode.clientWidth-x;var h=mapPNode.clientHeight-y;if(typeof maplet=="object"){maplet.resize(w,h)}},getPoiType:function(poitype){return poitype.substr(0,poitype.indexOf('&'))},openInfoWindow:function(i){var poi=PoiArr[i];package.setCenterAndZoom(poi.strlatlon,13);package.openBubble(poi);mapbar.ls.detail.getPoiDetail(i)},openBubble:function(obj){setMarkerInfo(obj);obj.marker.openInfoWindow()},addPoi:function(obj,callback){window.addPoi(obj,callback)},addPois:function(poiList){if(poiList&&poiList.length>0){var poi_arr=[];for(var i=0;i<poiList.length;i++){var poiObj=poiList[i];var obj=new MapPoi();obj.icon=null;obj.Icon='<div '+Maplet.MICON_IMGSRC_FLAG+'="'+mapbar.ls.util.format(mapbar.ls.conf.poi_url_format_out,[i+1])+'" class="mapbar_poi_qpnum mapbar_poi_qpnumR'+(i+1)+'"></div>';obj.iconWidth=22;obj.iconHeight=34;obj.id=poiObj.pid;obj.city=poiObj.city;obj.strlatlon=poiObj.strlatlon;obj.name=poiObj.name;obj.title="<a style=color:black;text-decoration:none!important; href=http://www.mapbar.com/"+mapbar.ls.city.getEname(poiObj.city)+"/poi/"+poiObj.pid+" target=_blank >"+poiObj.name+"</a>";obj.address=poiObj.address;obj.poitype=poiObj.poitype.split(",").join("&nbsp;&raquo;&nbsp;");obj.phone=poiObj.phone;obj.allowEdit=false;obj.shadow=true;obj.shadowIcon="http://img.mapbar.com/web/icon/"+"bg_shadow.png";obj.template="/localsearch/js/template/infowindow0.html?"+Math.random();package.addPoisTimer(setTimeout((function(obj,i){return function(){package.addPoi(obj,function(obj){MEvent.addListener(obj.marker,'mouseover',function(){package.changeListImage(i+1,1);mapbar.ls.list.showSearch(i+1,0);mapbar.ls.list.scrollView(i+1)})})}})(obj,i),50*i))}}},hotCityCallback:function(cityName){var cityObj=mapbar.ls.city.getCityPropertiesByCity(cityName);package.setCenterAndZoom(cityObj.strLatLon,cityObj.zoom)},changeListImage:function(j,type){if(typeof maplet!="undefined"){if(PoiArr&&PoiArr.length>1){for(var i=0;i<PoiArr.length;i++){if(PoiArr[i]){var now=(i+1);if(document.getElementById("list"+now)&&now<=10){if(document.getElementById("list"+now).className!=""){mapbar.ls.list.libg(now,0)}PoiArr[i].marker.icon.web_replaceClass("mapbar_poi_qpnumB"+now,"mapbar_poi_qpnumR"+now);PoiArr[i].marker.icon.web_changeImgSrc(mapbar.ls.util.format(mapbar.ls.conf.poi_url_format_out,[now]))}if(now==j){mapbar.ls.list.libg(now,1);PoiArr[i].marker.icon.web_replaceClass("mapbar_poi_qpnumR"+now,"mapbar_poi_qpnumB"+now);PoiArr[i].marker.icon.web_changeImgSrc(mapbar.ls.util.format(mapbar.ls.conf.poi_url_format_over,[now]));if(typeof type=='undefined')PoiArr[i].marker.icon.hilite()}}}}}},clearPoi:function(){if(typeof maplet=='object')delPoiByType(0)},clearLine:function(){if(typeof maplet=='object')delLineByType(0)},addPoisTimerArr:[],addPoisTimer:function(timer){if(!package.addPoisTimerArr){package.addPoisTimerArr=[]}package.addPoisTimerArr.push(timer)},clearAddPoisTimer:function(){if(package.addPoisTimerArr){for(var i=0;i<package.addPoisTimerArr.length;i++){try{clearTimeout(package.addPoisTimerArr[i])}catch(e){}}package.addPoisTimerArr=[]}}})})(mapbar.ls.map);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.print){window.mapbar.ls.print={}}(function(package){jQuery.extend(package,{print:function(){if(typeof ZPrint!="undefined"){ZPrint.run()}else{jQuery.getScript('http://www.mapbar.com/localsearch/js/print.js',function(){ZPrint.run()})}}})})(mapbar.ls.print);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.fullScreen){window.mapbar.ls.fullScreen={}}(function(package){var isInit=false;var maxDom=jQuery("<div/>").attr("title","全屏显示").addClass("fullScreenOn").mouseover(function(){jQuery(this).removeClass().addClass("fullScreenHover")}).mouseout(function(){jQuery(this).removeClass().addClass("fullScreenOn")}).mousedown(function(){jQuery(this).removeClass().addClass("fullScreenDown")}).click(function(){package.max()});var minDom=jQuery("<div/>").attr("title","还原").addClass("halfScreenOn").mouseover(function(){jQuery(this).removeClass().addClass("halfScreenHover")}).mouseout(function(){jQuery(this).removeClass().addClass("halfScreenOn")}).mousedown(function(){jQuery(this).removeClass().addClass("halfScreenDown")}).click(function(){package.min()});var keypress=function(evt){if(evt.ctrlKey&&(evt.keyCode==13||evt.keyCode==10)){package.max();return false}else if(evt.keyCode==27){package.min();return false}};jQuery.extend(package,{init:function(arg0){if(!isInit){new mapbar.map.panel.Panel({maplet:arg0.maplet,top:5,right:5,height:22,width:24,content:[maxDom,minDom.hide()]});if(arg0.hotkey){jQuery(document).keypress(keypress);maxDom.attr("title",maxDom.attr("title")+"(Ctrl+Enter键)");minDom.attr("title",minDom.attr("title")+"(Esc键)")}isInit=true}},min:function(){mapbar.ls.layout.top.show(false);mapbar.ls.layout.right.show();maxDom.show();minDom.hide()},max:function(){mapbar.ls.layout.top.hide(false);mapbar.ls.layout.right.hide();maxDom.hide();minDom.show()}})})(mapbar.ls.fullScreen);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.geo){window.mapbar.ls.geo={}}(function(package){jQuery.extend(package,{inverseGeocoding:null,init:function(arg0){if(!package.inverseGeocoding){var inverseGeocoding=new mapbar.map.MapletInverseGeocoding({maplet:arg0.maplet});package.inverseGeocoding=inverseGeocoding}return package.inverseGeocoding}})})(mapbar.ls.geo);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}(function(package){var defaultHash=window.location.hash;var hashListenerFirst=true;jQuery.extend(package,{docResize:function(){var w=jQuery(window).width();var h=jQuery(window).height()-15-7;var nh=jQuery("#content").height(Math.max(0,h-jQuery("#header").height())).height();var lh=jQuery("#leftPanel").height();var ph=document.getElementById("pageP")?jQuery("#pageP").height():19;var oh=document.getElementById("options")?jQuery("#options").height():28;var th=document.getElementById("lsBusLineTip")?jQuery("#lsBusLineTip").height():34;var headerDom=jQuery("#header");var bottomDom=jQuery("#bottom");var leftPanelHeight=h-(headerDom.is(":hidden")?0-parseInt(headerDom.css("margin-bottom"))-5:headerDom.height())-jQuery("#options").height();jQuery("#leftPanel").height(leftPanelHeight);jQuery("#rsPanel").height(leftPanelHeight);jQuery("#mapPanel").height(leftPanelHeight);var rsPanelChildrenHeight=0;jQuery("#rsPanel").children(":not(script,#resultList,#mask_div)").each(function(i,obj){rsPanelChildrenHeight+=jQuery(obj).height()});jQuery("#resultList").height(jQuery("#rsPanel").height()-rsPanelChildrenHeight-15);var panel=document.getElementById("mapbar");panel.style.width=panel.parentNode.clientWidth+"px";panel.style.height=panel.parentNode.clientHeight+"px";if(lh!=nh){mapbar.ls.map.mapletResize()}},setNewHash:function(target){var curUrl=window.location.href;if(curUrl.indexOf("#")=="-1"){window.location.href=window.location.getContextPath()+"/localsearch/index.jsp"+target}else{package.setHash(target)}},setHash:function(target,isGetData,isChangeUrl){isGetData=(isGetData=="undefined"||isGetData==undefined)?true:isGetData;isChangeUrl=(isChangeUrl=="undefined"||isChangeUrl==undefined)?true:isChangeUrl;if(target.indexOf("#")=="-1"){target="#"+target}targetUrl=target;var Request=mapbar.util.request.getObj(target);if(Request.ac=="mm")mmUrl=target;if(isChangeUrl)window.location.hash=target;if(isGetData){package.getDataByHash(target)}},getDataByHash:function(newUrl){var Request=mapbar.util.request.getObj(newUrl);Request.width=Request.width||jQuery("#mapbar").width()||600;Request.height=Request.height||jQuery("#mapbar").height()||400;var ac=Request.ac||"";defaultHash=window.location.hash;var url="";jQuery("#resultList").html("<p style='text-align:center;height:25px;line-height:25px;'>数据加载中...</p>");jQuery("#rsPanel > p ").remove();if(ac=="bus"){url=mapbar.ls.conf.json_bus_select+"?orig=&origLatLon="+(Request.origLatLon||"")+"&origName="+encodeDURI(Request.origName||"",1)+"&dest=&destLatLon="+(Request.destLatLon||"")+"&destName="+encodeDURI(Request.destName||"",1)+"&origCity="+encodeDURI(Request.city,1)+"&type=bus";new mapbar.util.transfer.Request(url,{oncomplate:function(){mapbar.bus.select.search(Request)}})}else if(ac=="bsr"){url=mapbar.ls.conf.json_bus_result+"?orig=&origLatLon="+(Request.origLatLon||"")+"&origName="+encodeDURI(Request.origName||"",1)+"&dest=&destName="+encodeDURI(Request.destName||"",1)+"&destLatLon="+(Request.destLatLon||"")+"&width="+Request.width+"&height="+Request.height+"&city="+encodeDURI(Request.city,1)+"&sort="+(Request.sort||"")+"&encode=utf-8";new mapbar.util.transfer.Request(url,{oncomplate:function(){mapbar.bus.result.search(Request)}})}else if(ac=="line"){url=mapbar.ls.conf.json_bus_line+"?keyword="+encodeDURI(Request.keyword||"",1)+"&city="+encodeDURI(Request.city||"",1)+"&all=1&encode=utf-8";new mapbar.util.transfer.Request(url,{oncomplate:function(){mapbar.bus.line.search()}})}else if(ac=="station"){url=mapbar.ls.conf.json_bus_station+"?rn=&type="+encodeDURI("公交车站")+"&keyword="+encodeDURI(Request.keyword||"",1)+"&city="+encodeDURI(Request.city||"",1)+"&width="+Request.width+"&height="+Request.height+"&pn="+(Request.pn||"1");new mapbar.util.transfer.Request(url,{oncomplate:function(){mapbar.bus.station.search()}})}else{showDefault()}var city=decodeDURI(Request.city||"北京市",1);mapbar.ls.city.changeCity(city,false);busAlive.init(city)},showeg:true,getHashQuery:function(){var newUrl=window.location.hash;if(!package.listenerSwitch)return;if(defaultHash.indexOf('#')==-1){return}else if(hashListenerFirst||defaultHash!=newUrl){hashListenerFirst=false;defaultHash=window.location.hash;package.getDataByHash(newUrl)}defaultHash=window.location.hash},setDefaultHash:function(url){defaultHash=url},setHashListenerFirst:function(value){hashListenerFirst=value}});package.listenerSwitch=true})(mapbar.ls);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.layout){window.mapbar.ls.layout={}}(function(package){jQuery.extend(package,{right:{isShow:true,show:function(isDocResize){isDocResize=typeof isDocResize!="undefined"?isDocResize:true;document.getElementById('leftPanel').style.marginRight="341px";document.getElementById('rsPanel').style.display="block";document.getElementById('rsTitle').style.display="block";document.getElementById('rightTool').style.right="360px";document.getElementById('switchBT').style.right="336px";document.getElementById('switchBT').style.backgroundPosition="-25px -71px";package.isShow=true;if(isDocResize){mapbar.ls.docResize()}},hide:function(isDocResize){isDocResize=typeof isDocResize!="undefined"?isDocResize:true;document.getElementById('leftPanel').style.marginRight="0";document.getElementById('rsPanel').style.display="none";document.getElementById('rsTitle').style.display="none";document.getElementById('rightTool').style.right="20px";document.getElementById('switchBT').style.right="-4px";document.getElementById('switchBT').style.backgroundPosition="-1px -71px";package.isShow=false;if(isDocResize){mapbar.ls.docResize()}},toggle:function(isDocResize){if(document.getElementById('rsPanel').style.display=='none'){this.show(isDocResize)}else{this.hide(isDocResize)}}},top:{isShow:true,show:function(isDocResize){isDocResize=typeof isDocResize!="undefined"?isDocResize:true;jQuery("#header").show();jQuery("#banner").show();jQuery("#bottom").show();package.isShow=false},hide:function(isDocResize){isDocResize=typeof isDocResize!="undefined"?isDocResize:true;jQuery("#header").hide();jQuery("#banner").hide();jQuery("#bottom").hide();package.isShow=false},toggle:function(isDocResize){isDocResize=typeof isDocResize!="undefined"?isDocResize:true;if(jQuery("#header").is(":hidden")){this.show(isDocResize)}else{this.hide(isDocResize)}if(jQuery("#banner").is(":hidden")){this.show(isDocResize)}else{this.hide(isDocResize)}if(jQuery("#bottom").is(":hidden")){this.show(isDocResize)}else{this.hide(isDocResize)}if(isDocResize){mapbar.ls.docResize()}}}})})(mapbar.ls.layout);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.city){window.mapbar.ls.city={}}(function(package){jQuery.extend(package,{currentCity:{city:'北京市',ename:'beijing',center:"北京市",zoom:8},changeCity:function(cityName,isChangeMap){jQuery("#city001").attr("defaultValue",cityName).attr("value",cityName);var cityObj=mapbar.ls.city.getCityPropertiesByCity(cityName);mapbar.util.cookie.setCookie("city",cityObj.city,{expireDays:30,path:"/"});mapbar.util.cookie.setMCookie("city",cityObj.city,{expireDays:30,path:"/"});package.currentCity={city:cityObj.city,ename:cityObj.ename,center:cityObj.strLatLon,zoom:cityObj.zoom};jQuery("#hidcity").val(cityObj.city)},getCityPropertiesByCity:function(cityValue){var cityProperties={strLatLon:"GVCUSBXUIWTCR",zoom:"1",code:"086",city:"全国",ename:'china',isbus:'0'};for(var i=0;i<cityData.province.length;i++){for(var j=0;j<cityData.province[i].city.length;j++){if(cityData.province[i].city[j].cityName==cityValue){cityProperties.strLatLon=cityData.province[i].city[j].citylatlon;cityProperties.zoom=cityData.province[i].city[j].cityzoom;cityProperties.code=cityData.province[i].city[j].citycode;cityProperties.ename=cityData.province[i].city[j].esname;cityProperties.isbus=cityData.province[i].city[j].isbus;cityProperties.city=cityValue;return cityProperties}}}return cityProperties},getEname:function(cityName){var cityProperties=package.getCityPropertiesByCity(cityName);var ename=cityProperties.ename||"beijing";return ename},getLocalCity:function(callback){var url=typeof mapbar.ls.conf.json_cityInfo!="undefined"?mapbar.ls.conf.json_cityInfo:"http://202.152.183.82/json/getCityByIp.jsp";new mapbar.util.transfer.Request(url,{oncomplate:function(){callback(localInfo)},id:'localCity'})},getLocalCityProperties:function(callback){package.getLocalCity(function(localCityInfo){var cityObj=null;if(localCityInfo&&localCityInfo.city){cityObj=package.getCityPropertiesByCity(localCityInfo.city)}callback(cityObj)})},viewDefaultCity:function(){function setCity(cityName){cityName=decodeDURI(cityName||package.currentCity.city);package.changeCity(cityName,false)};var cityName=mode?jQuery("#hidcity").val():false||mapbar.util.request.getObj().city||mapbar.util.cookie.getCookie("city");if(cityName){setCity(cityName)}else{package.getLocalCity(function(localInfo){setCity(localInfo.city)})}}});package.example=jQuery.extend({},{get:function(cityName,callback){var cityProperties=package.getCityPropertiesByCity(cityName);var date=new Date();var r=date.getYear()+"-"+date.getMonth()+"-"+date.getDate();var url=typeof mapbar.ls.conf.json_eg!='undefined'?mapbar.ls.conf.json_eg:"http://211.157.24.143:8186/search/json/eg.jsp";url+="?citycode="+cityProperties.code+"&r="+r;new mapbar.util.transfer.Request(url,{oncomplate:function(){callback(cityName,Example)}})},keySub:function(keyword){mapbar.ls.setHash('#'+mapbar.util.request.toHashString({ac:"lc",keyword:encodeURIComponent(keyword),city:encodeURIComponent(mapbar.ls.city.currentCity.city)}))},defaultShow:function(cityName,Example){if(!Example){return}var eghtml="";for(var i=0;i<Example.keyword.length;i++){eghtml+="<a href='javascript:void(0);'onclick=\"mapbar.ls.city.example.keySub(this.innerHTML);return false;\">"+Example.keyword[i].position+"</a>&nbsp;&nbsp;"}var strHtml="<table border=0 style=\"margin-left:10px;margin-top:20px;\">";strHtml+="<tr><td style=\"padding-bottom:25px;\"><img src=\"images/search_home.gif\" style=\"margin-right:5px;\">当前搜索城市 <b>"+cityName+"</b></td></tr>";strHtml+="<tr><td style=\"padding-left:26px;padding-bottom:25px;\">请输入您想查询的关键字；";if(eghtml!="")strHtml+="<br>示例:"+eghtml;strHtml+="</td></tr>";strHtml+="<tr><td style=\"padding-left:26px;padding-bottom:25px;\">查询出行线路；<br>请您选择“公交查询”或“驾车导航”</td></tr>";strHtml+="<tr><td style=\"padding-left:26px;padding-bottom:25px;\">查询生活信息；<br>请您选择“周边查询”</td></tr>";strHtml+="</table>";jQuery("#rsPanel").html(strHtml)}})})(mapbar.ls.city);﻿if(typeof window.mapbar=="undefined"){window.mapbar={}}if(typeof window.mapbar.lb=="undefined"){window.mapbar.lb={}}if(typeof window.mapbar.lb.weather=="undefined"){window.mapbar.lb.weather={}}(function(package){package.conf={WEATHER_DEFAULT_URL:"http://202.152.183.82/json/getWeatherByCity.jsp?"};var Weather=mapbar.object.createClass(null,{init:function(arg0){this.dom=typeof arg0.dom=="undefined"?jQuery("#weatherPanel"):jQuery(arg0.dom);this.isweather=typeof arg0.isweather=="boolean"?arg0.isweather:true;this.url=typeof arg0.url=="undefined"?package.conf.WEATHER_DEFAULT_URL:arg0.url;this.callback=jQuery.isFunction(arg0.callback)?arg0.callback:function(){};this.city=typeof arg0.city=="undefined"?null:arg0.city;if(this.city){this.getCity(this.city)}},getCity:function(city){var _this=this;if(city){var cityObj=mapbar.ls.city.getCityPropertiesByCity(city);if(_this.isweather){_this.get(cityObj)}_this.callback(cityObj)}else{mapbar.ls.city.getLocalCityProperties(function(cityObj){if(_this.isweather){_this.get(cityObj)}_this.callback(cityObj)})}},get:function(cityObj){var _this=this;var date=new Date();var r=date.getYear()+"-"+date.getMonth()+"-"+date.getDate()+"-"+date.getHours();new mapbar.util.transfer.Request(this.url+"city="+encodeDURI(cityObj.city)+"&r="+r,{oncomplate:function(){_this.cbk(weather)},id:'weather'})},cbk:function(weather){if(this.dom&&(typeof weather)!="undefined"&&weather.imgsrc!=""){this.dom.html('<img src="http://img.mapbar.com/maplite/mapbank/ditu/image/wimage/'+weather.imgsrc+'" width="15" height="15">&nbsp;'+weather.city+'&nbsp;&nbsp;&nbsp;'+weather.baseInfo+'&nbsp;&nbsp;&nbsp;'+weather.temperature+'&nbsp;&nbsp;&nbsp;'+weather.wind+'&nbsp;&nbsp;&nbsp;'+weather.radiation)}else{this.dom.html("")}}});jQuery.extend(package,{Weather:Weather})})(mapbar.lb.weather);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.mapcenter){window.mapbar.ls.mapcenter={}}(function(package){jQuery.extend(package,{singleOpenGroup:new mapbar.window.SingleOpenGroup(),mapCenter:null,init:function(arg0){if(!package.mapCenter){var mapCenter=new mapbar.map.TipWindowMapCenter({maplet:arg0.maplet,inverseGeocoding:arg0.inverseGeocoding,singleOpenGroup:package.singleOpenGroup,countryDom:jQuery("#mapcenter_country_container"),provinceDom:jQuery("#mapcenter_province_container"),cityDom:jQuery("#mapcenter_city_container"),areaDom:jQuery("#mapcenter_area_container"),streetDom:jQuery("#mapcenter_street_container"),countryContentDom:jQuery("#mapcenter_country"),provinceContentDom:jQuery("#mapcenter_province"),cityContentDom:jQuery("#mapcenter_city"),areaContentDom:jQuery("#mapcenter_area"),streetContentDom:jQuery("#mapcenter_street"),provinceSelected:function(province){},citySelected:function(city){},areaSelected:function(area){},clickUpdateMap:true,provinceClassName:"mapcenterWinProvince",cityClassName:"mapcenterWinCity",areaClassName:"mapcenterWinCity"});mapCenter.inverseGeocoding.run();package.mapCenter=mapCenter;package.initButton(mapCenter);package.initViewButton({window:mapCenter.provinceWin,container:"#mapcenter_country_container",winButton:"#mapcenter_country_select"});package.initViewButton({window:mapCenter.cityWin,container:"#mapcenter_province_container",winButton:"#mapcenter_province_select"});package.initViewButton({window:mapCenter.areaWin,container:"#mapcenter_city_container",winButton:"#mapcenter_city_select"})}return package.mapCenter},initButton:function(mapCenter){jQuery("#mapcenter_country_select").click(function(){if(mapCenter.provinceWin.dom.is(":hidden")){mapCenter.loadProvince(function(){this.provinceWin.css({width:180});this.provinceWin.contentDom.css({height:200,overflow:"auto"});this.provinceWin.closeDom.css({right:20});this.provinceWin.offset.top=10;this.provinceWin.setDependDom(jQuery("#mapcenter_country"));this.provinceWin.show()})}else{mapCenter.provinceWin.hide()}return false});jQuery("#mapcenter_province_select").click(function(){if(mapCenter.cityWin.dom.is(":hidden")){mapCenter.loadCity(function(){this.cityWin.css({width:150});this.cityWin.contentDom.css({height:200,overflow:"auto"});this.cityWin.closeDom.css({right:20});this.cityWin.offset.top=10;this.cityWin.setDependDom(jQuery("#mapcenter_province"));this.cityWin.show()})}else{mapCenter.cityWin.hide()}return false});jQuery("#mapcenter_city_select").click(function(){if(mapCenter.areaWin.dom.is(":hidden")){mapCenter.loadArea(function(){this.areaWin.css({width:150});this.areaWin.contentDom.css({height:200,overflow:"auto"});this.areaWin.closeDom.css({right:20});this.areaWin.offset.top=10;this.areaWin.setDependDom(jQuery("#mapcenter_city"));this.areaWin.show()})}else{mapCenter.areaWin.hide()}return false})},initViewButton:function(arg0){var isWinOpened=false;var container=jQuery(arg0.container).get(0);var winButton=jQuery(arg0.winButton).get(0);container.onmouseover=function(){mapbar.event.cancelEvent();if(!isWinOpened){this.className='hover';winButton.className='on_white'}return false};container.onmouseout=function(){if(!isWinOpened){this.className='';winButton.className='off_gray'}};winButton.onmouseover=function(){mapbar.event.cancelEvent();if(!isWinOpened){container.className='hover';this.className='on_blue'}return false};winButton.onmouseout=function(evt){if(!isWinOpened){this.className='off_gray'}};winButton.onclick=function(){isWinOpened=true;mapbar.event.cancelEvent();return false};mapbar.aop.addAfter(arg0.window,"show",function(){isWinOpened=true;container.className='hover';winButton.className='on_blue'});mapbar.aop.addAfter(arg0.window,"hide",function(){isWinOpened=false;container.className='';winButton.className='off_gray'})}})})(mapbar.ls.mapcenter);if(!window.mapbar){window.mapbar={}}if(!window.mapbar.ls){window.mapbar.ls={}}if(!window.mapbar.ls.head){window.mapbar.ls.head={}}(function(package){jQuery.extend(package,{tab:null,initTab:function(){if(!package.tab){var tabItem_ls=new mapbar.tab.TabItem({name:"lsForm",dom:"#lsForm"});var tabItem_bus=new mapbar.tab.TabItem({name:"bsForm",dom:"#bsForm",event:{onshow:function(){jQuery("#label1,#label2,#label3").removeClass("onDownAb");jQuery("#label1").addClass("onDownAb");jQuery("#mapbar_head_tab_bus").removeClass("a1").addClass("a1")}}});tabItem_bus.one("onshow",function(){new mapbarInputSuggest({inputid:"bsSuggest1",posturl:mapbar.ls.conf.json_url_suggest_keyword});new mapbarInputSuggest({inputid:"bsSuggest2",posturl:mapbar.ls.conf.json_url_suggest_keyword})});var tabItem_nav=new mapbar.tab.TabItem({name:"nsForm",dom:"#nsForm"});tabItem_nav.one("onshow",function(){jQuery("#city002").val(mapbar.ls.city.currentCity.city);var selectCityWindow=null;jQuery("#city002,#city002_arrow").click(function(){if(!selectCityWindow){selectCityWindow=new mapbar.window.city.SelectCityWindow({group:[new mapbar.window.AutoAdjustGroup(),new mapbar.window.ClickCloseGroup(),mapbar.ls.mapcenter.singleOpenGroup],dependDom:jQuery("#city002"),inputDomId:"city002",align:"right",offset:{top:7},css:{width:230},dosearch:[function(cityInfo){jQuery("#city002").val(cityInfo.name)}]});selectCityWindow.dependDom.blur(function(){if(jQuery.trim(jQuery(this).val())==""||mapbar.ls.city.getCityPropertiesByCity(jQuery(this).val()).code=="086"){jQuery(this).val(mapbar.ls.city.currentCity.city||"北京市")}})}selectCityWindow.show();return false})});tabItem_nav.one("onshow",function(){new mapbarInputSuggest({inputid:"nsSuggest1",posturl:mapbar.ls.conf.json_url_suggest_keyword});new mapbarInputSuggest({inputid:"nsSuggest2",posturl:mapbar.ls.conf.json_url_suggest_keyword})});var tabItem_nb=new mapbar.tab.TabItem({name:"nbForm",dom:"#nbForm"});tabItem_nb.one("onshow",function(){new mapbarInputSuggest({inputid:"nbSuggest1",posturl:mapbar.ls.conf.json_url_suggest_keyword});new mapbarInputSuggest({inputid:"nbSuggest2",posturl:mapbar.ls.conf.json_url_suggest_keyword})});var tabItem_lines=new mapbar.tab.TabItem({name:"linesForm",dom:"#linesForm"});tabItem_lines.one("onshow",function(){new mapbarInputSuggest({inputid:"lineSuggest",posturl:mapbar.ls.conf.json_url_suggest_keyword})});var tabItem_ss=new mapbar.tab.TabItem({name:"ssForm",dom:"#ssForm"});tabItem_ss.one("onshow",function(){new mapbarInputSuggest({inputid:"stationSuggest",posturl:mapbar.ls.conf.json_url_suggest_keyword})});var tab=new mapbar.tab.Tab({name:"mapbar_ls_head_tab",defaultShow:1,items:[tabItem_ls,tabItem_bus,tabItem_nav,tabItem_nb,tabItem_lines,tabItem_ss]});tab.bind("onshow",function(evt,item,i){jQuery("[name=mapbar_city_select_container]",item.dom).append(jQuery("#city001,#city001_arrow"));if(item.name=="bsForm"||item.name=="linesForm"||item.name=="ssForm"){jQuery("#bsrb").show()}else{jQuery("#bsrb").hide()}});package.tab=tab}},tabShow:function(tabNum,obj){package.initTab();package.tab.show(tabNum);if(tabNum==4||tabNum==5){jQuery("#label1,#label2,#label3").removeClass("onDownAb");jQuery(obj).addClass("onDownAb")}else{jQuery("#mapbar_head_tab_ls,#mapbar_head_tab_bus,#mapbar_head_tab_nav,#mapbar_head_tab_nb").removeClass("a1");jQuery(obj).addClass("a1")}},toggleValue:function(input1,input2){var jq_input1=jQuery(input1);var jq_input2=jQuery(input2);var val1=jq_input1.val();var val2=jq_input2.val();jq_input1.val(val2);jq_input2.val(val1)},changeKeyword:function(val){if(typeof val=="string"){jQuery("#lsSuggest").val(val)}}})})(mapbar.ls.head);function searchNav(obj,type,no){var searchObj=obj.previousSibling;var keyword=searchObj.value;if(keyword==""){alert("请输入内容");searchObj.focus();return false}var from="";var to="";if(type==0){from=document.getElementById("title_"+no).innerText;to=keyword}else{from=keyword;to=document.getElementById("title_"+no).innerText}var url="http://nav.mapbar.com/mapview/index1.jsp#ac=nav&origName="+encodeURI(from)+"&destName="+encodeURI(to)+"&origCity="+encodeURI(mapbar.ls.city.currentCity.city)+"&destCity="+encodeURI(mapbar.ls.city.currentCity.city);window.open(url,'NAV','')};function searchBus(obj,type,no){var searchObj=obj.previousSibling.previousSibling;var keyword=searchObj.value;if(keyword==""){alert("请输入内容");searchObj.focus();return false}var from="";var to="";if(type==0){from=document.getElementById("title_"+no).innerText;to=keyword}else{from=keyword;to=document.getElementById("title_"+no).innerText}var url="http://bus.mapbar.com/mapview/index.jsp#ac=bus&origLatLon=&origName="+encodeURI(from)+"&destName="+encodeURI(to)+"&city="+encodeURI(mapbar.ls.city.currentCity.city);window.open(url,'BUS','')};function searchNearBy(obj,no){var searchObj=obj.previousSibling;var keyword=searchObj.value;if(keyword==""){alert("请输入内容");searchObj.focus();return false}var nearby=document.getElementById("title_"+no).innerText;var url="http://nb.mapbar.com"+"/mapview/index.jsp#ac=nb&poitype="+encodeURI(keyword)+"&city="+encodeURI(mapbar.ls.city.currentCity.city)+"&pid="+encodeURI(nearby);window.open(url,'NEARBY','')};var validate={checkEmpty:function(argumentc,str){for(var i=0;i<argumentc.length;i++){if(argumentc[i].value.replace(new RegExp(" ","gm"),"")==""){alert(str||"请输入查询内容！");argumentc[i].focus();return false}}return true},checkValue:function(argumentc,str){for(var i=0;i<argumentc.length;i++){if(argumentc[i].replace(new RegExp(" ","gm"),"")==""){alert(str||"请输入查询内容！");return false}}return true}};function openHashSearch(url,type){if(typeof type=='undefined')type='bus';var newurl="";if(type=='www')newurl=wwwurl+"/localsearch/index.jsp";if(type=='nb')newurl=nburl+"/mapview/index.jsp";if(type=='bus')newurl=busurl+"/mapview/index.jsp";if(type=='nav')newurl=navurl+"/mapview/index1.jsp";newurl+=url;window.open(newurl,"","")};function lsSub(obj){if(validate.checkEmpty([obj.keyword])){var city=mapbar.ls.city.currentCity.city;var ename=mapbar.ls.city.currentCity.ename;window.open(wwwurl+"/"+ename+"/search/"+toZipUnicode(obj.keyword.value)+"/1/","","")}};function nbSub(obj){if(validate.checkEmpty([obj.pid,obj.poitype]))openHashSearch("#ac=nb&pid="+encodeDURI(obj.pid.value,1)+"&poitype="+encodeDURI(obj.poitype.value,1)+"&city="+encodeDURI(obj.city.value),'nb')};function bsSub(obj){var Request=mapbar.util.request.getObj(window.location.hash);if(Request.ac=="bus"){jQuery("#bsSuggest4").val(obj.dest.value);jQuery("#bsSuggest3").val(obj.orig.value);jQuery("#selectSearch").click()}else{if(validate.checkEmpty([obj.orig,obj.dest]))mapbar.ls.setHash("#ac=bus&origName="+encodeDURI(obj.orig.value,1)+"&destName="+encodeDURI(obj.dest.value,1)+"&city="+encodeDURI(obj.city.value))}};function ssSub(obj){if(validate.checkEmpty([obj.keyword]))mapbar.ls.setHash("#ac=station&keyword="+encodeDURI(obj.keyword.value,1)+"&city="+encodeDURI(obj.city.value))};function lineSub(obj){if(validate.checkEmpty([obj.keyword]))mapbar.ls.setHash("#ac=line&keyword="+encodeDURI(obj.keyword.value,1)+"&city="+encodeDURI(obj.city.value))};function nsSub(obj){if(validate.checkEmpty([obj.orig,obj.dest])){openHashSearch("#ac=nav&origName="+encodeDURI(obj.orig.value,1)+"&destName="+encodeDURI(obj.dest.value,1)+"&origCity="+encodeDURI(obj.city.value)+"&destCity="+encodeDURI(obj.destCity.value),'nav')}};
