var citycome={};var __userAgent=navigator.userAgent.toLowerCase();citycome.browser={userAgent:__userAgent,version:(__userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(__userAgent),opera:/opera/.test(__userAgent),msie:/msie/.test(__userAgent)&&!/opera/.test(__userAgent),mozilla:/mozilla/.test(__userAgent)&&!/(compatible|webkit)/.test(__userAgent)};citycome.browser.isIE6=citycome.browser.msie&&citycome.browser.version=="6.0";citycome.SkinPath="citycomeSkin/default/";citycome.Skin=function(a){return citycome.SkinPath+a};citycome.mapconfig=function(){this.zoom={min:0,max:7,data:7};this.birdview={width:220,height:120,scale:128};this.allowDrag=true;this.allowMouseWheelZoom=true;this.startup={x:224711,y:125924,z:6,t:2}};citycome.defconfig=new citycome.mapconfig();citycome.random=function(b,a){return Math.floor(Math.random()*(a-b+1)+b)};citycome.cursor={closeHand:"move",org:"default"};var ElementPool={};var varconst={div:"div",table:"table",tr:"tr",td:"td",__autoid:1,autoid:function(){return varconst.__autoid++},getDOM:function(a){return document.createElement(a)},getDiv:function(){return document.createElement(varconst.div)}};function Log2(a){return Math.log(a)/Math.log(2)}function IsInArea(a,h,e){if(!e){return false}var g={x:parseInt(a),y:parseInt(h)};if(e.length<=2){return false}var b=0;var c=0;for(var d=0;d<e.length;d++){if(d==e.length-1){c=0}else{c=d+1}if((((g.y>=e[d].y)&&(g.y<e[c].y))||((g.y>=e[c].y)&&(g.y<e[d].y)))&&(g.x<(e[c].x-e[d].x)*(g.y-e[d].y)/(e[c].y-e[d].y)+e[d].x)){b=b+1}}return b%2==1}function PtInRect(a,c,b){if(a>=b.l&&a<=b.r&&c>=b.t&&c<=b.b){return true}return false}function MapBiardView(t,e,f,v,p,j,l){var d=p;var h=t;var g=e;var n=this;var i=l;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute; left:0px; top:0px; z-index:200; background-color:#fff; border:solid 1px #194792;";this.handler.style.width=f+"px";this.handler.style.height=v+"px";this.handler.className="map_bv";var r=f;var o=v;this.handler.innerHTML='<div class="map_bv_tool"><a id="dbvTogBV"  href="javascript:void(0)" class="togBV" hidefocus="true"  title="显示或隐藏鹰眼"></a><a  id="dbvTogRoadName"   href="javascript:void(0)" class="button_active" hidefocus="true" title="显示或隐藏路名">路名</a><a id="dbvTogLabel"  href="javascript:void(0)" class="button" hidefocus="true" title="显示或隐藏地图标注">标注</a></div><div ></div>';this.isShowBVMap=true;var m=$(this.handler);var k=varconst.getDiv();k.style.cssText="position:absolute; left:0px; top:17px; z-index:210; background-color:#4080FF; border:none; cursor:pointer;";k.style.width=f-2+"px";k.style.height=v-17+"px";this.handler.appendChild(k);this.handler.style.top=h.coord.height-this.handler.offsetHeight+"px";var b=null;var c=null;m.addEvent("click",function(w){if(w.target.className=="togBV"){}return false});var s=new MapLayer(n,true,j,1,4,false,"jpg",true,false);k.appendChild(s.handler);s.handler.style.cursor="pointer";var u={width:k.offsetWidth,height:k.offsetHeight};var a={x:0,y:0};m.addEvent("mousedown",function(w){if(w.target.className=="togBV"){n.doTogBirdView()}if(w.target.id=="dbvTogRoadName"){n.togRoadName()}if(w.target.id=="dbvTogLabel"){n.togLabel()}w.stopPropagation()});m.addEvent("selectstart",function(w){w.stopPropagation()});m.addEvent("mousewheel",function(w){w.stopPropagation()});m.addEvent("contextmenu",function(w){w.stop()});$(k).addEvent("click",function(F){q();var F=event.event||window.event;var C=document.documentElement,y=document.body;var E=F.clientX+(C&&C.scrollLeft||y&&y.scrollLeft||0)-(C.clientLeft||0);var D=F.clientY+(C&&C.scrollTop||y&&y.scrollTop||0)-(C.clientTop||0);var B=$(k).getCoordinates();var x=E-B.left;var w=D-B.top;var A=(x-a.x)*i;var z=(w-a.y)*i;h.fly2_c({x:A,y:z})});this.doTogBirdView=function(){n.isShowBVMap=!n.isShowBVMap;n.doResize();if(n.isShowBVMap){q();s.onmap_zoomstart();s.onmap_zoomend()}};this.setRoleLayerManager=function(w){b=w};this.togRoadName=function(){if(!b){return}b.setVisible(!b.isVisible());n.updateRoadNameStatus()};this.updateRoadNameStatus=function(){if(!b){return}if(b.isVisible()){$("dbvTogRoadName").className="button_active"}else{$("dbvTogRoadName").className="button"}};this.setLabelManager=function(w){c=w};this.togLabel=function(){if(!c){return}c.setVisible(!c.isVisible());n.updateLabelStatus()};this.updateLabelStatus=function(){if(!c){return}if(c.isVisible()){$("dbvTogLabel").className="button_active"}else{$("dbvTogLabel").className="button"}};this.getZoom=function(){return h.getZoom()};var q=function(){var y=h.getCenterPos();var x=Math.round(y.x/i);var w=Math.round(y.y/i);var A=Math.round(u.width/2);var z=Math.round(u.height/2);a.x=-(x-A);a.y=-(w-z);s.handler.style.left=a.x+"px";s.handler.style.top=a.y+"px"};this.getWorldViewGrid=function(){var y=u;var z=-a.x;var D=-a.y;var w=z+y.width;var C=D+y.height;var A=Math.floor(z/256);var E=Math.floor(D/256);var x=w%256==0?w/256-1:Math.floor(w/256);var B=C%256==0?C/256-1:Math.floor(C/256);return{l:A,t:E,r:x,b:B}};this.doResize=function(){if(n.isShowBVMap){n.handler.style.left=h.coord.width-n.handler.offsetWidth+"px";$(n.handler).morph({top:h.coord.height-n.handler.offsetHeight})}else{n.handler.style.left=h.coord.width-n.handler.offsetWidth+"px";$(n.handler).morph({top:h.coord.height-17})}u={width:k.offsetWidth,height:k.offsetHeight};n.updateRoadNameStatus();q();s.onmap_resize()};this.onmap_dragstart=function(w){if(!d){return}if(n.isShowBVMap){s.onmap_dragstart()}};this.onmap_drag=function(w){if(!d){return}q();if(n.isShowBVMap){s.onmap_drag()}};this.onmap_dragend=function(){if(!d){return}q();if(n.isShowBVMap){s.onmap_dragend()}};this.onmap_zoomstart=function(){if(!d){return}if(n.isShowBVMap){s.onmap_zoomstart()}};this.onmap_zoom=function(w){if(!d){return}q();if(n.isShowBVMap){s.onmap_zoom()}};this.onmap_zoomend=function(){if(!d){return}q();if(n.isShowBVMap){s.onmap_zoomend()}};this.onmap_resize=function(){n.doResize()};this.onmap_unload=function(){m=null;k=null;b=null;s.onmap_unload();s=null;n.handler=null}}var MapZoombar=function(m,h,b,n,j){var e=b;var c=m;var d=h;var o=this;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute; left:0px; top:0px; width:22px; height:126px; z-index:300; background-color:#194792; border:solid 1px #194792;";var l=[];l.push('<div class="zoom_max" style="width:22px; height:22px;background:url('+citycome.Skin("map/zoombar.jpg")+') no-repeat 0px 0px ;" title="放大一个级别"></div>');var a=gMap.getConfig();var g=["零","一","二","三","四","五","六","七","八","九","十"];for(var f=a.zoom.max;f>=a.zoom.min;f--){l.push('<div class="zoom_'+f+'" style="width:22px; height:9px; background:url('+citycome.Skin("map/zoombar.jpg")+') no-repeat 0px -22px ;" title="放缩到第['+g[f+1]+']级"></div>')}l.push('<div class="zoom_min" style="width:22px; height:22px;background:url('+citycome.Skin("map/zoombar.jpg")+') no-repeat 0px -31px ;" title="缩小一个级别"></div>');this.handler.innerHTML=l.join("");delete l;l=null;$(this.handler).getElements("div").each(function(i){i.setOpacity(0.8);i.style.cursor="pointer";i.addEvent("mouseenter",function(){i.morph({opacity:[0.5,1]})});i.addEvent("mouseleave",function(){i.morph({opacity:[1,0.5]})})});$(this.handler).addEvent("click",function(p){switch(p.target.className){case"zoom_max":c.zoomUp();break;case"zoom_min":c.zoomDown();break;default:var i=p.target.className.split("_");if(i.length!=2){return}var q=i[1]*1;c.zoomTo(q);break}});var k=function(){var i=c.getZoom();$(o.handler).getElements("div").each(function(r){if(r.className!="zoom_max"&&r.className!="zoom_min"){var q=r.className.split("_");if(q.length!=2){return}var p=q[1]*1;if(i==p){r.style.backgroundPosition="-22px -22px"}else{r.style.backgroundPosition="0px -22px"}}})};k();this.doResize=function(){o.handler.style.left=c.coord.width-o.handler.offsetWidth-1+"px";o.handler.style.top=c.coord.height-o.handler.offsetHeight-1+"px"};this.onmap_dragstart=function(i){if(!e){return}};this.onmap_drag=function(i){if(!e){return}};this.onmap_dragend=function(){if(!e){return}};this.onmap_zoomstart=function(){if(!e){return}};this.onmap_zoom=function(i){if(!e){return}};this.onmap_zoomend=function(){if(!e){return}k()};this.onmap_resize=function(){o.doResize()};this.onmap_unload=function(){o.handler=null}};var __layer_labels_delay_loadtime=1000;function MapLayerLabels(_mapobj,_layerid,_visible,_dataurl,_className,_click){var mapobj=_mapobj;var self=this;var visible=false;if(_visible){visible=true}var isdragging=false;var layerid=_layerid;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible;z-index:20;";var oLoading=varconst.getDiv();oLoading.style.cssText="display:none;position:absolute; left:0px; top:0px; height:22px; line-height:22px; text-align:center; width:120px; border:solid 1px #f00; background-color:#ff0; z-index:3000;";oLoading.innerHTML="正在加载标注数据";_mapobj.container.appendChild(oLoading);this.cache=varconst.getDiv();if(visible){this.handler.style.display=""}else{this.handler.style.display="none"}this.setVisible=function(_v){if(_v){visible=true;self.handler.style.display="";loadData()}else{visible=false;self.handler.style.display="none"}};this.isVisible=function(){return visible};var labeldatas=[];var process_labels_itv=null;var process_labels_timer=function(){if(null==labeldatas||labeldatas.length<=0||isdragging){clearInterval(process_labels_itv);process_labels_itv=null;delete labeldatas;labeldatas=null}else{var o=labeldatas.shift();var i=self.handler.childNodes.length-1;while(i>=0){if(self.handler.childNodes[i]._id=o.id){delete o;o=null;return}i--}}};var process_load_labels=function(lab_str){eval("_reval="+lab_str);while(self.handler.childNodes.length<_reval.length){var obj=getIcon();self.handler.appendChild(obj)}var i=0;for(;i<_reval.length;i++){if(isdragging){return}self.handler.childNodes[i].style.display="none";self.handler.childNodes[i]._vv=true;self.handler.childNodes[i].setup(_reval[i].id,_reval[i].pos.x,_reval[i].pos.y,_reval[i].name,_click);self.handler.childNodes[i].style.display=""}for(;i<self.handler.childNodes.length;i++){if(isdragging){return}self.handler.childNodes[i].style.display="none";self.handler.childNodes[i]._vv=false}self.update()};var on_loadhs_succ=function(responseText,responseXML){try{var t1=$time();oLoading.style.backgroundColor="#00FF00";process_load_labels(responseText);var span=$time()-t1}finally{oLoading.style.display="none"}};var myRequest=new Request({url:_dataurl,method:"get",onSuccess:on_loadhs_succ});var loadItv=null;var delayLoad=function(){var view_bounds=mapobj.getMapViewBounds();var z=mapobj.getZoom();myRequest.cancel();myRequest.options.url=_dataurl+"?l="+view_bounds.l+"&t="+view_bounds.t+"&r="+view_bounds.r+"&b="+view_bounds.b+"&z="+z;myRequest.send();stopLoadData()};var stopLoadData=function(){clearTimeout(loadItv);loadItv=null};var loadData=function(){clearTimeout(loadItv);loadItv=null;oLoading.style.display="";oLoading.style.backgroundColor="#ff0";loadItv=setTimeout(delayLoad,__layer_labels_delay_loadtime)};this.load=function(){loadData()};var createIcon=function(){var o=document.createElement("TABLE");o.style.position="absolute";o.style.left="0px";o.style.top="0px";o.style.display="";o.cellPadding="1";o.cellSpacing="0";o.onmouseover=function(){if(self.handler.lastChild!=this){self.handler.appendChild(this)}};var tbody=document.createElement("TBODY");o.appendChild(tbody);var hRow=document.createElement("TR");tbody.appendChild(hRow);var td=document.createElement("TD");hRow.appendChild(td);td.className="ctxt";td.innerHTML='<a href="javascript:void(0)" style="white-space:nowrap;"></a>';o.className="maplabel";tbody=null;hRow=null;td=null;o.onmousemove=function(){if(self.handler.lastChild!=this){self.handler.appendChild(this)}};o.setup=function(_id,_x,_y,_txt,_className,_click){this._id=_id;this._x=_x;this._y=_y;var fc=this.rows.item(0).cells.item(0).firstChild;if(fc._txt!=_txt){fc.innerHTML="&nbsp;"+_txt+"&nbsp;"}fc._txt=_txt;fc._id=_id;fc._flag=layerid;fc=null};o.update=function(_scale){this.style.left=Math.round(this._x/_scale)+0+"px";this.style.top=Math.round(this._y/_scale)-9+"px"};return o};var getIcon=function(){var o=self.cache.childNodes.length>0?self.cache.firstChild:createIcon();o._id=-1;return o};var rccIcon=function(aicon){aicon._id=0;aicon._click=null;aicon._id=0;aicon._click=null;self.cache.appendChild(aicon)};var iconslist=[];this.add=function(_id,_x,_y,_txt,_className,_click){var obj=getIcon();obj.setup(_id,_x,_y,_txt,_className,_click);obj.update(mapobj.getScaleToDataZ());this.handler.appendChild(obj)};this.remove=function(_id){};this.clear=function(){while(self.handler.childNodes.length>0){rccIcon(self.handler.childNodes[0])}};this.update=function(){var i=0;var scale=mapobj.getScaleToDataZ();while(i<self.handler.childNodes.length){try{if(self.handler.childNodes[i]._vv){self.handler.childNodes[i].update(scale)}}catch(e){break}i++}};this.onmap_zoomstart=function(){self.handler.style.display="none";stopLoadData()};this.onmap_zoom=function(){if(visible){self.update()}};this.onmap_zoomend=function(){if(visible){self.handler.style.display="";self.update();loadData()}};this.onmap_dragstart=function(){self.handler.style.display="none";isdragging=true;stopLoadData()};this.onmap_drag=function(){isdragging=true};this.onmap_dragend=function(){if(visible){self.handler.style.display=""}isdragging=false;if(visible){loadData()}};this.onmap_resize=function(){var vp=mapobj.getViewport();oLoading.style.left=(vp.width-400)+"px";oLoading.style.top=(vp.height-24)+"px"};this.onmap_click=function(sender,arg){if(!arg.target){return}if(!arg.target._flag||!arg.target._id||!arg.target._txt){return}if(arg.target._flag==layerid&&_click){_click(arg,arg.target._id,arg.target._txt)}};this.onmap_unload=function(){oLoading=null;document.body.appendChild(this.cache);this.cache=null;delete iconslist;iconslist=null}}function MapLayerAD(h,e,a,f){var d=a;var b=h;var c=e;var k=this;var j=50;if(typeof(f)=="number"){j=f}this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible; z-index:"+j+";";this.handler._flag="adlayer__"+e;var g=[];this.add=function(t,n,s,r,u,q,y,v,x,m,l){if(x=="swf"){var p=new Swiff(n,{id:t,width:u,height:q,params:{wmode:"transparent"}});var w=p.toElement();w.style.cssText="position:absolute; left:0px; top:0px;outline:none;";w._type=x;w._orgw=u;w._orgh=q;w._x=s;w._y=r;w._cx=y;w._cy=v;w._flag="adlayer__"+e;w._url=l;var o=b.getScaleToDataZ();w.style.left=Math.round((w._x-w._cx)/o)+"px";w.style.top=Math.round((w._y-w._cy)/o)+"px";w.style.width=Math.round(w._orgw/o)+"px";w.style.height=Math.round(w._orgh/o)+"px";if(true){w.onmouseover=function(){var z=this;var A=b.getScaleToDataZ();z.style.left=Math.round((z._x/A-z._cx))+"px";z.style.top=Math.round((z._y/A-z._cy))+"px";z.style.width=Math.round(z._orgw)+"px";z.style.height=Math.round(z._orgh)+"px";z=null};w.onmouseout=function(){var A=b.getScaleToDataZ();var z=this;z.style.left=Math.round((z._x-z._cx)/A)+"px";z.style.top=Math.round((z._y-z._cy)/A)+"px";z.style.width=Math.round(z._orgw/A)+"px";z.style.height=Math.round(z._orgh/A)+"px";z=null}}this.handler.appendChild(w);w=null;p=null}};var i=function(){var l=0;var o=b.getScaleToDataZ();while(l<k.handler.childNodes.length){try{var m=k.handler.childNodes[l];m.style.left=Math.round((m._x-m._cx)/o)+"px";m.style.top=Math.round((m._y-m._cy)/o)+"px";m.style.width=Math.round(m._orgw/o)+"px";m.style.height=Math.round(m._orgh/o)+"px";m=null}catch(n){break}l++}};this.onmap_dragstart=function(l){if(!d){return}};this.onmap_drag=function(l){if(!d){return}};this.onmap_dragend=function(){if(!d){return}};this.onmap_zoomstart=function(){if(!d){return}k.handler.style.display="none"};this.onmap_zoom=function(l){if(!d){return}};this.onmap_zoomend=function(){if(!d){return}k.handler.style.display="";i()};this.onmap_click=function(m,l){if(l.target._flag==k.handler._flag&&l.target._url&&l.target._url!=""){if(citycome.browser.msie&&l.target._type=="swf"){window.open(l.target._url)}}};this.onmap_resize=function(){};this.onmap_unload=function(){k.handler=null;b=null;delete g;g=null}}function MapLayer(Q,L,M,f,g,R,D,S,d){var C=Q;var l=this;this.visible=L;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible;";if(!this.visible){this.handler.style.display="none"}var x=f;var z=g;var k=D;var E=R;var B=S;var P=d;var p=[];if(typeof(M)=="string"){p.push(M.replace("{F}",k).replace("{T}",z))}else{if(typeof(M)=="object"){for(var K=0;K<M.length;K++){p.push(M[K].replace("{F}",k).replace("{T}",z))}}}if(p.length<=0){alert("create failed!");return}var r=p.length-1;var o=function(){return p[citycome.random(0,r)]};var t=function(U){var V="";for(var T=0;T<U.length;T++){var W=U.charCodeAt(T)+"";if(W.length<3){W="0"+W}V+=W}return V};var n=[];var c=null;var J=varconst.getDiv();var h=varconst.getDiv();var H=null;Math.random;var s=function(V,W,i,U,T){return o().replace("{V}",V).replace("{X}",U).replace("{Y}",T).replace("{Z}",i)};var v=function(W,T,V,U,i){return o().replace("{V}",_v).replace("{X}",V).replace("{Y}",U).replace("{Z}",T)+"&magic="+i};var G=citycome.Skin("global/null256.gif");var F=function(i){i.onload=null;i.onerror=null;this.onabort=null;i.style.display="none";if(citycome.browser.isIE6){i.style.filter=""}i.src=G;h.appendChild(i)};var u=function(X,T,V,U){var Z=[n,J.childNodes,l.handler.childNodes];for(var Y=0;Y<Z.length;Y++){for(var W=0;W<Z[Y].length;W++){if(Z[Y][W]._t==X&&Z[Y][W]._z==T&&Z[Y][W]._x==V&&Z[Y][W]._y==U){return}}}Z=null;n.push({_v:x,_t:X,_z:T,_x:V,_y:U});j()};var b=function(){this.onload=null;this.onerror=null;this.style.display="";l.handler.appendChild(this)};var w=function(){this.onload=null;this.onerror=null;this.onabort=null;if(E&&citycome.browser.isIE6){this.onload=b;this.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.src+'",sizingMethod=scale)';this.src=G}else{l.handler.appendChild(this);this.style.display=""}};var O=function(){this.onload=null;this.onerror=null;this.onabort=null;F(this)};var m=function(){this.onload=null;this.onerror=null;this.onabort=null;F(this)};var j=function(){if(null==c){c=setInterval(function(){if(n.length<=0){clearInterval(c);c=null}else{var V=n.shift();var U=C.getZoom();var X=z;var W=C.getWorldViewGrid();var T=V._t!=X||V._z!=U||V._x<W.l||V._x>W.r||V._y<W.t||V._y>W.b;if(!T){var i=J.appendChild(h.childNodes.length>0?h.firstChild:varconst.getDOM("img"));i._v=V._v;i._t=V._t;i._z=V._z;i._x=V._x;i._y=V._y;i.style.position="absolute";i.style.width="256px";i.style.height="256px";i.style.left=V._x*256+"px";i.style.top=V._y*256+"px";i.style.display="none";i.onload=w;i.onerror=O;i.onabort=m;i.src=s(V._v,V._t,V._z,V._x,V._y);i=null}V=null}},50)}};var A=function(){var X=z;var U=C.getZoom();var W=C.getWorldViewGrid();for(var V=J.childNodes.length-1;V>=0;V--){var T=J.childNodes[V];if(!T){continue}if(T._t!=X||T._z!=U||T._x<W.l||T._x>W.r||T._y<W.t||T._y>W.b){F(T)}T=null}};var I=function(){if(null==H){H=setInterval(function(){if(n.length<=0&&J.childNodes.length<=0){var X=z;var U=C.getZoom();var W=C.getWorldViewGrid();for(var V=l.handler.childNodes.length-1;V>=0;V--){var T=l.handler.childNodes[V];if(!T){continue}if(T._t!=X||T._z!=U||T._x<W.l||T._x>W.r||T._y<W.t||T._y>W.b){F(T)}T=null}clearInterval(H);H=null}},50)}};var y=function(){N();n=[];while(J.childNodes.length>0){J.firstChild.onload=null;J.firstChild.onerror=null;J.firstChild.src=G;h.appendChild(J.firstChild)}while(l.handler.childNodes.length>0){l.handler.firstChild.onload=null;l.handler.firstChild.onerror=null;l.handler.firstChild.src=G;h.appendChild(l.handler.firstChild)}};var N=function(){n=[];clearInterval(c);c=null;clearInterval(H);H=null};var q=function(){var U=C.getZoom();var T=C.getWorldViewGrid();A();for(var i=T.l;i<=T.r;i++){for(var V=T.t;V<=T.b;V++){u(z,U,i,V)}}I()};var a=null;var e=function(){clearTimeout(a);a=null;a=setTimeout(q,50)};this.onmap_dragstart=function(i){if(!l.visible){return}N();if(!B){l.handler.style.display="none"}};this.onmap_drag=function(i){if(!l.visible){return}};this.onmap_dragend=function(){if(!l.visible){return}if(l.visible&&!B){l.handler.style.display=""}e()};this.onmap_zoomstart=function(){if(!l.visible){return}n=[];N();if(P){y()}};this.onmap_zoom=function(V){if(!l.visible){return}var Z=[l.handler.childNodes];var X=C.getZoom();try{for(var Y=0;Y<Z.length;Y++){for(var U=0;U<Z[Y].length;U++){if(!Z[Y][U]){continue}if(Z[Y][U].style.display!=""){continue}var T=256*Math.pow(2,X-parseInt(Z[Y][U]._z,10));Z[Y][U].style.width=Math.floor(T)+1+"px";Z[Y][U].style.height=Math.floor(T)+1+"px";Z[Y][U].style.left=Math.floor(Z[Y][U]._x*T)+"px";Z[Y][U].style.top=Math.floor(Z[Y][U]._y*T)+"px"}}}catch(W){alert(W)}Z=null};this.onmap_zoomend=function(){if(!l.visible){return}e();var Y=[l.handler.childNodes];var W=C.getZoom();try{for(var X=0;X<Y.length;X++){for(var U=0;U<Y[X].length;U++){if(Y[X][U]._z!=W){continue}var T=256;Y[X][U].style.width=T+"px";Y[X][U].style.height=T+"px";Y[X][U].style.left=Y[X][U]._x*T+"px";Y[X][U].style.top=Y[X][U]._y*T+"px"}}}catch(V){alert(V)}Y=null};this.isVisible=function(){return l.visible};this.setVisible=function(i){if(i==l.visible){return}if(i){l.visible=true;l.handler.style.display="";e()}else{l.visible=false;l.handler.style.display="none";N();y()}};this.onmap_resize=function(){if(!l.visible){return}e()};this.onmap_unload=function(){N();y();l.handler.appendChild(h)}}function MapLayerHotspot(_mapobj,_layerid,_visible,_dataurl,_click){var mapobj=_mapobj;var dataurl=_dataurl;var self=this;var visible=false;if(_visible){visible=true}var click=_click;var layerid=_layerid;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible; z-index:10;";if(!visible){this.handler.style.display="none"}this.handler.innerHTML='<img src="'+citycome.Skin("global/null2000.gif")+'" style="position:absolute;z-index:10;border:none;" hidefocus="true"/><div style="position:absolute;z-index:1; overflow:visible;"><v:shape style="position:absolute;width:1px;height:1px; overflow:visible;" coordsize="1,1" path="M 0 0 L 0 0 E"><v:stroke opacity="0.8" color="#FFFF00" weight="2"/><v:fill opacity="0" color="#FFFFFF"/></v:shape></div><div style="position:absolute;z-index:99999; padding:2px 2px; display:none; white-space:nowrap; font-size:12px; height:18px; line-height:18px; overflow:visible; background-color:#FFFF00; border:solid 1px #FF8020; color:#000; text-align:center;"></div>';var img=this.handler.childNodes[0];var vshape=this.handler.childNodes[1];var hintText=this.handler.childNodes[2];$(hintText).setOpacity(0.8);var hs_data=[];var last_active_obj_id=0;var last_active=null;var imgflag="img_"+layerid;img._flag=imgflag;$(img).addEvent("mousemove",function(event){if(null==hs_data||!mapobj){return true}var evt=event.event||window.event;var doc=document.documentElement,body=document.body;var mx=evt.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);var my=evt.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);var srcx=mx-mapobj.coord.left;var srcy=my-mapobj.coord.top;var worldpos=mapobj.getWorldpos();var scale=mapobj.getScaleToDataZ();var mappos=mapobj.screen2map({x:srcx,y:srcy});if(last_active&&IsHitHotspot(mappos.x,mappos.y,last_active)){updateVisibleArea(last_active.hs,worldpos,scale);hintText.style.left=Math.round(mappos.x/scale-Math.round(hintText.offsetWidth/2))+"px";hintText.style.top=Math.round(mappos.y/scale)+32+"px";return}for(var i=0;i<hs_data.length;i++){if(!IsHitHotspot(mappos.x,mappos.y,hs_data[i])){continue}last_active=hs_data[i];updateVisibleArea(last_active.hs,worldpos,scale);hintText.style.left=mappos.x+32+"px";hintText.style.top=mappos.y+32+"px";hintText.innerHTML="&nbsp;"+last_active.name+"&nbsp;";hintText.style.display="";return}hintText.style.display="none";last_active=null;if(citycome.browser.msie){vshape.firstChild.path="M 0 0 L 0 0 E"}});var IsHitHotspot=function(x,y,hsItem){if(!PtInRect(x,y,hsItem.ab)){return false}if(!IsInArea(x,y,hsItem.hs)){return false}return true};var updateVisibleArea=function(polygon,worldpos,scale){if(!citycome.browser.msie){return}var path="";for(var i=0;i<polygon.length;i++){path+=(i==0?" M ":" L ")+Math.round(worldpos.x+polygon[i].x/scale)+" "+Math.round(worldpos.y+polygon[i].y/scale)+" "}path+=" L "+Math.round(worldpos.x+polygon[0].x/scale)+" "+Math.round(worldpos.y+polygon[0].y/scale)+" ";vshape.firstChild.path=path+"E"};var process_load_hs=function(hs_str){eval("_reval="+hs_str);var worldpos=mapobj.getWorldpos();var vp=mapobj.getViewport();var scale=mapobj.getScaleToDataZ();img.style.left=-worldpos.x+"px";img.style.top=-worldpos.y+"px";img.style.width=vp.width+"px";img.style.height=vp.height+"px";if(citycome.browser.msie){vshape.style.left=-worldpos.x+"px";vshape.style.top=-worldpos.y+"px"}delete hs_data;hs_data=null;hs_data=_reval};var on_loadhs_succ=function(responseText,responseXML){try{var t1=$time();process_load_hs(responseText);var span=$time()-t1}catch(e){}};var myRequest=new Request({url:dataurl,method:"get",onSuccess:on_loadhs_succ});var updatePos=function(){var worldpos=mapobj.getWorldpos();img.style.left=-worldpos.x+"px";img.style.top=-worldpos.y+"px";if(citycome.browser.msie){vshape.style.left=-worldpos.x+"px";vshape.style.top=-worldpos.y+"px"}};var task=[];var loadItv=null;var delayLoad=function(){var view_bounds=mapobj.getMapViewBounds();var z=mapobj.getZoom();myRequest.cancel();myRequest.options.url=dataurl+"?l="+view_bounds.l+"&t="+view_bounds.t+"&r="+view_bounds.r+"&b="+view_bounds.b+"&z="+z;myRequest.send();stopLoadHS()};var stopLoadHS=function(){clearTimeout(loadItv);loadItv=null;task=[]};var loadHS=function(){clearTimeout(loadItv);loadItv=null;loadItv=setTimeout(delayLoad,1500)};this.load=function(){loadHS()};this.onmap_zoomstart=function(){stopLoadHS();if(citycome.browser.msie){vshape.firstChild.path="M 0 0 L 0 0 E"}};this.onmap_zoom=function(){updatePos()};this.onmap_zoomend=function(){loadHS()};this.onmap_dragstart=function(){stopLoadHS();if(citycome.browser.msie){vshape.firstChild.path="M 0 0 L 0 0 E"}};this.onmap_drag=function(){updatePos()};this.onmap_dragend=function(){loadHS()};this.onmap_click=function(sender,arg){if(!arg.target){return}if(!arg.target._flag){return}if(arg.target._flag==imgflag&&last_active&&click){click(arg,last_active.id,last_active.name)}};this.setVisible=function(_v){if(_v==visible){return}if(_v){visible=true;this.handler.style.display=""}else{visible=false;this.handler.style.display="none"}};this.isVisible=function(){return visible};this.onmap_unload=function(){stopLoadHS();img=null;imgmap=null;vshape=null}}function MapWindow(o,q,c,r,n,d){var f=o;var k=this;var b=false;var h=q;var e={x:224711,y:125924};var s=null;if(d){s=d}var p=null;if(n){p=n}this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute; overflow:visible";this.handler._flag="win#"+q;var i=c;var a=r;this.winHandler=varconst.getDiv();this.winHandler.style.cssText="position:absolute;overflow:hidden; background-image:url("+citycome.Skin("global/citycomeloading.gif")+") no-repeat center center;";this.winHandler.style.width=c+"px";this.winHandler.style.height=r+"px";this.winHandler.className="mapwindow";this.handler.appendChild(this.winHandler);this.arrowBox=varconst.getDiv();this.arrowBox.style.cssText="width:57px; height:103px; overflow:hidden; position:absolute;";this.arrow=varconst.getDOM("img");if(citycome.browser.isIE6){this.arrow.src=citycome.Skin("global/null.gif");this.arrow.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+citycome.Skin("map/arrow_02.png")+'")'}else{this.arrow.src=citycome.Skin("map/arrow_02.png")}this.arrow.style.position="absolute";this.arrowBox.appendChild(this.arrow);this.handler.appendChild(this.arrowBox);var g={x:3,y:38};var l={x:57,y:103};var j=$(this.winHandler);j.addEvent("mousedown",function(t){t.stopPropagation()});j.addEvent("selectstart",function(t){t.stopPropagation()});j.addEvent("mousewheel",function(t){t.stopPropagation()});j.addEvent("mouseenter",function(){j.morph({opacity:[0.9,1]})});j.addEvent("mouseleave",function(){j.morph({opacity:[1,0.9]})});this.isVisible=function(){return b};var m="";this.show=function(x,w,E,H,B){b=true;var D=130;var v=i;if(typeof(H)=="number"){i=H}var I=a;if(typeof(B)=="number"){a=B}j.setOpacity(0);j.style.display="";k.arrowBox.style.display="";if(E){k.setContent(E)}e.x=x;e.y=w;var t=f.map2screen(e);var F=f.getViewport();var z=Math.round(F.width/2);var y=Math.round(F.height/2);var G=i+l.x;var A=a+D;var C={l:t.x,t:t.y-g.y,r:t.x+G+l.x,b:t.y-g.y+A};var u=false;if(C.l<=0){C.l=10;C.r=C.l+G;u=true}if(C.r>F.width){C.l=F.width-220-G;C.r=C.l+G+l.x;if(C.l<0){C.l=10;C.r=C.l+G+l.x}u=true}if(C.b>F.height){C.t=F.height-10-A;C.b=C.t+A;u=true}if(C.t<0){C.t=l.y;C.b=C.t+A;u=true}if(u){f.flyTo({x:x,y:w},{x:C.l-g.x,y:C.t+g.y})}this.update();j.morph({opacity:[0,0.9],height:[I,a]})};this.setContent=function(t){if(t&&t!=m){m=t;this.winHandler.innerHTML=t}};this.close=function(){b=false;k.winHandler.style.display="none";k.arrowBox.style.display="none";if(s){s(h)}};this.hideSometime=function(){k.winHandler.style.display="none";k.arrowBox.style.display="none"};this.reshow=function(){if(!b){return}k.winHandler.style.display="";k.arrowBox.style.display=""};this.changeSize=function(u,v){var w=i;if(typeof(u)=="number"){i=u}var t=a;if(typeof(v)=="number"){a=v}j.morph({height:[t,a],width:[w,i]})};this.update=function(){if(!b){return}var t=f.getScaleToDataZ();k.winHandler.style.left=Math.round(e.x/t)+(l.x-g.x)+"px";k.winHandler.style.top=Math.round(e.y/t)-(l.y-g.y)+"px";k.arrowBox.style.left=Math.round(e.x/t)-(g.x)+"px";k.arrowBox.style.top=Math.round(e.y/t)-(g.y)+"px"};this.onmap_zoom=function(){k.update()};this.onmap_zoomend=function(){k.update()};this.onmap_drag=function(){k.update()};this.onmap_dragend=function(){k.update()};this.onmap_click=function(u,t){};this.onmap_unload=function(){this.handler=null;this.winHandler=null;j=null}}function MapLayerMarks(i,g,a){var b=i;var k=this;var e=false;if(a){e=true}var d=g;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible;";this.cache=varconst.getDiv();if(e){this.handler.style.display=""}else{this.handler.style.display="none"}var f=function(){var r=document.createElement("TABLE");r.style.position="absolute";r.style.left="0px";r.style.top="0px";r.style.display="";r.cellPadding="0";r.cellSpacing="0";r._txt="";var n=document.createElement("TBODY");r.appendChild(n);var l=document.createElement("TR");n.appendChild(l);var q=document.createElement("TD");l.appendChild(q);q.className="labc1";var p=document.createElement("TD");p.style.cssText="white-space:nowrap; display:none;";p.innerHTML='<a href="javascript:void(0)" style="white-space:nowrap;"></a>';p.className="labc2";l.appendChild(p);var m=document.createElement("IMG");m.style.cssText="cursor:pointer";q.appendChild(m);r.onmouseover=function(){if(k.handler.lastChild!=this){k.handler.appendChild(this)}if(this._sto&&this._txt&&this._txt!=""){this.rows.item(0).cells.item(1).style.display=""}};r.onmouseout=function(){if(!this._asl){this.rows.item(0).cells.item(1).style.display="none"}};r.setsrc=function(s){var o=this.rows.item(0).cells.item(0).firstChild;o.src=s};r.setup=function(B,v,A,z,C,w,F,E,y,s,D,o,t){this._id=B;this._x=A;this._y=z;this._w=C;this._h=w;this._cx=F;this._cy=E;this._asl=o;this._sto=t;if(typeof(D)=="string"){this.className=D}else{this.className=""}if(this._txt!=y){this.rows.item(0).cells.item(1).firstChild.innerHTML=y}this._txt=y;var u=this.rows.item(0).cells.item(0).firstChild;var x=this.rows.item(0).cells.item(1).firstChild;u.src=v;u._click=s;u._id=B;u._flag=d;x._flag=d;x._id=B;x._click=s;this._flag=d;this._click=s;if(o){this.rows.item(0).cells.item(1).style.display=""}else{this.rows.item(0).cells.item(1).style.display="none"}u=null;x=null};r.update=function(o){this.style.left=Math.round(this._x/o)-this._cx+"px";this.style.top=Math.round(this._y/o)-this._cy+"px"};return r};var j=function(){var l=k.cache.childNodes.length>0?k.cache.firstChild:f();return l};var h=function(l){l._id=0;l._click=null;l.rows.item(0).cells.item(1).firstChild._id=0;l.rows.item(0).cells.item(1).firstChild._click=null;l.rows.item(0).cells.item(0).firstChild._id=0;l.rows.item(0).cells.item(0).firstChild._click=null;k.cache.appendChild(l)};var c=[];this.add=function(u,n,t,s,v,p,y,x,r,l,w,q,m){var o=j();o.setup(u,n,t,s,v,p,y,x,r,l,w,q,m);o.update(b.getScaleToDataZ());this.handler.appendChild(o);return o};this.remove=function(m){for(var l=0;l<k.handler.childNodes.length;l++){if(k.handler.childNodes[l]._id==m){h(k.handler.childNodes[l]);return k.handler.childNodes[l]}}return null};this.updateSrc=function(m,n){for(var l=0;l<k.handler.childNodes.length;l++){if(k.handler.childNodes[l]._id==m){k.handler.childNodes[l].setsrc(n);return k.handler.childNodes[l]}}return null};this.clear=function(){while(k.handler.childNodes.length>0){h(k.handler.childNodes[0])}};this.update=function(){var l=0;var n=b.getScaleToDataZ();while(l<k.handler.childNodes.length){try{k.handler.childNodes[l].update(n)}catch(m){break}l++}};this.onmap_zoom=function(){k.update()};this.onmap_zoomend=function(){k.update()};this.onmap_drag=function(){};this.onmap_dragend=function(){};this.onmap_click=function(m,l){if(!l.target||l.target._flag!=d||!l.target._id){return}if(typeof(l.target._click)=="function"){try{l.target._click(l.target._id)}catch(n){}}};this.onmap_unload=function(){document.body.appendChild(this.cache);this.cache=null;delete c;c=null}}function MapLayerGetPos(i){var c=i;var l=this;this.handler=varconst.getDiv();this.handler.style.cssText="position:absolute;overflow:visible; cursor:crosshair; left:0px; top:0px; z-index:90000; width:3000px; height:3000px;";this.handler.style.display="none";this.handler.style.backgroundImage="url("+citycome.Skin("global/null2000.gif")+")";var b=varconst.getDOM("img");b.style.cssText="position:absolute; width:32px; height:32px; left:0px; top:0px;";b.src=citycome.Skin("map/point.gif");this.handler.appendChild(b);this.active=false;var e="";var j="";var a=false;var h=null;var k=null;var d=function(m,n){if(callback){callback(e,m,n)}};var g=function(){l.active=false;e="";a=false;h=null;k=null};var f=function(n){var u=n.event||window.event;var r=document.documentElement,p=document.body;var t=u.clientX+(r&&r.scrollLeft||p&&p.scrollLeft||0)-(r.clientLeft||0);var s=u.clientY+(r&&r.scrollTop||p&&p.scrollTop||0)-(r.clientTop||0);var q=l.handler.getPosition();var o=t-q.x;var m=s-q.y;l.updateCursorPos(o,m)};$(this.handler).addEvent("mousemove",f);this.updateCursorPos=function(n,m){if(!this.active){return}b.style.left=(n-16)+"px";b.style.top=(m-16)+"px"};this.domousemove=function(m){f(m)};this.start=function(q,n,p,o,m){if(l.active&&e!=q){if(confirm("您正在为“"+e+"”获取位置信息，要取消吗？\n\r \n\r 点击“确定”开始新的操作，点取“取消”返回继续为上一次操作获取位置信息！")){g();l.active=false}}k=m;h=o;e=q;j=n;a=p;l.active=true;this.handler.style.display=""};this.end=function(n,m){if(null!=h){h(e,n,m)}if(!a){l.complete()}};this.cancel=function(){if(null!=k){k(e)}l.complete()};this.complete=function(){l.active=false;g();this.handler.style.display="none"}}function CityMap(K,d){this.wrapper=$(K);this.wrapper.style.position="absolute";this.container=$(varconst.getDiv());this.container.style.cssText="position:absolute; left:0px; top:0px;width:"+this.wrapper.offsetWidth+"px; height:"+this.wrapper.offsetHeight+"px;";this.wrapper.appendChild(this.container);this.handler=$(this.container.appendChild(varconst.getDiv()));this.handler.style.cssText="position:absolute; left:0px; top:0px; z-index:1; overflow:visible;";var e=this;var z=function(V,W){return V+W};var x=function(V,W){return V+W};var C=function(V,W){return W-V};var B=function(V,W){return W-V};var S=function(W,V){if(W.style.cursor!=V){W.style.cursor=V}};var R=function(V){V.stop();return false};var w=d.zoom.max;var a=d.zoom.min;var q=d.zoom.data;var G={width:e.container.offsetWidth,height:e.container.offsetHeight};var p=d.startup.z;var L=Math.pow(2,w-p);var j={x:Math.round(-d.startup.x/L+G.width/2),y:Math.round(-d.startup.y/L+G.height/2)};var F={x:0,y:0};var D={x:0,y:0};var l={x:0,y:0};var n=false;this.scrmousePt={x:0,y:0};var I=[];var H=d.allowDrag;var M=d.allowMouseWheelZoom;e.handler.style.left=Math.round(j.x)+"px";e.handler.style.top=Math.round(j.y)+"px";this.coord=this.container.getCoordinates();var k=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_zoomstart){I[W].onmap_zoomstart(X,V)}}};var o=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_zoom){I[W].onmap_zoom(X,V)}}};var U=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_zoomend){I[W].onmap_zoomend(X,V)}}};var c=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_dragstart){I[W].onmap_dragstart(X,V)}}};var A=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_drag){I[W].onmap_drag(X,V)}}};var P=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_dragend){I[W].onmap_dragend(X,V)}}};var b=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_click){I[W].onmap_click(X,V)}}};var N=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_resize){I[W].onmap_resize(X,V)}}};var t=function(X,V){for(var W=0;W<I.length;W++){if(I[W].onmap_unload){try{I[W].onmap_unload(X,V)}catch(Y){}}}};this.setAllowDrag=function(V){H=V};this.setAllowMouseWheelZoom=function(V){M=V};this.setWorldPos=function(V){j.x=V.x;j.y=V.y;e.handler.style.left=Math.round(j.x)+"px";e.handler.style.top=Math.round(j.y)+"px"};this.getConfig=function(){return d};this.getCenterPos=function(W){var V=p;if(typeof(W)=="number"){W=V=W}var X=Math.pow(2,V-p);return{x:Math.round(C(j.x,G.width/2)*X),y:Math.round(B(j.y,G.height/2)*X)}};this.getMapCenter=function(){return e.getCenterPos(q)};this.getScaleToMaxZ=function(){return Math.pow(2,w-p)};this.getScaleToDataZ=function(){return Math.pow(2,q-p)};this.getWorldpos=function(){return j};this.getZoom=function(){return p};this.getViewport=function(){return G};this.getViewportCenter=function(){return{x:Math.round(G.width/2),y:Math.round(G.height/2)}};this.map2screen=function(V){var W=e.getScaleToDataZ();return{x:z(j.x,Math.round(V.x/W)),y:z(j.y,Math.round(V.y/W))}};this.screen2map=function(V){var W=e.getScaleToDataZ();return{x:C(j.x,V.x)*W,y:B(j.y,V.y)*W}};this.getWorldViewport=function(V){if(typeof(V)!="number"){V=p}if(V!=p){var W=Math.pow(2,V-p);return{l:C(j.x,0)*W,t:B(j.y,0)*W,r:C(j.x,G.width)*W,b:B(j.y,G.height)*W}}else{return{l:C(j.x,0),t:B(j.y,0),r:C(j.x,G.width),b:B(j.y,G.height)}}};this.getMapViewport=function(){return this.getWorldViewport(q)};this.getWorldViewBounds=function(ab){var X=e.getViewport();var Y=-j.x;var ae=-j.y;var W=Y+X.width;var ad=ae+X.height;var Z=Math.floor(Y/256);var af=Math.floor(ae/256);var V=W%256==0?W/256-1:Math.floor(W/256);var ac=ad%256==0?ad/256-1:Math.floor(ad/256);V++;ac++;if(typeof(ab)!="number"){ab=p}if(ab!=p){var aa=Math.pow(2,ab-p);return{l:Z*256*aa,t:af*256*aa,r:V*256*aa,b:ac*256*aa}}else{return{l:Z*256,t:af*256,r:V*256,b:ac*256}}};this.getMapViewBounds=function(){return e.getWorldViewBounds(q)};this.getWorldViewGrid=function(ab){var X=e.getViewport();var Y=-j.x;var ae=-j.y;var W=Y+X.width;var ad=ae+X.height;var Z=Math.floor(Y/256);var af=Math.floor(ae/256);var V=W%256==0?W/256-1:Math.floor(W/256);var ac=ad%256==0?ad/256-1:Math.floor(ad/256);if(typeof(ab)!="number"){ab=p}if(ab!=p){var aa=Math.pow(2,ab-p);return{l:Z*aa,t:af*aa,r:V*aa,b:ac*aa}}else{return{l:Z,t:af,r:V,b:ac}}};this.doResize=function(){e.coord=e.wrapper.getCoordinates();e.container.style.width=e.coord.width+"px";e.container.style.height=e.coord.height+"px";G.width=e.coord.width;G.height=e.coord.height;N(e,null)};this.doUnload=function(){t(e,null);e.container=null;e.handler=null};this.addLayer=function(V){e.handler.appendChild(V.handler);I.push(V);return V};this.removeLayer=function(W){for(var V=0;V<I.length;V++){if(I[V]==W){I.splice(V,1)}}return W};this.layerMarks=new MapLayerMarks(e,"_sys_mark_layer",true);this.layerMarks.handler.style.zIndex=2000;I.push(this.layerMarks);this.handler.appendChild(this.layerMarks.handler);var Q=1;this.BuildMapLayer=function(X,ab,W,aa,ac,Z,ad,V){var Y=new MapLayer(e,X,ab,W,aa,ac,Z,ad,V);Y.handler.style.zIndex=Q++;e.handler.appendChild(Y.handler);I.push(Y);return Y};this.BuildHotspotLayer=function(Z,W,Y,V){var X=new MapLayerHotspot(e,Z,W,Y,V);e.handler.appendChild(X.handler);I.push(X);X.load();return X};this.BuildLabelsLayer=function(aa,W,Z,X,V){var Y=new MapLayerLabels(e,aa,W,Z,X,V);e.handler.appendChild(Y.handler);I.push(Y);if(W){Y.load()}return Y};this.wins={};this.BuildWindow=function(Z,V,X,Y,W){if(e.wins[Z]){return e.wins[Z]}e.wins[Z]=new MapWindow(e,Z,V,X,Y,W);e.handler.appendChild(e.wins[Z].handler);e.wins[Z].handler.style.zIndex=3000+Q++;I.push(e.wins[Z]);return e.wins[Z]};this.birdview=null;this.BuildBirdView=function(aa,V,Y,Z,W,X){if(null!=e.birdview){return e.birdview}e.birdview=new MapBiardView(e,aa,V,Y,Z,W,X);e.wrapper.appendChild(e.birdview.handler);I.push(e.birdview);return e.birdview};this.zoombar=null;this.BuildZoombar=function(){if(null!=e.zoombar){return e.zoombar}e.zoombar=new MapZoombar(e,"sys-layer-zoombar",true,22,118);e.wrapper.appendChild(e.zoombar.handler);I.push(e.zoombar);return e.zoombar};this.BuildADLayer=function(Y,W,X){var V=new MapLayerAD(e,Y,W,X);I.push(V);e.handler.appendChild(V.handler);return V};var y=new MapLayerGetPos(e);e.container.appendChild(y.handler);this.getmappos_start=function(Z,W,Y,X,V){y.start(Z,W,Y,X,V)};this.getmappos_cancel=function(){y.cancel()};var J=null;this.fly2_c=function(X,V){var W=e.getScaleToDataZ();e.flyTo({x:X.x*W,y:X.y*W},V)};this.flyTo=function(ae,ac){if(typeof(ae)=="undefined"||ae.x<=0||ae.y<=0){return}var ag=e.getViewportCenter();var W={x:ag.x,y:ag.y};if(ac){W.x=ac.x;W.y=ac.y}var V={x:C(j.x,W.x),y:B(j.y,W.y)};var ah=e.getScaleToDataZ();var af={x:ae.x/ah,y:ae.y/ah};var ab=af.x-V.x;var Z=af.y-V.y;var Y=Math.sqrt(ab*ab+Z*Z);if(Y<=1){return}var X=500;if(null!=J){clearInterval(J);J=null;P(e,null)}var ad=$time();c(e,null);var aa=function(){var ai=$time();if(ai<ad+X){delta=Fx.Transitions.Sine((ai-ad)/X);var ak=(af.x-V.x)*delta+V.x;var aj=(af.y-V.y)*delta+V.y;j.x=-Math.round(ak-W.x);j.y=-Math.round(aj-W.y);e.setWorldPos(j);A(e,null)}else{j.x=-Math.round(af.x-W.x);j.y=-Math.round(af.y-W.y);e.setWorldPos(j);A(e,null);clearInterval(J);J=null;P(e,null)}};J=setInterval(aa,10)};var f=null;var E=false;this.zoomUp=function(){e.zoomTo(p+1)};this.zoomDown=function(){e.zoomTo(p-1)};this.zoomTo=function(ag,ac){if(ag==p||ag<a||ag>w||E||f!=null){return}if((p+"").indexOf(".")>0){return}var ab=ag;var af=e.getViewportCenter();var X={x:af.x,y:af.y};if(ac){X.x=ac.x;X.y=ac.y}var V={x:C(j.x,X.x),y:B(j.y,X.y)};var W=Math.round(p);var Y=Math.pow(2,ab-p);var ae={x:V.x*Y,y:V.y*Y};var ad=$time();var aa=300;E=true;k(e,null);var Z=function(){var ai=$time();if(ai<ad+aa){delta=Fx.Transitions.linear((ai-ad)/aa);var aj=(ab-W)*delta+W;var ah=Math.pow(2,aj-W);var ak={x:-Math.round(V.x*ah-X.x),y:-Math.round(V.y*ah-X.y)};p=aj;e.setWorldPos(ak);o(e,null)}else{clearInterval(f);f=null;try{var aj=ab;var ah=Math.pow(2,aj-W);p=ab;var ak={x:-Math.round(ae.x-X.x),y:-Math.round(ae.y-X.y)};e.setWorldPos(ak);o(e,null);U(e,null)}finally{E=false}}};f=setInterval(Z,30)};var i=function(V){c(e,V)};var s=function(X,W,V){j.x+=W;j.y+=V;e.setWorldPos(j);A(e,{event:X,dx:W,dy:V})};var O=function(V){P(V,null)};var v=function(V){var ag=V.event||window.event;var ad=document.documentElement,ab=document.body;var af=ag.clientX+(ad&&ad.scrollLeft||ab&&ab.scrollLeft||0)-(ad.clientLeft||0);var ae=ag.clientY+(ad&&ad.scrollTop||ab&&ab.scrollTop||0)-(ad.clientTop||0);var Y=af-e.coord.left;var W=ae-e.coord.top;if(y.active){var Z=e.getScaleToDataZ();var ac=C(j.x,Y)*Z;var aa=B(j.y,W)*Z;y.end(ac,aa);return}for(var X in e.wins){if(e.wins[X].isVisible()){e.wins[X].close()}}b(e,V)};var r=function(V){V.stop();if(!M){return false}if(V.wheel>0){e.zoomTo(p+1)}else{if(V.wheel<0){e.zoomTo(p-1)}}};var h=function(V){return false};var T=function(V){var af=V.event||window.event;var ac=document.documentElement,ab=document.body;var ae=af.clientX+(ac&&ac.scrollLeft||ab&&ab.scrollLeft||0)-(ac.clientLeft||0);var ad=af.clientY+(ac&&ac.scrollTop||ab&&ab.scrollTop||0)-(ac.clientTop||0);var X=ae-e.coord.left;var W=ad-e.coord.top;var Y=e.getScaleToDataZ();var aa=C(j.x,X)*Y;var Z=B(j.y,W)*Y};var u=function(W){var ac=W.event||window.event;var Z=document.documentElement,Y=document.body;var ab=ac.clientX+(Z&&Z.scrollLeft||Y&&Y.scrollLeft||0)-(Z.clientLeft||0);var aa=ac.clientY+(Z&&Z.scrollTop||Y&&Y.scrollTop||0)-(Z.clientTop||0);var ae=ab-F.x;var ad=aa-F.y;F.x=ab;F.y=aa;var X=ab-e.coord.left;var V=aa-e.coord.top;e.scrmousePt.x=X;e.scrmousePt.y=V;if(y.active){y.domousemove(W)}if(n){s(W,ae,ad)}else{if(ae*ae+ad*ad>=4){n=true;i(W);S(e.container,citycome.cursor.closeHand)}}W.stop()};var g=function(Z){document.removeEvent("mousemove",u);document.removeEvent("mouseup",g);if(e.container.releaseCapture){e.container.releaseCapture()}var X=Z.event||window.event;var ab=document.documentElement,V=document.body;var ac=X.clientX+(ab&&ab.scrollLeft||V&&V.scrollLeft||0)-(ab.clientLeft||0);var aa=X.clientY+(ab&&ab.scrollTop||V&&V.scrollTop||0)-(ab.clientTop||0);var Y=ac-e.coord.left;var W=aa-e.coord.top;e.scrmousePt.x=Y;e.scrmousePt.y=W;if(n){n=false;O(Z);S(e.container,citycome.cursor.org)}else{v(Z)}};var m=function(Z){var X=Z.event||window.event;var ab=document.documentElement,V=document.body;var ac=X.clientX+(ab&&ab.scrollLeft||V&&V.scrollLeft||0)-(ab.clientLeft||0);var aa=X.clientY+(ab&&ab.scrollTop||V&&V.scrollTop||0)-(ab.clientTop||0);l.x=ac;l.y=aa;n=false;F.x=ac;F.y=aa;var Y=ac-e.coord.left;var W=aa-e.coord.top;e.scrmousePt.x=Y;e.scrmousePt.y=W;e.container.focus();if(Z.rightClick){if(y.active){y.cancel();return}}if(!Z.rightClick&&H&&!E){if(e.container.setCapture){e.container.setCapture()}document.removeEvent("mousemove",u);document.removeEvent("mouseup",g);document.addEvent("mousemove",u);document.addEvent("mouseup",g);Z.stop()}};e.container.addEvent("mousedown",m);e.container.addEvent("mousewheel",r);e.container.addEvent("contextmenu",h);e.container.addEvent("dblclick",T);e.container.addEvent("selectstart",m)};