/* 百度地图API V2 模块 * 此模块必须配套使用baidumap_offline_v2_20160822.js对 * 获取模块的方法: * http://api0.map.bdimg.com/getmodules?v=2.0&mod=模块1,模块2 * 模块名称就是文件名 * www.xiaoguo123.com 整理 */ _jsload2&&_jsload2('autocomplete', 'x.lang.Ba.prototype.gi=ga(0,function(){delete window[x.ba]._instances[this.ba];for(var a in this)x.lang.it(this[a])||delete this[a]});x.D.getComputedStyle=function(a,b){var a=x.D.Qj(a),c=x.D.GD(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,p))?c[b]||c.getPropertyValue(b):""};x.D.remove=function(a){var a=x.D.Qj(a),b=a.parentNode;b&&b.removeChild(a)};x.lang.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}; x.event=x.event||{};x.event.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=o};x.event.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=q};x.event.stop=function(a){var b=x.event;b.stopPropagation(a);b.preventDefault(a)};x.jc.indexOf=function(a,b,c){var d=a.length,c=c|0;for(0>c&&(c=Math.max(0,d+c));c",o4:"
#{2}
", I_:\'
\\u5173\\u95ed
\',H_:\'#{0}
\',K_:\'#{1}\',CX:function(){return x.Ro(this.J_, this.Yb(),this.Ms(),this.ba)},ua:function(a,b){var c,a=x.$(a);this.WB=b;!this.li()&&a&&(this.w_=a.id?a.id:a.id=this.Yb("input"),c=this.rZ(),c.style.display="none",c.innerHTML=this.CX(),this.dispatchEvent("onload"))},GA:function(){var a=this.li();return a&&"none"!=a.style.display},zj:function(a){var b=this.im,a={data:{item:(b&&"number"==typeof a&&"undefined"!=typeof b[a]?b[a].value:a)==a?{value:a,content:a}:b[a],index:a}};this.dispatchEvent("onbeforepick",a)&&this.dispatchEvent("onpick",a)},show:function(a, b,c){var a=0,d=b.length;this.rk=[];this.Yc=-1;if(0==d&&!c)this.U();else{for(this.im=[];ad.width&&(d.width=0)),b.height))d.height=parseFloat(b.height)-c(a,"paddingTop")-c(a,"paddingBottom")-c(a,"borderTopWidth")-c(a,"borderBottomWidth"),0>d.height&&(d.height=0);return x.D.yi(a,d)}; (function(){var a=x.Qb.Xl.rK=s();a.Vy=q;a.$p;a.hG;a.iG;a.eP=function(){if(this.$p)this.fP(),x.Kd(this.$p,"display","block");else{var a=this.JV||{},c=this.hG=a.Ua||this.li(),d=a.opacity||"0",a=a.color||"",e=this.$p=document.createElement("iframe"),f=this.iG=document.createElement("div");0l+k?-n-(d.width||0):0;g.top+=g.topm+i?-u-(d.height||0):0;break;case "fix":g.left=Math.max(0-parseFloat(x.D.tj(b,"marginLeft"))||0,Math.min(g.left,x.page.ZD()-n-v.left));g.top=Math.max(0-parseFloat(x.D.tj(b,"marginTop"))||0,Math.min(g.top,x.page.YD()- u-v.top));break;case "verge":var w=-1k-v.left?C-n:w;g.top+=g.top+y+u-m>i-v.top?A-u:y}x.D.sa(b,g);!f&&(i!=x.page.YD()||k!=x.page.ZD())&&this._positionByCoordinate(b,d,{},o);f||this.dispatchEvent("onpositionupdate")}; b.IP=function(a,b,e){("undefined"==typeof b||!b)&&x.event.M(x.D.OX(a),"resize",x.mm.bind.apply(this,["_positionByCoordinate",this].concat([].slice.call(e))));this._positionByCoordinate.apply(this,e)}})(); x.Qb.Hi.extend({iZ:o,EW:o,PX:function(){var a=this;return function(){a.rw(o)}},rw:function(a){var b=this.vm(),c=this.WB,d=this.li();if(this.GA()||!a)c&&(b=c),a=x.D.ha(b),b={top:a.top+b.offsetHeight-1,left:a.left,width:b.offsetWidth},b="function"==typeof this.view?this.view(b):b,this.sa([b.left,b.top],p,{VY:o}),x.D.YZ(d,b.width)}}); x.Qb.Hi.Se(function(a){a.e0=a.PX();a.addEventListener("onload",function(){a.rw();a.EW&&(a.FW=setInterval(function(){var b=a.li(),c=a.vm();0!=b.offsetWidth&&(c&&c.offsetWidth!=b.offsetWidth)&&(a.rw(),b.style.display="block")},100));a.M(window,"resize",a.e0)});a.addEventListener("onshow",function(){a.rw()});a.addEventListener("ondispose",function(){clearInterval(a.FW)})}); x.Qb.Hi.Se(function(a){function b(){setTimeout(function(){var b=a.vm();e=b===p?"":b.value},20)}var c,d="",e,f,g=q,i=q;a.addEventListener("onload",function(){c=this.vm();b();a.M(window,"onload",b);a.x_=a.GX();a.M(c,"keydown",a.x_);c.setAttribute("autocomplete","off");a.wV=setInterval(function(){if(!i){x.$(c)==p&&a.gi();var b=c.value;b==d&&""!=b&&b!=e&&b!=f?0==a.hF&&(a.hF=setTimeout(function(){a.dispatchEvent("onneeddata",b)},100)):(clearTimeout(a.hF),a.hF=0,""==b&&""!=d&&(f="",a.U()),d=b,b!=f&&(a.Sw= b),e!=c.value&&(e=""))}},10);a.M(c,"beforedeactivate",a.bV)});a.addEventListener("onitemclick",function(){i=q;a.Sw=d=a.VD()});a.addEventListener("onpick",function(a){g&&c.blur();c.value=f=a.data.item.value;g&&c.focus()});a.addEventListener("onmousedownitem",function(){i=g=o;setTimeout(function(){g=i=q},500)});a.addEventListener("ondispose",function(){clearInterval(a.wV)})}); x.Qb.Hi.extend({bV:function(){return function(){mousedownView&&(window.event.cancelBubble=o,window.event.returnValue=q)}},GX:function(){var a=this;return function(b){var c=q,b=b||window.event;switch(b.keyCode){case 9:case 27:a.U();break;case 13:x.event.stop(b);a.confirm(-1==a.Yc?a.vm().value:a.rk[a.Yc],"keyboard");break;case 38:c=o;case 40:x.event.stop(b);b=c;if(a.GA()){var c=a.rk,d=a.Yc;if(0!=c.length){if(b)switch(d){case -1:d=c.length-1;a.zj(c[d]);a.at(c[d]);break;case 0:d=-1;a.zj(a.Sw);a.iC(); break;default:d--,a.zj(c[d]),a.at(c[d])}else switch(d){case -1:d=0;a.zj(c[d]);a.at(c[d]);break;case c.length-1:d=-1;a.zj(a.Sw);a.iC();break;default:d++,a.zj(c[d]),a.at(c[d])}a.Yc=d}}else a.dispatchEvent("onneeddata",a.VD());break;default:a.Yc=-1}}},Sw:""});ha.s4=o;var Ph=q,Qh=z.Hc+"res/20/bmap_autocomplete.css",Rh={ALL:"0",CITY:"1"}; x.extend(Hd.prototype,{Od:function(){this.Ri()},Ri:function(){this.gl=-1;this.Ea=p;this.Wv=[];this.VG=0;this.ja=this.bv();this.oc.input&&(this.nS(),this.LT(),this.wy(this.VH));var a=p;this.cj&&(a={method:"search"},a.arguments=[this.cj]);this.MH();this.uH(a)},LT:function(){var a=this,b=new x.Qb.Hi({getData:function(b){a.SI(b)},onhide:function(){a.gl=-1;""===a.mg.VD()&&(a.cj="",a.ja=a.bv())},onhighlight:function(b){if(a.Ea){var d={},e={},e={index:b.data.index,value:a.Ea.Im[b.data.index].value},d={index:a.gl, value:0<=a.gl?a.Ea.Im[a.gl].value:{}},f=new N("onhighlight");f.fromitem=f.V1=d;f.toitem=f.l4=e;a.dispatchEvent(f);a.gl=b.data.index}},onbeforepick:function(b){if(a.Ea&&"number"===typeof b.data.index){var d=a.Ea.Im[b.data.index].value;b.data.item.content=b.data.item.value=d.province+d.city+d.district+d.street+d.business}},onconfirm:function(b){if(a.Ea){Pa(5012);var d={};"number"===typeof b.data.index&&(d={index:b.data.index,value:a.Ea.Im[b.data.index].value},b=new N("onconfirm"),b.item=b.item=d,a.dispatchEvent(b))}}}); b.ua(x.$(this.oc.input),x.$(this.oc.WB));this.mg=b},show:function(){this.mg&&(this.mg.li().style.display="block")},U:function(){this.mg&&this.mg.U();this.gl=-1},gi:function(){this.mg&&this.mg.gi();x.lang.Ba.prototype.gi.call(this)},xF:function(a){this.oc.types=a||[];this.MH()},gn:function(a){this.zd.src=a;this.uH()},search:function(a){this.SI(a)},wy:function(a){this.mg&&this.mg.zj(a)},SI:function(a){var b=this,c=(1E5*Math.random()).toFixed(0);z._rd["_cbk"+c]=function(a){x.$(b.oc.input)!==p&&b.LR(a); delete z._rd["_cbk"+c]};var d=z.url.proto+z.url.domain.baidumap+"/su?wd="+encodeURIComponent(a)+"&callback=BMap._rd._cbk"+c+"&cid="+b.VG+"&type="+b.Wv+"&t="+(new Date).getTime();b.cj=a;b.gl=-1;b.ja=this.bv();Pa(5010,{tp:b.Wv,wd:encodeURIComponent(a)});Qb(d)},LR:function(a){a&&a.q&&(this.cj=a.q);this.mU(this.zR(a));this.ja=this.bv(this.Ea);this.oc.ay(this.ja)},zR:function(a){var b=[],c=a.s,d={};d.sb=a.q||"";d.count=a.s.length||0;d.status=0>a.e?7:0;d.Im=[];var e=0,f=c.length;for(G()&&6a.data.length&&b.U()}},WR:function(a,b){switch(b.toString()){case "1":return this.XR(a);default:return this.YR(a)}},YR:function(a){for(var a=a.split("$"),b=this.cj,c=RegExp(b,"g"),d=""+b+"",e={province:"",city:a[0],district:a[1],street:a[2],streetNumber:"",business:a[3]},f="",g=3;0<=g;g--)if(f=a[g]+f,-1\'+i+"");break}if(!i)for(g=3;0<=g;g--)i+=a[g];return{value:{value:e},QL:f}},XR:function(a){var b=a.split("$"),c=this.cj,a={province:b[0],city:b[1],district:"",street:"",streetNumber:"",business:""},b=(b[0]+b[1]).replace(RegExp(c,"g"),""+c+"");return{value:{value:a},QL:b}},MH:function(){var a=this.oc.types,b=[];if(x.ug(a))b.push(Rh[a.toUpperCase()]);else if(x.lang.isArray(a))for(var c=0,d=a.length;c