/* Cached */
function CDebugConsoleDummy(){}CDebugConsoleDummy.prototype.Info=function(){};CDebugConsoleDummy.prototype.Warning=function(){};
CDebugConsoleDummy.prototype.Error=function(){};function CDebugConsole(A,B){this._a=B;this._b=document.getElementById(A);
if(this._b){this._b.style.display="block"}}CDebugConsole.prototype._c=function(A){if(this._b){var B=document.createElement("span");
B.innerHTML=A;this._b.appendChild(B)}};CDebugConsole.prototype.Info=function(A){if(this._a>=3){this._c("INFO: "+A)}};CDebugConsole.prototype.Warning=function(A){if(this._a>=2){this._c("WARN: "+A)
}};CDebugConsole.prototype.Error=function(A){if(this._a>=1){this._c("ERROR: "+A)}};function CPoiJSServiceClient(A,B,C){this._d="YM_PoiJSServiceClient";
this._e=B;this._f="";this._g=null;this._h=0;this._i=false;this.Debug=C;this.DataHandler=function(D,E){alert(E)};this.InfoHandler=function(D,F,E){alert(E)
};this.ErrorHandler=function(D,F,E){alert(E)};this.BaseUrl=A+"?SessionGuid="+B;this.RunningRequests=0;this.LastRequestData=null
}CPoiJSServiceClient.prototype.State=function(){return(this._g?1:0)};CPoiJSServiceClient.prototype.AbortRequest=function(){try{this._g.abort();
this.RunningRequests--;if(this.RunningRequests<0){this.RunningRequests=0}}catch(A){}this._g=null};CPoiJSServiceClient.prototype.Enable=function(){this._i=true
};CPoiJSServiceClient.prototype.IsEnabled=function(){return this._i};CPoiJSServiceClient.prototype._j=function(B){var A="";
for(var C in B){A=A+"&"+C+"="+encodeURIComponent(B[C])}return A};CPoiJSServiceClient.prototype.InvokeRequest=function(K,J,A,C){if(this.State()==1){var D=this;
setTimeout(function(){D.InvokeRequest(K,J,A,C)},100);return}this.LastRequestData=K;if((J==null)||(J!="POST")){J="GET"}if(!this._i){return
}this._k=K;this._l=A?A:this.DataHandler;this._m=A;var N=this._j(K);var F=this.BaseUrl+N;var M=F.replace(/([\?&])timestamp=[\d]*[\w&]/ig,"$1")==this._f.replace(/([\?&])timestamp=[\d]*[\w&]/ig,"$1")||(K["DataSetIds"]&&this._f.indexOf(K["DataSetIds"])>-1);
if(!this._g||!M){this.Debug.Info("InvokeRequest("+F+")");this._f=F;if(this._g){this.AbortRequest()}try{if(typeof XMLHttpRequest!=="undefined"){this._g=new XMLHttpRequest()
}else{this._g=new ActiveXObject("Microsoft.XMLHttp")}}catch(I){this.Debug.Warning("Could not create XMLHttpRequest: "+I.message);
var L=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var G in L){try{this._g=new ActiveXObject(G);break}catch(I){}}}if(F.indexOf("?")<0){F+="?"
}else{F+="&"}F+="timestamp="+(new Date()).getTime();if(this._g){try{this.RunningRequests++;if(J=="GET"){this._g.open("GET",F)
}else{this._g.open("POST",this.BaseUrl)}var H=this;this._g.onreadystatechange=function(){try{H.OnReadyStateChange()}catch(E){}if(this.readyState==4&&typeof C==="function"){C()
}};if(/MSIE 6/i.test(navigator.userAgent)&&typeof C==="function"){(function(E){if(E.readystate==4){try{H.OnReadyStateChange()
}catch(Q){}C()}else{var O=arguments.callee;setTimeout(function(){O(E)},100)}})(this._g)}}catch(I){this.Debug.Warning("Could not execute HTTP-Request: "+I+" "+I.message)
}}if(this._g){this.StartTime=new Date().getTime();if(J=="GET"){this._g.send(null)}else{this._g.setRequestHeader("Content-type","application/x-www-form-urlencoded");
this._g.setRequestHeader("Content-length",N.length-1);this._g.setRequestHeader("Connection","close");this._g.send(N.substring(1))
}}else{this.Debug.Warning("Falling back to IFRAME");if(!this.IFrame){this.IFrame=document.createElement("iframe");this.IFrame.frameBorder=0;
this.IFrame.style.width=this.IFrame.style.height=1;document.body.appendChild(this.IFrame)}this.StartTime=new Date().getTime();
var B=this._d;window[B]=this;this.IFrame.src=F+"&JSCall=parent."+B+".DataReady";this._g=true}}};CPoiJSServiceClient.prototype.OnReadyStateChange=function(){if(this._g&&(this._g.readyState==4)){if(this._g.responseText!=""){this.DataReady(this._g.responseText);
this.RunningRequests--;if(this.RunningRequests<0){this.RunningRequests=0}}}};CPoiJSServiceClient.prototype.DataReady=function(ResponseStr){var Data=null;
this._g=null;if(this._m){this._m(ResponseStr);return}try{if(!ResponseStr.match(/^\s*$/)){if(ResponseStr.charAt(0)=="D"){try{Data=eval("("+ResponseStr.substring(1)+")")
}catch(E){this.Debug.Error(E+": "+ResponseStr)}}else{if(ResponseStr.charAt(0)=="I"&&ResponseStr.length>=4){this._h--;this.InfoHandler(this._k,ResponseStr.substring(1,4),ResponseStr.substring(4))
}else{if(ResponseStr.charAt(0)=="E"&&ResponseStr.length>=4){this._h++;this.ErrorHandler(this._k,ResponseStr.substring(1,4),ResponseStr.substring(4))
}else{this._h++;this.ErrorHandler(this._k,"500","Invalid Response")}}}}else{}}catch(E){alert(E+":\n"+Data)}if(Data){var LoadTime=new Date().getTime()-this.StartTime;
if((typeof Data=="object")){this._h--;this._l(this._k,Data)}else{this._h++;this.Debug.Error("Data Type: "+typeof Data)}}};
function CResourceManager(A){this._n=A;this._o={}}CResourceManager.prototype.Init=function(A){this._o=A};CResourceManager.prototype.GetString=function(C){try{var B=this._o[this._n+C];
if(B!=undefined){return B}}catch(A){}return this._n+C};CCPUUsage=function(A){this.Lasts=new Array();if(A==null){this.WaitTime=50
}else{this.WaitTime=A}this.Div=null};CCPUUsage.prototype.Init=function(){this.Timer((new Date()).getTime())};CCPUUsage.prototype.Timer=function(A,D){var C=(new Date()).getTime();
Diff=C-A;if(CPUUsage.Lasts.length==10){CPUUsage.Lasts.shift()}CPUUsage.Lasts.push(Diff);setTimeout(function(){CPUUsage.Timer(C,true)
},CPUUsage.WaitTime)};CCPUUsage.prototype.Usage=function(){var C=0;for(var A=0;A<CPUUsage.Lasts.length;A++){C+=CPUUsage.Lasts[A]
}var D=C/CPUUsage.Lasts.length;var B=CPUUsage.WaitTime/D;if(B>1){B=1}return B};CCPUUsage.prototype.Write=function(){if(document.getElementById("CPUUsage")==null){var A=document.createElement("div");
A.id="CPUUsage";A.style.width="150px";A.style.top="0px";A.style.left="0px";A.style.position="absolute";A.style.backgroundColor="#ffffff";
document.body.appendChild(A);CPUUsage.Div=A}if(CPUUsage.Shown){CPUUsage.Div.style.display="block";CPUUsage.Div.innerHTML=Math.round((1-CPUUsage.Usage())*100)+"%<br/>";
setTimeout(CPUUsage.Write,1000)}else{CPUUsage.Div.style.display="none"}};CCPUUsage.prototype.Show=function(){this.Shown=true;
setTimeout(CPUUsage.Write,1000)};CCPUUsage.prototype.Hide=function(){this.Shown=false;CPUUsage.Write()};function CMapOverlay(B,A){this.ID=B;
this.Map=A;this.Visible=true;this._p=false;this.Element=document.createElement("img");this.Element.style.display="none";this.Map.ShowOverlay(this)
}CMapOverlay.prototype.SetSource=function(A){this._p=false;if(A){this.Map.SetImageSource(this.Element,A,this.Map.GetParam("Width"),this.Map.GetParam("Height"));
this.Element.style.visibility="visible"}else{this.Element.src=null;this.Element.style.visibility="hidden"}};CMapOverlay.prototype.Hide=function(){this.Element.style.display="none";
this.Visible=false};CMapOverlay.prototype.Show=function(){this.Element.style.display="block";this.Visible=true;if(this.Layer){this.Layer.Show()
}};CMapOverlay.prototype.Update=function(A){if(!this._p){this._p=true;this.Map.QueueOverlay(this.ID)}};function CMapOverlayManager(A){this.Map=A;
this.Overlays=[]}CMapOverlayManager.prototype.CreateOverlay=function(A){this.Overlays.push(new CMapOverlay(A,this.Map));return this.Overlays[this.Overlays.length-1]
};CMapOverlayManager.prototype.GetOverlay=function(B){for(var A=0;A<this.Overlays.length;A++){if(this.Overlays[A].ID==B){return this.Overlays[A]
}}return null};CMapOverlayManager.prototype.GetVisibleOverlayIds=function(){var A="";for(var B=0;B<this.Overlays.length;B++){if(this.Overlays[B].Visible){if(A!=""){A+=","
}A+=this.Overlays[B].ID}}return A};CMapOverlayManager.prototype.RemoveOverlay=function(C){var D=this.GetOverlay(C);if(D){D.Hide();
var B=-1;for(var A=0;A<this.Overlays.length;A++){if(this.Overlays[A].ID==C){B=A;break}}if(B>-1){this.Overlays.splice(B,1)
}}};CMapOverlayManager.prototype.UpdateOverlays=function(B){for(var A=0;A<this.Overlays.length;A++){if(this.Overlays[A].Visible){this.Overlays[A].Update(B)
}}};function CMapPoiLayer(B,A){this.ID=B;this.Map=A;this.Visible=true;this.PointsClickable=A.GetParam("PoiPointClickable");
this.Clear()}CMapPoiLayer.prototype.Clear=function(){if(this.PoiPoints){var B;for(var A=0;A<this.PoiPoints.length;A++){B=this.PoiPoints[A].h;
if(B){B.Hide(A==(this.PoiPoints.length-1))}}}this.PoiPoints=[];this.PoiDetails=[];this._q=null;this._r=null;this._s=null;
this._t=null;this._p=false};CMapPoiLayer.prototype.EndUpdating=function(){this._p=false};CMapPoiLayer.prototype.IsEmpty=function(){return this.PoiPoints.length==0
};CMapPoiLayer.prototype.UpdatePoiPoints=function(B,C){this.Clear();this.PoiPoints=B;if(this.PoiPoints.length>0){this.PoiDetails=new Array(B.length);
Map.PoiCtr=0;for(var A=0;A<B.length;A++){if(B[A]){if(A==0){this._s=B[A].mx;this._t=B[A].my;this._q=B[A].mx;this._r=B[A].my
}B[A].id=A+1;B[A].layer=this.ID;this.CreatePoiPoint(B[A]);this._q=Math.min(this._q,B[A].mx);this._t=Math.min(this._t,B[A].my);
this._s=Math.max(this._s,B[A].mx);this._r=Math.max(this._r,B[A].my)}}}else{this._q=null;this._r=null;this._s=null;this._t=null
}this._p=false;this.Visible=B.length>=0;if((Map.GetParam("IsNewPoiResult"))&&(this.ID=="Premium"||this.ID=="Standard"||this.ID=="Basis"||this.ID=="Free")){this.Visible=true
}else{if(this.ID=="Default"){this.Visible=true}}};CMapPoiLayer.prototype.UpdatePoiDetails=function(B){var C;for(var A=0;A<B.length;
A++){C=B[A];if(C&&C.id&&!C.mx){this.PoiDetails[C.id-1]=C}}};CMapPoiLayer.prototype.LoadPoiDetails=function(A,C){if(!this._p){if(this.Map.LayerLoadQueue.length==0&&this.Map.PoiClient.IsEnabled()){var B={JSLayerID:this.ID,DataSetIds:C,NewSession:"No",JSPoiDetails:A,PoiDetailMemoFields:this.Map.GetParam("PoiDetailMemoFields"),PoiDetailObjectListItems:this.Map.GetParam("PoiDetailObjectListItems")};
var E=this.Map.GetParam("PoiLayers");var D=E[this.ID];if((D!=null)&&(D.DB)){B.DB=D.DB}else{if(this.Map.GetParam("DetailInfoDB")!=-1){B.DB=this.Map.GetParam("DetailInfoDB")
}}this.Map.PoiClient.InvokeRequest(B)}}};CMapPoiLayer.prototype.Update=function(A){var G=this.Map.GetParam("PoiLayers");var E=G[this.ID];
if(E==null){return}if(!this.Map.GetParam("StartNewGeoSearchOnRectChange")){return}switch(this.ID){case"DefaultPremium":case"DefaultShadow":case"Default":this.Map.QueuePoiLayer("Default");
break}var C=[];var I=false;var D=Map.GetPLM().Layers;for(var B in G){if(G[B].IsDefault=="true"||G[B].IsDefault==true||B=="Basis"||B=="Free"||B=="Standard"||B=="Premium"){var H=false;
for(var F=0;F<D.length;F++){if(B==D[F].ID){C.push(B);if(this.ID==B){I=true}break}}}}if(I){this.Map.QueuePoiLayer(C[0])}else{this.Map.QueuePoiLayer(this.ID)
}};CMapPoiLayer.prototype.PoiPointClick=function(MapPoi,PoiPoint){if(PoiPoint){var Layers=this.Map.GetParam("PoiLayers");
var LayerDef=Layers[this.ID];if(LayerDef==null){return}var OrgAction=LayerDef.PointClickAction;if(OrgAction==""){OrgAction=this.Map.GetParam("PoiPointClickAction")
}var Action="";var Params="";var Idx=OrgAction.indexOf("(");if(Idx>-1){Action=OrgAction.substring(0,Idx);Params=OrgAction.substring(Idx+1);
Params=Params.substring(0,Params.length-1)}else{Action=OrgAction}if(Action==""){Action="OpenDetailInfo"}switch(Action){case"OpenWww":var PoiDetails=this.PoiDetails[PoiPoint.id-1];
if(PoiDetails){this.Map.OpenWww(PoiDetails)}else{this.LoadPoiDetails(PoiPoint.id,PoiPoint.e)}break;case"OpenDetailInfo":this.Map.OpenDetailInfo(PoiPoint.e,LayerDef.DB);
break;case"CallFunction":eval(Params+"(PoiPoint)");break}}};CMapPoiLayer.prototype.CreatePoiPoint=function(A,I){var E=this.Map.GetParam("PoiLayers");
var F=E[this.ID];if(F==null){return}var G=F.PointClickAction;var D=this;function B(L){if(Map.TO!=null){clearTimeout(Map.TO)
}else{if((Map.LastMessageWait!=null)&&(!Map.MessageShown)){Map.ShowMessageWait(Map.LastMessageWait)}}Map.PoiCtr++;var K=L.n;
var N=D.Map.ShowPoi(D,"Poi"+D.ID+K,L,L.prio?L.prio:1);var J=new Object();var M=new Object();if(G&&G=="OpenPopup"){N.OnClickHandler=function(O){O.ShowPopUp()
};N.OnHoverHandler=function(O){D.PoiPointMouseOver(O,L);Map.IsMouseOverPoiPoint=true};N.OnUnhoverHandler=function(O){Map.IsMouseOverPoiPoint=false
}}else{N.OnHoverHandler=function(O){D.PoiPointMouseOver(O,L);Map.IsMouseOverPoiPoint=true};N.OnUnhoverHandler=function(O){D.PoiPointMouseOut(O,L);
Map.IsMouseOverPoiPoint=false};if(D.PointsClickable){N.OnClickHandler=function(O){D.PoiPointClick(O,L)}}}L.h=N;if(typeof(Map.FunctionTableOpenPopUpByCid)=="undefined"||Map.FunctionTableOpenPopUpByCid==null){Map.FunctionTableOpenPopUpByCid=new Object()
}if(typeof(L.cid)!="undefined"&&L.cid!=null&&L.cid!=""){OpenPopUp=function(){N.ShowPopUp()};HidePopUp=function(){N.HidePopUp()
};Map.FunctionTableOpenPopUpByCid[L.cid]=new Object();Map.FunctionTableOpenPopUpByCid[L.cid].Open=function(){N.ShowPopUp()
};Map.FunctionTableOpenPopUpByCid[L.cid].Hide=function(){N.HidePopUp()};Map.FunctionTableOpenPopUpByCid[L.cid].Poi=N}Map.HideMessage()
}var H=(A.i.split(","))[0]==3;var C=A.n;B(A)};function CMapPoiLayerManager(A){this._u=A;this.Layers=[]}CMapPoiLayerManager.prototype.CreateLayer=function(A){this.Layers.push(new CMapPoiLayer(A,this._u));
return this.Layers[this.Layers.length-1]};CMapPoiLayerManager.prototype.GetLayer=function(B){for(var A=0;A<this.Layers.length;
A++){if(this.Layers[A].ID==B){return this.Layers[A]}}return null};CMapPoiLayerManager.prototype.GetVisibleLayerIds=function(){var A="";
for(var B=0;B<this.Layers.length;B++){if(this.Layers[B].ID!=""&&this.Layers[B].Visible){if(A!=""){A+=","}A+=this.Layers[B].ID
}}return A};CMapPoiLayerManager.prototype.RemoveLayer=function(A){var B=this.GetLayer(A);if(B){B.Clear();B.Visible=false}};
CMapPoiLayerManager.prototype.UpdateLayers=function(B){while(Map.LayerLoadQueue.length>0){Map.LayerLoadQueue.pop()}for(var A=0;
A<this.Layers.length;A++){if(this.Layers[A].Visible){if(typeof this.Layers[A].StartNewGeoSearchOnRectChange=="undefined"||this.Layers[A].StartNewGeoSearchOnRectChange!==false){this.Layers[A].Update(B)
}}}};CMapPoiLayerManager.prototype.FindPoiPointsAt=function(A,E,D){var B=[];var G=null;for(var C=0;C<this.Layers.length;C++){G=this.Layers[C];
var F=G.FindPoiPointsAt(A,E,D);if(F){B.push([G,F]);if(B.length>=D){break}}}return B};function CMapStarterQueue(){this.FunctionQueue=[]
}CMapStarterQueue.prototype.Add=function(A){if(typeof Map.Initialised=="undefined"||!Map.Initialised){this.FunctionQueue.push(A)
}else{if(typeof A=="function"){A()}}};CMapStarterQueue.prototype.CallNextFunction=function(){var A=this.FunctionQueue.shift();
if(typeof A=="function"){A()}};CMapStarterQueue.prototype.Start=function(){while(this.FunctionQueue.length>0){this.CallNextFunction()
}};MapStarterQueue=new CMapStarterQueue();function CWaitScreen(A){this._v=null;this._w=A;this._x=0.65;this._y=""}CWaitScreen.prototype.Show=function(){var E=document.getElementById(this._w);
if(this._v==null){var A=document.createElement("div");A.id="WaitScreenDiv";if(A.style.filter!=null){A.style.filter="alpha(opacity=85)"
}else{A.style.opacity=0.85}A.style.display="none";A.style.backgroundColor="Transparent";A.style.position="absolute";A.style.zIndex=2000;
A.style.top=Math.round((E.clientHeight-66)/2)+"px";A.style.left=Math.round((E.clientWidth-66)/2)+"px";A.style.width=E.clientWidth+"px";
A.style.height=E.clientHeight+"px";A.style.padding=E.style.padding;A.style.border=E.style.border;var F=document.createElement("img");
F.src="../../YM/Layout/Images/Map/ajax-wait5.gif";F.style.position="absolute";F.style.top="6px";F.style.left="6px";F.style.width="72px";
F.style.height="72px";this._z=F;A.appendChild(F);E.appendChild(A);this._v=A}this._v.style.width="72px";this._v.style.height="72px";
this._y="Show";var B=this._y;var C=this._v;setTimeout(function(){if(B=="Show"){C.style.display="block"}},1)};CWaitScreen.prototype.SetOpacity=function(A){if(this._v.style.filter!=null){this._v.style.filter="alpha(opacity="+A*100+")"
}else{this._v.style.opacity=A}};CWaitScreen.prototype.Fade=function(A){};CWaitScreen.prototype.Hide=function(){if(this._v!=null){this._y="Hide";
var B=this._y;var A=this._v;setTimeout(function(){if(B=="Hide"){A.style.display="none"}},1)}};WaitScreen=new CWaitScreen("MapControlFrame");
function CMap(){this._aa=6371000;this._ab={};this._ac={Init:[],PoiLayerInit:[],PoiLayerLoaded:[],PoiLayerRemoved:[],MouseMove:[],RenderPoiPopUp:[],InitCultureRes:[],RectChange:[],PoiListLoaded:[],OnStartNewGeoSearch:[],PopUpOpened:[],PopUpClosed:[]};
this._ad=[];this._ae=0;this.LayerLoadQueue=[];this.OverlayLoadQueue=[];this._af=false;this._ag()}CMap.prototype.InitCultureRes=function(A){this.LocRM.Init(A);
this._ah("InitCultureRes")};CMap.prototype.GetParam=function(B,A){var C=(typeof(this._ab[B])=="undefined")?A:this._ab[B];
if(C=="true"||C=="false"){return(C=="true")}return C};CMap.prototype.SetParam=function(A,B){this._ab[A]=B};CMap.prototype.GetPoiPointIcon=function(C){var E=-1;
var B="";var A=(C.i).split(",");E=parseInt(A[0]);if(A.length>1){B=A[1]}if(!E){E=0}var D=this.GetParam("PoiPointIcons")[E];
if(!D.IsNumbered||C.n>0||(isNaN(D.ShadowWidth)||isNaN(D.ShadowHeight))){return D}var F=new Object();F.Url=D.ShadowUrl;F.Width=D.ShadowWidth;
F.Height=D.ShadowHeight;return F};CMap.prototype._ai=function(){var A=this;setTimeout(function(){A.LogGisMapEvents()},1000)
};CMap.prototype.CompleteLogGisMapEvents=function(A,B){this.Debug.Info("CompleteLogGisMapEvents");this._ae=Math.max(this._ae-A.GisMapEvent,0)
};CMap.prototype.LogGisMapEvents=function(){var C=this;try{var B=this._aj();if(typeof this._ak=="undefined"){this._ae=1;this._ak=B
}if(Math.abs(B.Lux-this._ak.Lux)>1||Math.abs(B.Luy-this._ak.Luy)>1||Math.abs(B.Rlx-this._ak.Rlx)>1||Math.abs(B.Rly-this._ak.Rly)>1){this._ae++;
this.Debug.Info("GisMapEventCount: "+this._ae)}this._ak=B;if(this._ae>0&&!this.PoiClient.State()){var A={Action:"LogGisMapEvent",LogGisMapEvent:this._ae,MapControl:this._al,MapStyle:this._am,Partner:Map.GetParam("Partner"),t:(new Date()).getTime(),NewSession:"No"};
this._ae=0;this.PoiClient.InvokeRequest(A,function(D,E){C.CompleteLogGisMapEvents(D,E)})}}finally{setTimeout(function(){C.LogGisMapEvents()
},1000)}};CMap.prototype.UpdateLayers=function(A){this._an.UpdateLayers(A);this._ao.UpdateOverlays(A)};CMap.prototype.QueuePoiLayer=function(B){var A=0;
for(A;A<this.LayerLoadQueue.length;A++){if(this.LayerLoadQueue[A]==B){break}}if(A>=this.LayerLoadQueue.length){this.LayerLoadQueue.push(B);
if(this.LayerLoadQueue.length==1){setTimeout("Map.LoadNextQueuedPoiLayer()",30)}}};CMap.prototype.LoadPoiLayer=function(F,U,Q){if(F.substring(0,7)=="Overlay"){this.LoadOverlay(F.substring(7))
}else{var T=this.GetParam("StartNewGeoSearchOnRectChange");if(U){T=true}var J=this.GetParam("PoiLayers");var D=J[F];if(D==null){return
}if(typeof D.DisableNewGeoSearchOnRectChange!=="undefined"&&(D.DisableNewGeoSearchOnRectChange=="true"||D.DisableNewGeoSearchOnRectChange==true)){var H=this._an.GetLayer(F);
H.EndUpdating();this.OnPoiLayerLoaded(F);return}var I=D.BC;var G=this._aj();var N="Premium";for(var E=0;E<this._an.Layers.length;
E++){var H=this._an.Layers[E];var C=H.ID;if((C=="Premium"||C=="Standard"||C=="Basis"||C=="Free")&&H.PoiPoints.length>0){N=C;
break}}if(I){var A=5000/this._ap(G.Luy);var L=D.DB;var M=D.QT;var V=D.GeoFormatDatabase;if(M==null||M==""||isNaN(M)){M=5}if(V==null||V==""||isNaN(V)){V=2
}var K,B;if(!isNaN(Map.GetParam("StaticLocX"))&&!isNaN(Map.GetParam("StaticLocY"))){K=Map.GetParam("StaticLocX");B=Map.GetParam("StaticLocY")
}else{K=Math.round((G.Lux+G.Rlx)/2);B=Math.round((G.Luy+G.Rly)/2)}this.ShowMessageWait(this.LocRM.GetString("LoadingLayerMessage").replace("{0}",D.Description));
var O={JSLayerID:F,MapLayerIds:this._an.GetVisibleLayerIds()+","+F,PreserveSessionExceptParas:"MapLayerIds",BC:I,Lux:Math.round(G.Lux),Luy:Math.round(G.Luy),Rlx:Math.round(G.Rlx),Rly:Math.round(G.Rly),LocX:K,LocY:B,GeoFormatIn:3,MapImageWidth:this.GetParam("Width"),MapImageHeight:this.GetParam("Height"),Partner:Map.GetParam("Partner"),QT:M,StaticRectSearch:"true",GeoSearch:0,CityGuideView:4,GeoFormatDatabase:V};
if(L){O.DB=L}if(Map.GetParam("ListLastSortBy")!=null){O.SortBy=Map.GetParam("ListLastSortBy")}this.PoiClient.InvokeRequest(O)
}else{if((F=="Default"||(F=="Premium"||F=="Standard"||F=="Basis"||F=="Free"))&&T){var R=this.GetParam("UpdatePoiList",1);
var M=D.QT;var V=D.GeoFormatDatabase;if(M==null||M==""||isNaN(M)){M=5}if(V==null||V==""||isNaN(V)){V=2}var K,B;if(!isNaN(Map.GetParam("StaticLocX"))&&!isNaN(Map.GetParam("StaticLocY"))){K=Map.GetParam("StaticLocX");
B=Map.GetParam("StaticLocY")}else{K=Math.round((G.Lux+G.Rlx)/2);B=Math.round((G.Luy+G.Rly)/2)}this._ah("OnStartNewGeoSearch");
this.ShowMessageWait(this.LocRM.GetString("NewGeoSearchMessage"));var O={Action:"QueryDefault",UpdatePoiListHTML:R,NewSession:"No",Lux:Math.round(G.Lux),Luy:Math.round(G.Luy),Rlx:Math.round(G.Rlx),Rly:Math.round(G.Rly),LocX:K,LocY:B,MapX:Math.round((G.Rlx+G.Lux)/2),MapY:Math.round((G.Rly+G.Luy)/2),GeoFormatIn:3,MapImageWidth:this.GetParam("Width"),MapImageHeight:this.GetParam("Height"),QT:M,StaticRectSearch:"true",BirdsEyeMode:(typeof Map.GetMap=="function"&&typeof Map.GetMap().GetMapStyle=="function"&&Map.GetMap().GetMapStyle()=="b")?"true":"false",ClearGroups:"GeoMap,Paging",Partner:Map.GetParam("Partner"),ClearParas:"WhereCondition,Loc",GeoFormatDatabase:V};
if(U!=null&&!isNaN(U)){O.Page=U}if(Q!=null&&!isNaN(Q)){O.SortBy=Q;Map.SetParam("ListLastSortBy",Q)}else{if(Map.GetParam("ListLastSortBy")!=null){O.SortBy=Map.GetParam("ListLastSortBy")
}}if(this._ae>0){O["LogGisMapEvent"]=this._ae;O["MapControl"]=this._al;O["MapStyle"]=this._am;this._ae=0}this.PoiClient.InvokeRequest(O)
}else{var H=this._an.GetLayer(F);H.EndUpdating();this.OnPoiLayerLoaded(F)}}}};CMap.prototype.RemovePoiLayer=function(B){if(B.substring(0,7)=="Overlay"){this._an.RemoveLayer(B);
this.RemoveOverlay(B.substring(7))}else{this._an.RemoveLayer(B);for(var A=0;A<this.LayerLoadQueue.length;A++){if(this.LayerLoadQueue[A]==B){this.LayerLoadQueue.splice(A,1);
break}}this.PoiClient.InvokeRequest({MapLayerIds:this._an.GetVisibleLayerIds(),PreserveSessionExceptParas:"MapLayerIds",Partner:Map.GetParam("Partner"),Action:"UpdateUserSessionValues"});
this.HideMessage()}};CMap.prototype.RemovePoiLayers=function(){};CMap.prototype.QueueOverlay=function(A){this.OverlayLoadQueue.push(A);
if(this.LayerLoadQueue.length==0&&this.OverlayLoadQueue.length==1){setTimeout("Map.LoadNextQueuedOverlay()",100)}};CMap.prototype.LoadOverlay=function(A){var C=this._aj();
var B={Action:"GenerateOverlay",OverlayID:A,MapOverlays:A,PreserveSessionExceptParas:"MapOverlays",Lux:Math.round(C.Lux),Luy:Math.round(C.Luy),Rlx:Math.round(C.Rlx),Rly:Math.round(C.Rly),MapImageWidth:this.GetParam("Width"),MapImageHeight:this.GetParam("Height"),NoParam:"noop",Partner:Map.GetParam("Partner"),GeoFormatIn:3};
var D="";if(typeof Map.GetParam("PoiLayers")[A]!=="undefined"&&typeof Map.GetParam("PoiLayers")[A].Description!=="undefined"){D=Map.GetParam("PoiLayers")[A].Description
}this.ShowMessageWait(this.LocRM.GetString("LoadingLayerMessage").replace("{0}",D));this.PoiClient.InvokeRequest(B)};CMap.prototype.RemoveOverlay=function(B){this._ao.RemoveOverlay(B);
for(var A=0;A<this.OverlayLoadQueue.length;A++){if(this.OverlayLoadQueue[A]==B){this.OverlayLoadQueue.splice(A,1);break}}this.PoiClient.InvokeRequest({MapOverlays:this._ao.GetVisibleOverlayIds(),PreserveSessionExceptParas:"MapOverlays",Partner:Map.GetParam("Partner"),Action:"UpdateUserSessionValues"});
this.HideMessage()};CMap.prototype._ap=function(A){return(Math.cos(2*(Math.atan(Math.exp(A/this._aa))-Math.PI/4)))};CMap.prototype._aq=function(B,C){for(var A=0;
A<B.length;A++){if(B[A]){B[A].i=C+","+B[A].i}}};CMap.prototype.HasDefaultLayer=function(){var A=this._an.GetLayer("Default");
return A?true:false};CMap.prototype.PoiDataHandler=function(K,A){if(A.length>=0){if(K.Action=="GenerateOverlay"){var E=K.OverlayID;
var D=this._ao.GetOverlay(E);if(!D){D=this._ao.CreateOverlay(E)}D.SetSource(A[0].ImageUrl);D.Show();this._ar.Update();var I=this.GetParam("PoiLayers");
var B="Overlay"+E;var J=I["Overlay"+E];if(J==null){return}var F=this._an.GetLayer(B);if(!F){F=this._an.CreateLayer(B)}F.PointsClickable=false;
A.shift();var L=[];for(var G=0;G<A.length;G++){if(A[G]&&A[G].mx){L.push(A[G])}}this._aq(L,J.Icon);F.UpdatePoiPoints(L,K);
F.UpdatePoiDetails(A);this.HideMessage();this.OnPoiLayerLoaded(F.ID)}else{if(K.Action=="QueryDefault"){var H={};for(var G=0;
G<A.length;G++){if(A[G]){if(A[G].mx){var B=A[G].l?A[G].l:"Default";if(!H[B]){H[B]=[]}H[B].push(A[G])}else{if(A[G]["Class"]&&A[G]["Class"]=="PoiListHTML"){if(A.length==1){this.HideMessage()
}var C=document.getElementById(this.GetParam("PoiListContainerElement"));if(C){C.innerHTML=A[G].Content;this._ah("PoiListLoaded")
}}}}}var I=this.GetParam("PoiLayers");for(var B in H){var J=I[B];if(J==null){return}var F=this._an.GetLayer(B);if(!F){F=this._an.CreateLayer(B)
}this._aq(H[B],J.Icon);F.UpdatePoiPoints(H[B],K);this.OnPoiLayerLoaded(F.ID)}this.HideMessage()}else{if(typeof K.JSLayerID==="undefined"){Map.LoadNextQueuedPoiLayer()
}var B=K.JSLayerID;var I=this.GetParam("PoiLayers");var J=I[B];if(J){var F=this._an.GetLayer(B);if(!F){F=this._an.CreateLayer(B)
}var L=[];for(var G=0;G<A.length;G++){if(A[G]&&A[G].mx){L.push(A[G])}}if(L.length>0){this._aq(L,J.Icon);F.UpdatePoiPoints(L,K)
}F.UpdatePoiDetails(A);this.HideMessage();this.OnPoiLayerLoaded(F.ID)}else{this.Debug.Error('PoiDataHandler(): No Layer definition for "'+B+'".');
this.HideMessage()}}}}else{this.HideMessage();var I=this.GetParam("PoiLayers");var B="Overlay"+E;var J=I["Overlay"+E];if(J==null){return
}var F=this._an.GetLayer(B);this.OnPoiLayerLoaded(F.ID)}};CMap.prototype.PoiInfoHandler=function(H,I,A){var D=A;var C="301";
if(I==C){var B=H.JSLayerID;var G=this.GetParam("PoiLayers");var F=G[B];if(F==null){return}if((F)&&(F.BC)){var E=this._an.GetLayer(B);
if(!E){E=this._an.CreateLayer(B)}if((F)&&(F.BC)){D=this.LocRM.GetString("NoAddressFound").replace("{0}",F.Description)}else{D=""
}E.Clear();this.OnPoiLayerLoaded(B)}}this.ShowMessage(D)};CMap.prototype.PoiErrorHandler=function(A,C,B){this.HideMessage()
};CMap.prototype.LoadNextQueuedPoiLayer=function(){if(this.LayerLoadQueue.length>0){if(this.PoiClient.IsEnabled()){var A=this.LayerLoadQueue[0];
this.LayerLoadQueue.shift();this.LoadPoiLayer(A)}else{clearTimeout(this._as);this._as=setTimeout(Map.LoadNextQueuedPoiLayer,10)
}}else{this.LoadNextQueuedOverlay()}};CMap.prototype.LoadNextQueuedOverlay=function(){if(this.OverlayLoadQueue.length>0){if(this.PoiClient.IsEnabled()){var A=this.OverlayLoadQueue[0];
this.OverlayLoadQueue.shift();this.LoadOverlay(A)}else{setTimeout("Map.LoadNextQueuedOverlay()",100)}}};CMap.prototype.OnPoiLayerLoaded=function(A){this._ah("PoiLayerLoaded",A);
this.LoadNextQueuedPoiLayer()};CMap.prototype.RegisterCallback=function(B,A){if(this._ac[B]){this._ac[B].push(A)}};CMap.prototype._ah=function(F,A,C,E){if(typeof this._ac[F]!=="undefined"){for(var B=0;
B<this._ac[F].length;B++){try{this._ac[F][B](A,C,E)}catch(D){}}}};CMap.prototype.Callback=function(D,A,B,C){this._ah(D,A,B,C)
};CMap.prototype.FindPoiPointsAt=function(B,G,C){var H=[];var A=this._an.FindPoiPointsAt(B,G,C);for(var F=0;F<A.length;F++){var D=A[F][0];
for(var E=0;E<A[F][1].length;E++){H.push([D,A[F][1][E]])}}return H};CMap.prototype.OpenDetailInfo=function(C,B){var A=this.GetParam("DetailInfoBaseLink")+"&Ebinr="+C;
if(B){A+="&DB="+encodeURIComponent(B)}if(this.GetParam("OpenDetailInfoInNewWindow")){return OpenWindow(A,800,600)}else{document.location.href=A;
return true}};CMap.prototype.OpenDetailInfo=function(C,B,D){var A=this.GetParam("DetailInfoBaseLink")+"&Ebinr="+C;if(B){A+="&DB="+encodeURIComponent(B)
}if(D){A+="&DetailInfoView="+encodeURIComponent(D)}if(this.GetParam("OpenDetailInfoInNewWindow")){return OpenWindow(A,800,600)
}else{document.location.href=A;return true}};CMap.prototype.OpenDetailInfo=function(D,B,E,F,C){var A=this.GetParam("DetailInfoBaseLink")+"&Ebinr="+D;
if(B){A+="&DB="+encodeURIComponent(B)}if(E){A+="&DetailInfoView="+encodeURIComponent(E)}if(this.GetParam("OpenDetailInfoInNewWindow")){return OpenWindow(A,F,C)
}else{document.location.href=A;return true}};CMap.prototype.OpenWww=function(B){var A=B.w;if(A){if(this.GetParam("OpenDetailInfoInNewWindow")){return OpenWindow(A,800,600)
}else{document.location.href=A;return true}}};CMap.prototype.ShowModule=function(A){var B=document.getElementById("MapPoiForm");
if(B){B.style.display="none"}B=document.getElementById("MapControlPanel");if(B){B.style.display="none"}B=document.getElementById("MapInfo");
if(B){B.style.display="none"}B=document.getElementById("Map"+A);if(B){B.style.display="block"}};CMap.prototype.GetPLM=function(){return this._an
};CMap.prototype.LoadPage=function(D,A){var G=this._an;var F;if(Map.GetParam("IsNewPoiResult")){F=["Premium","Standard","Basis","Free"]
}else{F=["Default","DefaultPremium"]}var C=false;for(var B=0;B<G.Layers.length;B++){var E=G.Layers[B].ID;if(F.join().indexOf(E)<0||!C){if(F.join().indexOf(E)>=0){C=true
}Map.LoadPoiLayer(E,D,A)}}return false};CMap.prototype.HighlightPoiPoint=function(E){var F;for(var D=0;D<this._an.Layers.length;
D++){F=this._an.Layers[D];for(var A=0;A<F.PoiPoints.length;A++){var C=F.PoiPoints[A];if(C.n==E){var B=C.h;if(B){this._at=B;
B.Highlight()}return}}}};CMap.prototype.RegisterPopUp=function(A){this._ad.push(A)};CMap.prototype.OnRenderPoiPopUp=function(A,B,C){this._ah("RenderPoiPopUp",A,B,C)
};CMap.prototype.HidePoiPopUp=function(C){for(var A=0;A<this._ad.length;A++){var B=this._ad[A];if(B){if(typeof C!=="function"||C==null){B.Hide()
}else{B.RealHide();if(this.PoiClient.LastRequestData!=null&&typeof this.PoiClient.LastRequestData.JSPoiDetails!=="undefined"){this.PoiClient.AbortRequest()
}}}}if(typeof C==="function"){C()}};CMap.prototype.GetCurrentMapRect=function(){return this._aj()};CMap.prototype.IsDrawMode=function(){return this._af
};CMap.prototype.GetVisibleLayers=function(){var C=this._an.Layers;var A=new Array();for(var B=0;B<C.length;B++){if(C[B].Visible){A.push(C[B].ID)
}}return A};CMap.prototype.CreatePopup=function(H,a){var L=H;var k=a.PoiDetails;var M=a.PoiPoint;if(typeof k.popup!="undefined"&&k.popup!=null){L.innerHTML=k.popup;
if(this.GetParam("IsNewPoiResult")){L.className="PopUp2008"}else{L.className="PoiPopUp"}var Z=L.getElementsByTagName("span");
for(var K=0;K<Z.length;K++){if(Z[K]!=null&&(typeof Z[K].className!="undefined")&&Z[K].className=="CloseLayer"){var d=Z[K].getElementsByTagName("a")[0];
var l=a;if(d!=null){d.id=(new Date()).getTime();d.onclick=function(A){l.RealHide();A=A?A:window.event;A.cancelBubble=true;
A.returnValue=false;return false}}break}}var g=L.getElementsByTagName("div");for(var K=0;K<g.length;K++){if(g[K]!=null&&g[K].className=="Images"){var Q=g[K].getElementsByTagName("img");
for(var f=0;f<Q.length;f++){if(Q[f]!=null&&Q[f].parentNode!=null&&Q[f].parentNode.href!=null&&Q[f].parentNode.href.indexOf("OpenDetailInfo")>-1){var T=this.GetParam("PoiLayers");
var J=T[M.layer];Q[f].onclick=function(){Map.OpenDetailInfo(M.e,(J.DB?","+J.DB:""));return false};Q[f].style.cursor="pointer";
Q[f].style.cursor="hand";Q[f].title=this.LocRM.GetString("Link_DetailInfo_Title");Q[f].alt=this.LocRM.GetString("Link_DetailInfo_Title")
}}}}}else{var h=document.createElement("h4");if(k.t){h.innerHTML=k.t;L.appendChild(h)}var N=document.createElement("address");
if(k.a){N.innerHTML=k.a;L.appendChild(N)}var F=k.p;var e=k.w;if(F){var B=document.createElement("div");B.className="Telecom";
B.innerHTML=F;L.appendChild(B)}var W=document.createElement("ul");W.className="Links";var I=this.LocRM.GetString("Link_DetailInfo");
var b="";if(M.a=="230"){I=this.LocRM.GetString("Link_DetailInfoBooking");b='style="color:#f00"'}var T=this.GetParam("PoiLayers");
var J=T[M.layer];if(M.e||e){if(M.e){W.innerHTML='<li id="PopUpDetailLink"><a href="javascript:Map.OpenDetailInfo(\''+M.e+"'"+(J.DB?",'"+J.DB+"'":"")+')" title="'+this.LocRM.GetString("Link_DetailInfo_Title")+'" '+b+">"+I+"</a></li>"
}if(e){W.innerHTML+='<li id="PopUpWwwLink"><a href="'+e+'" target="_blank">'+this.LocRM.GetString("Link_Homepage")+"</a>"
}L.appendChild(W)}var V=k.it;var c;if(V){c=document.createElement("div");c.className="InfoText";c.innerHTML=V;L.appendChild(c)
}var X=k.mf_OPENING_HOURS_Title;var E=k.mf_OPENING_HOURS_Text;if(X){var Y=document.createElement("div");Y.className="MemoFieldTitle";
Y.innerHTML=X;L.appendChild(Y)}if(E){var G=document.createElement("div");G.className="MemoFieldText";G.innerHTML=E;L.appendChild(G)
}var O=k.i;if(O&&O.indexOf(".")>-1){var Q=document.createElement("div");Q.className="Images";var D=document.createElement("img");
D.src=O;if(k.il&&k.il.indexOf("http://")==0){var U=k.il;D.onclick=function(){OpenWindow(U,800,600)};D.style.cursor="pointer"
}Q.appendChild(D);if(this.ClassName=="LocalNewsYM"){D.className="Images";c.insertBefore(D,c.firstChild)}else{L.appendChild(Q)
}}var R=k.pd;var C;if(R){C=document.createElement("div");C.innerHTML=k.pd;L.appendChild(C)}}};function ShowMapHelpPopUp(){document.getElementById("MapHelpPopUp").style.display="block"
}function HideMapHelpPopUp(){document.getElementById("MapHelpPopUp").style.display="none"}function Highlight(A,B,C){document.getElementById(A).src=Map.GetParam("ImagePath")+B+"Highlighted."+C
}function UnHighlight(A,B,C){document.getElementById(A).src=Map.GetParam("ImagePath")+B+"."+C}function HighlightPoiPoint(C,A,B){if(Map){Map.HighlightPoiPoint(C)
}}function ShowPoiPopUp(B,A){if(Map){Map.ShowPoiPopUp(B,A)}}function HidePoiPopUp(){if(Map){Map.HidePoiPopUp()}}function UnHighlightPoiPoint(){if(Map){Map.UnHighlightPoiPoint()
}}function CMapPopUp(A,B,C,D){this._u=A;if(B!=null&&C!=null&&D!=null){this._au(B,C,D);this._av="poi"}else{if(C!=null&&typeof C.popup!="undefined"&&C.popup!=null){this._aw(C.popup);
this._av="cluster";this.MapPoi=D}}}CMapPopUp.prototype._au=function(B,H,D){this._ax=B;this.PoiDetails=H;this.MapPoi=D;this.Visibile=false;
this.MouseOver=false;this.CurrentOpacity=0;this.TargetOpacity=100;this.ClassName="PoiPopUp";if(B!=null&&B.layer!=null&&B.layer.indexOf("OverlayLocalNews")>=0){var E=["LocalNewsPL","LocalNewsVM","LocalNewsWI","LocalNewsKU","LocalNewsSP","LocalNewsCustom"];
var J;for(J=0;J<E.length;J++){if(E[J]==B.layer.substring(7)){break}}if(J<E.length){this.ClassName="LocalNewsYM"}}this.Element=document.createElement("div");
this.Element.className=this.ClassName;this.Element.style.position="absolute";this.Element.style.visibility="hidden";var I=this;
this._ay();var F=document.getElementById(this._u.GetParam("MapElement"));F.appendChild(this.Element);this._u.OnRenderPoiPopUp(this.Element,this._ax,this.PoiDetails);
this.Width=this.Element.offsetWidth;this.Height=this.Element.offsetHeight;var M=Map.GetParam("PoiLayers");var K=M[this._ax.layer];
var L=K.PointClickAction;if(L==null||L!="OpenPopup"){this.Element.onmouseover=function(){I.MouseOver=true;I.Show();I.MapPoi.Highlight()
};this.Element.onmouseout=function(){I.MouseOver=false;I.Hide(true)}}if(L&&L=="OpenPopup"&&this.ClassName=="LocalNewsYM"){var G=document.createElement("button");
var A="../../YM/Layout/Images/Map/ClosePopup.gif";var C=document.createElement("img");C.src=A;C.onclick=function(){I.Hide()
};C.style.position="absolute";C.style.left=this.Element.offsetWidth-17+"px";C.style.top=5+"px";C.style.width="12px";C.style.height="12px";
C.style.zIndex=2000;this.Element.appendChild(C)}this.Element.PopupObj=this};CMapPopUp.prototype._aw=function(C){this._ax=null;
this.Visibile=false;this.MouseOver=false;this.CurrentOpacity=0;this.TargetOpacity=100;this.ClassName="PoiPopUp";this.Element=document.createElement("div");
this.Element.className=this.ClassName;this.Element.style.position="absolute";this.Element.style.visibility="hidden";var B=this;
this._az();var A=document.getElementById(this._u.GetParam("MapElement"));A.appendChild(this.Element);this.Width=this.Element.offsetWidth;
this.Height=this.Element.offsetHeight;if(typeof C=="string"){this.Element.innerHTML=C}else{this.Element.appendChild(C)}this.Element.onmouseover=function(){B.MouseOver=true;
B.MapPoi.Highlight()};this.Element.onmouseout=function(){B.MouseOver=false;B.Hide(true)}};CMapPopUp.prototype._ay=function(){this.PoiPoint=this._ax;
this._u.CreatePopup(this.Element,this);this._ba()};CMapPopUp.prototype._az=function(){var A=this.Element;A.className="ClusterPopup";
this._ba()};CMapPopUp.prototype._bb=function(E){if(!Map.GetParam("IsNewPoiResult")){this.Width=this.Element.offsetWidth;this.Height=this.Element.offsetHeight;
var L={X:0,Y:0};var F;if(E==null&&(this._ax!=null||typeof this._ax!="undefined")){F=this._u.GetPoiPointIcon(this._ax)}else{if(E==null&&(this._ax!=null||typeof this._ax!="undefined")){F={Width:20,Height:20}
}else{F=E}}var H=this._u.GetParam("PopUpOffsetIconFactor");var C=this._u.GetParam("PopUpOffsetX");var D=this._u.GetParam("PopUpOffsetY");
var J=this._u.GetParam("PopUpPositionHoriz",null);if((!J&&this.RealX>this._u.GetParam("Width")-this.Width-C-(F.Width*H))||(J=="left")){L.X=this.RealX-(F.Width*H)-C-this.Width
}else{L.X=this.RealX+(F.Width*H)+C}if((this.RealY>this.Height+D+(F.Height*H)||(this._u.GetParam("PopUpPositionVert")=="top"))&&this._u.GetParam("PopUpPositionVert")!="bottom"){L.Y=this.RealY-D-(F.Height*H)-this.Height
}else{if((this._u.GetParam("Height")-this.RealY>this.Height+D+(F.Height*H))||this._u.GetParam("PopUpPositionVert")=="bottom"){L.Y=this.RealY+D+(F.Height*H)
}else{L.Y=0}}return L}else{var L={};var F;this.Width=this.Element.offsetWidth;this.Height=this.Element.offsetHeight;if((typeof E==="undefined"||E==null)&&(typeof this._ax!="undefined"&&this._ax!=null)){F=this._u.GetPoiPointIcon(this._ax)
}else{F=E}var G=Map.GetParam("Width");var N=Map.GetParam("Height");var J=Map.GetParam("PopUpPositionHoriz","");var I=Map.GetParam("PopUpPositionVert","");
var K,B;if(this._av=="poi"&&this.Element.className.indexOf("PopUp2008")>=0){K=Map.GetParam("PopUpLeftClass","");B=Map.GetParam("PopUpRightClass","")
}else{if(this._av=="cluster"){K=Map.GetParam("ClusterPopUpLeftClass","");B=Map.GetParam("ClusterPopUpRightClass","")}}var M=new RegExp("\\b("+K+")\\b","ig");
var A=new RegExp("\\b("+B+")\\b","ig");if(((this.RealX>this.Width+F.Width/2||G-this.RealX>this.Width+F.Width/2)&&(this.RealY>this.Height/2&&N-this.RealY>this.Height/2))||(J=="right"||J=="left"||J=="auto")){if((J=="left")||(this.RealX>G-this.RealX&&(!J||J=="auto"))){L.X=this.RealX-this.Width-F.Width/2;
L.Y=this.RealY-this.Height/2;if(this.Element.className.match(A)){this.Element.className=this.Element.className.replace(A,K)
}else{if(!this.Element.className.match(M)){this.Element.className+=" "+K}}}else{L.X=this.RealX+F.Width/2;L.Y=this.RealY-this.Height/2;
if(this.Element.className.match(M)){this.Element.className=this.Element.className.replace(M,B)}else{if(!this.Element.className.match(A)){this.Element.className+=" "+B
}}}}else{if((this.RealY>this.Height+F.Height/2||N-this.RealY>this.Height+F.Height/2)&&(this.RealX>this.Width/2&&G-this.RealX>this.Width/2)){if(this.RealY>N-this.RealY||I=="top"){L.X=this.RealX-this.Width/2;
L.Y=this.RealY-this.Height-F.Height/2}else{L.X=this.RealX-this.Width/2;L.Y=this.RealY+F.Height/2}}else{if(this.RealX>G-this.RealX){L.X=this.RealX-this.Width-F.Width/2
}else{L.X=this.RealX+F.Width/2}if(this.RealY>N-this.RealY){L.Y=this.RealY-this.Height-F.Height/2}else{L.Y=this.RealY+F.Height/2
}}}if(J!="left"&&J!="right"&&I!="top"&&I!="bottom"){if(L.X<0){L.X=0}if(L.X+this.Width>G){L.X=G-this.Width}if(L.Y<0){L.Y=0
}if(L.Y+this.Height>N){L.Y=N-this.Height}}if(Map.GetParam("VEController")){if(L.Y<28&&L.X<445){L.Y=28}if(L.X<30&&L.Y<140){L.X=30
}if(L.X<64&&L.Y<64){L.X=64;L.Y=64}}return L}};CMapPopUp.prototype.RealHide=function(){this.Visible=false;clearTimeout(this._bc);
this.Fade();if(this.MapPoi!=null&&typeof this.MapPoi.UnHighlight=="function"){this.MapPoi.UnHighlight()}if(typeof this.OnHide=="function"){this.OnHide()
}if(this._ax!=null){this._u.Callback("PopUpClosed",this._ax.n,this._ax.layer)}};CMapPopUp.prototype.Hide=function(C){if(!this.MouseOver){if(C){clearTimeout(this._bd);
var B=this;var A=function(){B.Hide()};this._bd=setTimeout(A,500)}else{this.RealHide()}}};CMapPopUp.prototype.Show=function(G,C){if(this._u.IsZoomBoxActive){this.RealHide();
return}var B=this;this.Visible=true;clearTimeout(this._bd);var F;if(G==null&&this._ax!=null){F=this._u.Mercator2Pixel({X:this._ax.mx,Y:this._ax.my})
}else{F=G}this.RealX=F.X;this.RealY=F.Y;var A=this._bb(C);this.Element.style.left=Math.round(A.X)+"px";this.Element.style.top=Math.round(A.Y)+"px";
if(this.Element){this.Element.style.visibility="visible"}if(this.CurrentOpacity<this.TargetOpacity){clearTimeout(this._bc);
this.Appear()}if(this._ax!=null){this._u.Callback("PopUpOpened",this._ax.n,this._ax.layer)}if(this._av=="cluster"){this._u.Callback("PopUpOpened","-1","cluster")
}var D=this.Element.getElementsByTagName("img");if(D.length>0){var B=this;var H=B._GetPopUpCoordinates;for(var E=0;E<D.length;
E++){D[E].onload=function(){if(B.Visible){B.Show(G,C)}}}}};CMapPopUp.prototype._ba=function(){if(this.Element&&Map.GetParam("PopUpFade")!=false){this._u.SetElementOpacity(this.Element,this.CurrentOpacity/100)
}else{if(this.CurrentOpacity>=1){this.Element.style.visibility="visible"}else{this.Element.style.visibility="hidden"}}};CMapPopUp.prototype.Appear=function(){var A=this;
if(this.CurrentOpacity<this.TargetOpacity){this.CurrentOpacity=this.CurrentOpacity+30;this._ba();this._bc=setTimeout(function(){A.Appear()
},10)}else{if(this.CurrentOpacity>this.TargetOpacity){this.CurrentOpacity=this.TargetOpacity;this._ba()}}};CMapPopUp.prototype.Fade=function(){var A=this;
if(this.CurrentOpacity>0){this.CurrentOpacity=this.CurrentOpacity-20;this._ba();this._bc=setTimeout(function(){A.Fade()},20)
}else{if(this.CurrentOpacity<=0){this.CurrentOpacity=0;this._ba();if(this.Element){this.Element.style.visibility="hidden"
}}}};function CMapPoi(B,C,A){this._ax=C;this._be=B;this._u=B.Map;this._bf=A;this._bg=null;this._bh=null;this._bi=C.mx;this._bj=C.my;
if(Map.ShapeRegister){this._bf.ResultNumber=this._ax.n;this._bf.LayerID=this._be.ID;Map.ShapeRegister.push(this._bf)}}CMapPoi.prototype.Redraw=function(A){if(A==null){A=Map.GetZIndexForPoi(this._bf.LayerID,this._bf.ResultNumber)
}this._bf.SetZIndex(A,A);this._bf.Redraw(true,true,true,true)};CMapPoi.prototype.Hide=function(A){if(this._bf){Map.ShapeManager.HideShape(this._bf,A)
}};CMapPoi.prototype.Highlight=function(){if(this._bf.YMExtension.HighlightID){var A=document.getElementById(this._bf.YMExtension.HighlightID);
if(A&&A.style){A.style.visibility="visible";this.Highlighted=true}}};CMapPoi.prototype.UnHighlight=function(){var A=this;
if(Map.GetParam("HighlightOpenPopups")&&this._bh&&this._bh.Visible){setTimeout(function(){A.UnHighlight()},100);return}if(this._bf.YMExtension.HighlightID){var B=document.getElementById(this._bf.YMExtension.HighlightID);
if(B&&B.style){B.style.visibility="hidden";this.Highlighted=false}}};CMapPoi.prototype.HoverHandler=function(){var C=Map.GetParam("PoiLayers");
var B=C[this._ax.layer];var A=B.PointClickAction;if(!Map.GetParam("HighlightOpenPopups")){this.Highlight()}if(A==null||A!="OpenPopup"){this.ShowPopUp()
}this.OnHoverHandler(this)};CMapPoi.prototype.UnhoverHandler=function(){var C=Map.GetParam("PoiLayers");var B=C[this._ax.layer];
var A=B.PointClickAction;if(!Map.GetParam("HighlightOpenPopups")){this.UnHighlight()}if(A==null||A!="OpenPopup"){this.HidePopUp(true)
}this.OnUnhoverHandler(this)};CMapPoi.prototype.ClickHandler=function(){if(!Map.GetParam("MapIconLinkActive",true)){return false
}if(this.OnClickHandler){this.OnClickHandler(this)}};CMapPoi.prototype.ShowPopUp=function(C){if(this._bh&&this._bh.CurrentOpacity>0){return
}if(this._bg){clearTimeout(this._bg);this._bg=null}var B=this._be.PoiDetails[this._ax.id-1];if(!this._bh){if(B){this._bh=new CMapPopUp(this._u,this._ax,B,this);
this._u.RegisterPopUp(this._bh)}else{var A=this;this._bg=setTimeout(function(){A.ShowPopUp(C)},1)}}if(this._bh){this._bh.Show();
if(!this.Highlighted){this.Highlight()}if(typeof C!="undefined"){C(this._bh)}}};CMapPoi.prototype.HidePopUp=function(A){if(this._bg){clearTimeout(this._bg);
this._bg=null}this.UnHighlight();if(this._bh){this._bh.Hide(A)}};CMapPoi.prototype.CenterMap=function(B,A,F){var C=Map.GetCurrentRect();
var D,E;if(B&&!isNaN(B)){D=((C.Rlx-C.Lux)/100)*B}else{D=0}if(A&&!isNaN(A)){E=((C.Luy-C.Rly)/100)*A}else{E=0}Map.SetCenter(this._bi-D,this._bj-E,F)
};function CMapOverlaysLayer(B,A){this.Element=document.createElement("div");this.Element.style.position="absolute";this.Element.style.left="0px";
this.Element.style.top="0px";this.Element.style.width=B+"px";this.Element.style.height=A+"px";this.Element.style.zIndex=200
}CMapOverlaysLayer.prototype.Show=function(){this.Element.style.display="block"};CMapOverlaysLayer.prototype.Hide=function(){this.Element.style.display="none"
};CMapOverlaysLayer.prototype.Update=function(){var A=document.getElementById("VirtualEarthMapContainer");this.Element.style.top=(-1*A.firstChild.offsetTop)+"px";
this.Element.style.left=(-1*A.firstChild.offsetLeft)+"px"};CMapOverlaysLayer.prototype.AddOverlay=function(A){A.Element.style.position="absolute";
this.Element.appendChild(A.Element);A.Layer=this};function CMapMessageLayer(){this._bk=true;this.Element=document.createElement("div");
this.Element.style.position="absolute";this.Element.className="MapMessage";this.Element.style.position="absolute";this.Element.style.left="80px";
this.Element.style.top="50px";this.Element.style.zIndex="5000";this.Element.style.backgroundColor="#ffffff";this.Element.style.border="1px solid #333333";
this.Element.style.position="absolute";this.Element.style.padding="3px 10px 3px 10px";if(typeof this.Element.style.filter!="undefined"){this.Element.style.filter="alpha(opacity=80)"
}else{this.Element.style.opacity=0.8}this.Element.style.display="none"}CMapMessageLayer.prototype.SetText=function(A){this.Element.innerHTML=A
};CMapMessageLayer.prototype.Show=function(){if(this._bk){this.Element.style.display="block"}};CMapMessageLayer.prototype.Hide=function(A){if(A){this._bk=false
}this.Element.style.display="none"};function CMapToolbar(){this._bl=2;AreaDiv=document.createElement("div");AreaDiv.style.position="absolute";
AreaDiv.style.left="10px";AreaDiv.style.top="10px";AreaDiv.style.border="1px solid gray";AreaDiv.style.backgroundColor="#fff";
AreaDiv.style.width="63px";AreaDiv.style.height="21px";AreaDiv.style.zIndex=30000;AreaDiv.className="MapControllerToolbar";
Map.SetElementOpacity(AreaDiv,Map.GetParam("ToolbarInitialOpacity"));AreaDiv.onmouseover=function(){Map.SetElementOpacity(this,Map.GetParam("ToolbarActiveOpacity"))
};AreaDiv.onmouseout=function(){Map.SetElementOpacity(this,Map.GetParam("ToolbarInactiveOpacity"))};this.Element=AreaDiv;
mButtonDiv=document.createElement("div");mButtonDiv.style.position="absolute";mButtonDiv.style.left=this._bl+"px";mButtonDiv.style.top=this._bl+"px";
AreaDiv.appendChild(mButtonDiv);this._bm=mButtonDiv;this._bn=0;this._bo=0}CMapToolbar.prototype.SetButtonEnabled=function(A,B){if(B){A.onmouseover=function(){Map.SetElementOpacity(this,1)
};A.onmouseout=function(){Map.SetElementOpacity(this,0.6)};Map.SetElementOpacity(A,0.6)}else{A.onmouseover=null;A.onmouseout=null;
Map.SetElementOpacity(A,0.2)}};CMapToolbar.prototype.SetButtonActive=function(A,B){if(!A){return}if(B){A.onmouseout=null;
Map.SetElementOpacity(A,1)}else{A.onmouseout=function(){Map.SetElementOpacity(this,0.6)};Map.SetElementOpacity(A,0.6)}};CMapToolbar.prototype.AddButton=function(B,E,H,A,D,C,I){var G=document.createElement("img");
G.style.width=E+"px";G.style.height=H+"px";G.src=B;if(I!=null){G.className=I}G._IsActive=D;G.onmouseover=function(){Map.SetElementOpacity(this,1)
};this.SetButtonActive(G,D);var F=document.createElement("div");F.className=I+"Div";F.style.position="absolute";F.style.width=E+"px";
F.style.height=H+"px";F.style.top="0px";F.style.left=(this._bo+(this._bn*this._bl))+"px";this._bo+=E;F.onclick=function(J){J=J||window.event;
A(J);J.cancelBubble=true;if(J.stopPropagation){J.stopPropagation()}J.returnValue=false;return false};if(C){F.title=C}F.appendChild(G);
this._bm.appendChild(F);this._bn++;this.Element.style.width=(this._bo+((this._bn+1)*this._bl))+"px";return G};CMapToolbar.prototype.AddSpacing=function(A){this._bo+=A
};CMapToolbar.prototype.Hide=function(){this.Element.style.display="none"};function CMapBirdseyeOrientationToolbar(){this._bk=true;
this._bl=2;AreaDiv=document.createElement("div");AreaDiv.style.position="absolute";AreaDiv.id="BirdseyeCompass";AreaDiv.style.left="288px";
AreaDiv.style.top="36px";AreaDiv.style.border="1px solid gray";AreaDiv.style.backgroundColor="#fff";AreaDiv.style.width="59px";
AreaDiv.style.height="59px";Map.SetElementOpacity(AreaDiv,Map.GetParam("ToolbarInitialOpacity"));AreaDiv.onmouseover=function(){Map.SetElementOpacity(this,Map.GetParam("ToolbarActiveOpacity"))
};AreaDiv.onmouseout=function(){Map.SetElementOpacity(this,Map.GetParam("ToolbarInactiveOpacity"))};AreaDiv.style.display="none";
this.Element=AreaDiv;mButtonDiv=document.createElement("div");mButtonDiv.style.position="absolute";mButtonDiv.style.left=this._bl+"px";
mButtonDiv.style.top=this._bl+"px";AreaDiv.appendChild(mButtonDiv);this._bm=mButtonDiv;this.BirdseyeMessages={};this.BirdseyeMessages["North"]=Map.LocRM.GetString("BirdseyeNorth");
this.BirdseyeMessages["East"]=Map.LocRM.GetString("BirdseyeEast");this.BirdseyeMessages["South"]=Map.LocRM.GetString("BirdseyeSouth");
this.BirdseyeMessages["West"]=Map.LocRM.GetString("BirdseyeWest");this.BirdseyeMessagesOrig={};this.BirdseyeMessagesOrig["North"]=Map.LocRM.GetString("BirdseyeNorth");
this.BirdseyeMessagesOrig["East"]=Map.LocRM.GetString("BirdseyeEast");this.BirdseyeMessagesOrig["South"]=Map.LocRM.GetString("BirdseyeSouth");
this.BirdseyeMessagesOrig["West"]=Map.LocRM.GetString("BirdseyeWest");this._bp=Map.GetParam("ToolbarImagesBasePath");if(this._bp.charAt(this._bp.length-1)!="/"){this._bp+="/"
}if(Map.GetParam("ToolbarSupportsLocales")===true||Map.GetParam("ToolbarSupportsLocales")==="true"){var D=Map.GetParam("Locale",Map.GetParam("ToolbarFallbackLocale","de-DE"));
var C=Map.GetParam("ToolbarSupportedLocales").split(",");var E=false;for(var A=0;A<C.length;A++){if(D.toLowerCase()==C[A].toLowerCase()){E=true;
break}}if(!E){D=Map.GetParam("ToolbarFallbackLocale","de-DE")}this._bp+=D+"/MapButtonOrient"}else{this._bp=Map.GetParam("ImagePath")+"Map/MapButtonOrient"
}var B=this;this._bq={};this._bq["North"]=this._br(this._bp+"North.gif",19,0,17,17,function(){B.OnButtonClick("North")},false,this.BirdseyeMessages["North"]);
this._bq["East"]=this._br(this._bp+"East.gif",38,19,17,17,function(){B.OnButtonClick("East")},false,this.BirdseyeMessages["East"]);
this._bq["South"]=this._br(this._bp+"South.gif",19,38,17,17,function(){B.OnButtonClick("South")},false,this.BirdseyeMessages["South"]);
this._bq["West"]=this._br(this._bp+"West.gif",0,19,17,17,function(){B.OnButtonClick("West")},false,this.BirdseyeMessages["West"]);
this._bs={};this.SetOrientation("North")}CMapBirdseyeOrientationToolbar.prototype.OnButtonClick=function(A){Map.SetBirdseyeOrientation(this._bs[A])
};CMapBirdseyeOrientationToolbar.prototype.SetOrientation=function(B){switch(B){case"North":this._bs["North"]="North";this._bs["East"]="East";
this._bs["South"]="South";this._bs["West"]="West";this.BirdseyeMessages["North"]=this.BirdseyeMessagesOrig["North"];this.BirdseyeMessages["East"]=this.BirdseyeMessagesOrig["East"];
this.BirdseyeMessages["South"]=this.BirdseyeMessagesOrig["South"];this.BirdseyeMessages["West"]=this.BirdseyeMessagesOrig["West"];
break;case"East":this._bs["North"]="East";this._bs["East"]="South";this._bs["South"]="West";this._bs["West"]="North";this.BirdseyeMessages["North"]=this.BirdseyeMessagesOrig["East"];
this.BirdseyeMessages["East"]=this.BirdseyeMessagesOrig["South"];this.BirdseyeMessages["South"]=this.BirdseyeMessagesOrig["West"];
this.BirdseyeMessages["West"]=this.BirdseyeMessagesOrig["North"];break;case"South":this._bs["North"]="South";this._bs["East"]="West";
this._bs["South"]="North";this._bs["West"]="East";this.BirdseyeMessages["North"]=this.BirdseyeMessagesOrig["South"];this.BirdseyeMessages["East"]=this.BirdseyeMessagesOrig["West"];
this.BirdseyeMessages["South"]=this.BirdseyeMessagesOrig["North"];this.BirdseyeMessages["West"]=this.BirdseyeMessagesOrig["East"];
break;case"West":this._bs["North"]="West";this._bs["East"]="North";this._bs["South"]="East";this._bs["West"]="South";this.BirdseyeMessages["North"]=this.BirdseyeMessagesOrig["West"];
this.BirdseyeMessages["East"]=this.BirdseyeMessagesOrig["North"];this.BirdseyeMessages["South"]=this.BirdseyeMessagesOrig["East"];
this.BirdseyeMessages["West"]=this.BirdseyeMessagesOrig["South"];break}for(var A in this._bq){this._bq[A].src=this._bp+this._bs[A]+".gif";
this._bq[A].title=this.BirdseyeMessages[A]}};CMapBirdseyeOrientationToolbar.prototype.Show=function(){if(this._bk){this.Element.style.display="block"
}};CMapBirdseyeOrientationToolbar.prototype.Hide=function(A){if(A){this._bk=false}this.Element.style.display="none"};CMapBirdseyeOrientationToolbar.prototype.SetButtonActive=function(A,B){if(B){A.onmouseout=null;
Map.SetElementOpacity(A,1)}else{A.onmouseout=function(){Map.SetElementOpacity(this,0.6)};Map.SetElementOpacity(A,0.6)}};CMapBirdseyeOrientationToolbar.prototype._br=function(B,F,H,E,J,A,D,C){var I=document.createElement("img");
I.style.width=E+"px";I.style.height=J+"px";I.src=B;I._IsActive=D;I.onmouseover=function(){Map.SetElementOpacity(this,1)};
this.SetButtonActive(I,D);var G=document.createElement("div");G.style.position="absolute";G.style.width=E+"px";G.style.height=J+"px";
G.style.top=H+"px";G.style.left=F+"px";G.onclick=A;if(C){G.title=C}G.appendChild(I);this._bm.appendChild(G);return I};CMapPoiLayer.prototype.FindPoiPointsAt=function(B,F,C){var H=this.Map.Mercator2Pixel({X:B.mx,Y:B.my});
var A=[];for(var E=0;E<this.PoiPoints.length;E++){var D=this.PoiPoints[E];if(E+1!=B.id&&D){var G=this.Map.Mercator2Pixel({X:D.mx,Y:D.my});
if((Math.abs(G.X-H.X)<F)&&(Math.abs(G.Y-H.Y)<F)){A.push(D);if(A.length>=C){break}}}}return A};CMapPoiLayer.prototype.PoiPointMouseOver=function(B,A){this.Map.IsMouseOverPoiPoint=true;
if(!this.PoiDetails[A.id-1]){var G="";var D="";if(A.e){G=A.id;D=A.e}var E=this.Map.FindPoiPointsAt(A,32,10);if(Map.GetParam("ShowMultipleAddressesPopUp")){var E=this.Map.FindPoiPointsAt(A,64,10);
for(var F=0;F<E.length;F++){var H=E[F];var C=H[0];if(H[1].e&&!C.PoiDetails[H[1].id-1]){G+=","+H[1].id;D+="^"+H[1].e}}}if(D){if(!this.Map.PoiClient.State()){this.LoadPoiDetails(G,D)
}else{}}}return true};CMapPoiLayer.prototype.PoiPointMouseOut=function(B,A){this.Map.IsMouseOverPoiPoint=false;return true
};function CShapeManager(){this.CheckRunning=false;this.CheckTimeout=100;var A=this;this.ShapeArray=new Array();this.MoveShapeArray=new Array();
this.ShapeCache=[];this.Check=function(){A.CheckRunning=false;if(typeof A.CheckCtr=="undefined"){A.CheckCtr=1}else{A.CheckCtr++
}if(A.ShapeArray.length>0){A.ReorderArray(A.ShapeArray,function(O,M){var N=Map.ClusterManager.GetShapeLayerByLayerID(O.LayerID).GetId();
var L=Map.ClusterManager.GetShapeLayerByLayerID(M.LayerID).GetId();if(N==L){return O.ZIndex>M.ZIndex}return N<L});var G=Map.ClusterManager.GetShapeLayerByLayerID(null);
var K=G.GetId();var E=new Array();while(A.ShapeArray.length>0){var C=false;var B,H,J,D,F;B=A.ShapeArray.pop();H=B.Shape;J=B.ZIndex;
D=B.LayerID;F=Map.ClusterManager.GetShapeLayerByLayerID(D);if(K!=F.GetId()&&E.length>0){A.FlushLayer(G,E);K=F.GetId();E=new Array();
G=F}E.push(H);if(E.length>0&&A.ShapeArray.length==0){A.FlushLayer(G,E)}}}while(A.MoveShapeArray.length>0){var I=A.MoveShapeArray.pop();
var H=I.Shape;if(A.MoveShapeArray.length>0){Map.ShapeManager.Moving=true;H.Show();Map.ShapeManager.Moving=false}else{Map.ShapeManager.Moving=false;
H.Show()}}};setTimeout(this.Check,50)}CShapeManager.prototype.ReorderArray=function(B,A){if(typeof A!="function"){A=function(I,H){return I<H
}}function E(J,I,K){var H=J[I];J[I]=J[K];J[K]=H}function C(J,H,K,I){while(H+1<K&&A(J[H+1],I)){E(J,H,H+1);++H}J[H]=I}function G(K,H,I,L){for(;
H<I;++H){if(!A(K[H],K[I])){var J=K[H];K[H]=K[I];C(K,I,L,J)}}}function D(K,I,L){var H=L-I;if(H<2){return}var J=I+Math.floor(H/2);
D(K,I,J);D(K,J,L);G(K,I,J,L)}function F(H){D(H,0,H.length)}F(B)};CShapeManager.prototype.FlushLayer=function(B,A){if(B!=null&&A!=null&&A.length>0){B.AddShape(A);
if(!Map.ClusterManager.IsClusteringEnabled()){Map.RedrawAll()}}};CShapeManager.prototype.AddShape=function(A,B,C){this.ShapeArray.push({Shape:A,LayerID:C,ZIndex:B});
if(!this.CheckRunning){this.CheckRunning=true;setTimeout(this.Check,this.CheckTimeout)}};CShapeManager.prototype.GetShapeFromCache=function(F,C,E){var B=null;
var A=this.ShapeCache[F];if(typeof A!=="undefined"){for(var D=0;D<A.length;D++){var B=A[D];if((C<0&&B.YMExtension.ResultNumber<0)||(B.YMExtension.ResultNumber==C)&&(B.YMExtension.Icon==E.i)){this.ShapeCache[F]=A.slice(0,D).concat(A.slice(D+1));
return B}}}return null};CShapeManager.prototype.MoveShape=function(A,B,C){this.MoveShapeArray.push({Shape:A,LayerID:C,ZIndex:B});
if(!this.CheckRunning){this.CheckRunning=true;setTimeout(this.Check,this.CheckTimeout)}};CShapeManager.prototype.HideShape=function(B,A){var E=B.YMExtension.LayerID;
var D=B.YMExtension;var C=B.GetCustomIcon();B.YMExtension.Visible=false;if(!A){this.Deleting=true}B.Hide();if(!A){this.Deleting=false
}if(!this.ShapeCache[E]){this.ShapeCache[E]=[]}this.ShapeCache[E].push(B)};function CMapCluster(B,A,C){this.ClusterConfig=B;
this.ShapeArray=A;this.Shape=C;this.PopUp=null;this.PopUpShowNeeded=false}CMapCluster.prototype.GetZIndex=function(){var C=0;
for(var A=0;A<this.ShapeArray.length;A++){var B=this.ShapeArray[A].GetZIndex();if(B>C){C=B}}return C};CMapCluster.prototype.CreateClusterIcon=function(){var This=this;
ClusterConfig=this.ClusterConfig;var Icon=ClusterConfig.Icon;Icon.ID=Map.GetUniqueID();var HighlightIcon=ClusterConfig.HighlightIcon;
HighlightIcon.ID=Map.GetUniqueID();var OverID=Map.GetUniqueID();var OutID=Map.GetUniqueID();var ClickID=Map.GetUniqueID();
var ClusterIcon;var Div=document.createElement("div");var ZIndex=1000;var MapIconLinkActive=Map.GetParam("MapIconLinkActive",true);
var HighlightingEnabled=typeof HighlightIcon!=="undefined"&&HighlightIcon!=null&&typeof HighlightIcon.Url!=="undefined"&&HighlightIcon.Url!=null&&String(HighlightIcon.Url).length>0;
if(HighlightingEnabled){var HghImg=document.createElement("img");if(!Map.GetParam("IE6",false)){HghImg.src=HighlightIcon.Url
}else{HghImg.src=Map.GetParam("InvisibleGif");HghImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+HighlightIcon.Url+"',sizingMethod='scale')"
}HghImg.id=HighlightIcon.ID;this.HighlightID=HighlightIcon.ID;HghImg.className="MapClusterIconHighlight";with(HghImg.style){position="relative";
width=HighlightIcon.Width+"px";height=HighlightIcon.Height+"px";zIndex=ZIndex-1;visibility="hidden";left="0px";top="0px";
if(!MapIconLinkActive){cursor="move"}}HghImg.setAttribute("onclick","Map.HndlIntrnl('"+ClickID+"')");HghImg.setAttribute("onmouseover","Map.HndlIntrnl('"+OverID+"')");
HghImg.setAttribute("onmouseout","Map.HndlIntrnl('"+OutID+"')");Div.appendChild(HghImg)}var Img=document.createElement("img");
if(!Map.GetParam("IE6",false)){Img.src=Icon.Url}else{Img.src=Map.GetParam("InvisibleGif");Img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Icon.Url+"',sizingMethod='scale')"
}Img.className="MapClusterIcon";with(Img.style){position=(HighlightingEnabled)?"absolute":"relative";width=Icon.Width+"px";
height=Icon.Height+"px";zIndex=ZIndex;left=(HighlightingEnabled)?(HighlightIcon.Width-Icon.Width)/2+"px":"0px";top=(HighlightingEnabled)?(HighlightIcon.Height-Icon.Height)/2+"px":"0px";
if(!MapIconLinkActive){cursor="move"}}Img.setAttribute("onclick","Map.HndlIntrnl('"+ClickID+"')");Img.setAttribute("onmouseover","Map.HndlIntrnl('"+OverID+"')");
Img.setAttribute("onmouseout","Map.HndlIntrnl('"+OutID+"')");Div.appendChild(Img);ClusterIcon=Div.innerHTML;while(Div.childNodes.length>0){Div.removeChild(Div.childNodes[0])
}HghImg=null;Img=null;Div=null;Map.AddInternalHandler(OverID,function(){This.Highlight();var ClickAction=This.ClusterConfig.PointClickAction;
if(typeof ClickAction=="undefined"||ClickAction==null||ClickAction.toLowerCase()!="openpopup"){This.OpenPopup()}});Map.AddInternalHandler(OutID,function(){This.UnHighlight();
var ClickAction=This.ClusterConfig.PointClickAction;if(typeof ClickAction=="undefined"||ClickAction==null||ClickAction.toLowerCase()!="openpopup"){This.ClosePopup()
}});Map.AddInternalHandler(ClickID,function(){var ClickAction=This.ClusterConfig.PointClickAction;if(typeof ClickAction!="undefined"&&ClickAction!=null&&ClickAction.toLowerCase()=="openpopup"){This.OpenPopup()
}});return ClusterIcon};CMapCluster.prototype.GetClusterIconCoordinates=function(){var A=this.Shape.GetPoints()[0];var B=Map.GetMap().LatLongToPixel(new VELatLong(A.Latitude,A.Longitude));
return{X:B.x,Y:B.y}};CMapCluster.prototype.Highlight=function(){if(typeof this.HighlightID!=="undefined"){var A=document.getElementById(this.HighlightID);
if(A!=null){A.style.visibility="visible"}}};CMapCluster.prototype.UnHighlight=function(){if(typeof this.HighlightID!=="undefined"){var A=document.getElementById(this.HighlightID);
if(A!=null){A.style.visibility="visible"}}};CMapCluster.prototype._bt=function(){return(document.all&&(navigator.userAgent.toLowerCase().indexOf("msie 6.")!=-1))
};CMapCluster.prototype.OpenPopup=function(){var A=this;var B={Width:A.ClusterConfig.Icon.Width,Height:A.ClusterConfig.Icon.Height};
A.PopUpShowNeeded=true;if(A.PopUp==null){A.LoadClusterDetails(function(C){if(C.charAt(0)=="D"){C=C.substring(1,C.length-1)
}A.PopUp=new CMapPopUp(Map,null,{popup:C},A);if(A.PopUpShowNeeded){A.PopUp.Show(A.GetClusterIconCoordinates(),B)}})}else{A.PopUp.Show(A.GetClusterIconCoordinates(),B)
}};CMapCluster.prototype.ClosePopup=function(){this.PopUpShowNeeded=false;if(this.PopUp!=null){this.PopUp.Hide(true)}};CMapCluster.prototype.LoadClusterDetails=function(E){var B="";
var D=[];var F=[];for(var A=0;A<this.ShapeArray.length;A++){B+=this.ShapeArray[A].YMExtension.Ebinr+"^";D.push(this.ShapeArray[A].YMExtension.PoiId);
F.push(this.ShapeArray[A].YMExtension.LayerID)}B=B.substring(0,B.length-1);if(Map.PoiClient.IsEnabled()){var C={JSLayerID:"PoiCluster",DataSetIds:B,JSPoiDetails:D,JSPoiLayerIDs:F,JSClusterDetails:true,NewSession:"No"};
if(this.ClusterConfig.DB){C.DB=this.ClusterConfig.DB}Map.PoiClient.InvokeRequest(C,"GET",E)}};function CMapClusterManager(){this.ShapeLayers=new Array();
this.ShapeLayerIDs=new Array();this.LookupTable=new Object();this.DefaultShapeLayer=new VEShapeLayer();this.ShapeLayers.push(this.DefaultShapeLayer);
this.ShapeLayerIDs.push(this.DefaultShapeLayer.GetId());this.ClusterConfigs=new Array();this._ag();this._bk=false}CMapClusterManager.prototype._ag=function(){Map.GetMap().AddShapeLayer(this.DefaultShapeLayer);
var E=Map.GetParam("PoiClusters");for(var B=0;B<E.length;B++){var C=new VEShapeLayer();for(var F=0;F<E[B].LayerList.length;
F++){this.LookupTable[E[B].LayerList[F]]=C}this.ShapeLayers.push(C);this.ShapeLayerIDs.push(C.GetId());var D={ShapeLayer:C,ShapeLayerID:C.GetId(),GridWidth:E[B].GridWidth,GridHeight:E[B].GridHeight,MinElements:E[B].MinElements,MaxElements:E[B].MaxElements,OnlyShadow:E[B].OnlyShadowPoints,LayerList:E[B].LayerList,Description:E[B].Description,Icon:E[B].Icon,HighlightIcon:E[B].HighlightIcon,Enabled:true};
var A=Map.GetParam("PoiLayers")[E[B].LayerList[0]].DB;if(A!=null&&A!=""){D.DB=A}this.ClusterConfigs.push(D);Map.GetMap().AddShapeLayer(C)
}};CMapClusterManager.prototype.GetShapeLayerByLayerID=function(B){var A=this.LookupTable[B];if(typeof A=="undefined"||A==null){return this.DefaultShapeLayer
}else{return A}};CMapClusterManager.prototype.ClusteringAlgorithm=function(K){if(Map.ShapeManager.Deleting||Map.ShapeManager.Moving){return[]
}var I=K.GetShapeCount();var Z=[];var U=Map.ClusterManager.GetClusterConfigByShapeLayerID(K.GetId());var d=new Object();var R=U.GridWidth;
var W=U.GridHeight;var J=Map.GetParam("Width");var H=Map.GetParam("Height");for(var F=0;F<I;F++){var O=K.GetShapeByIndex(F);
if(typeof O.YMExtension.Visible!="undefined"&&!O.YMExtension.Visible){continue}var G=Map.GetMap().LatLongToPixel(O.GetPoints()[0]);
var D=G.x;var E=G.y;if(D<0||E<0){continue}var N=Math.ceil(D/R);var T=Math.ceil(E/W);if(typeof d[N]=="undefined"){d[N]={}}if(typeof d[N][T]=="undefined"){d[N][T]=new Array()
}d[N][T].push(O)}for(var D in d){for(var E in d[D]){var C=d[D][E];if(C.length>=U.MinElements&&C.length<=U.MaxElements){var L=new VEClusterSpecification();
L.Shapes=C;var A=0;var V=0;for(var F=0;F<C.length;F++){var c=C[F].GetPoints()[0];A+=c.Latitude;V+=c.Longitude}A=A/C.length;
V=V/C.length;L.LatLong=new VELatLong(A,V);Z.push(L)}else{if(C.length>U.MaxElements){var B=Math.ceil(C.length/U.MaxElements);
for(var Q=0;Q<B;Q++){var L=new VEClusterSpecification();var A=0;var V=0;var M=Math.ceil(Q*C.length/B)+1;var b=(Q==B-1)?C.length:Math.ceil((Q+1)*C.length/B);
for(var a=M;a<b;a++){var c=C[a].GetPoints()[0];A+=c.Latitude/(b-M);V+=c.Longitude/(b-M)}L.Shapes=C.splice(M,(b-M));L.LatLong=new VELatLong(A,V);
Z.push(L)}}}}}return Z};CMapClusterManager.prototype.EnableClustering=function(){var A=this;for(var B=1,D=A.ShapeLayers.length;
B<D;B++){var C=new VECustomIconSpecification();var E=A.GetClusterConfigByShapeLayerID(A.ShapeLayers[B].GetId());C.CustomHTML="";
var F=new VEClusteringOptions();F.Config=E;F.Icon=C;F.Callback=function(G){if(!G){return}var J=this.Config;for(var L=0,K=G.length;
L<K;L++){var H=G[L].GetClusterShape();var I=new CMapCluster(J,G[L].Shapes,H);H.SetCustomIcon(I.CreateClusterIcon())}};this.ShapeLayers[B].SetClusteringConfiguration(A.ClusteringAlgorithm,F)
}this._bk=true};CMapClusterManager.prototype.DisableClustering=function(){var A=this;for(var B=1;B<A.ShapeLayers.length;B++){A.ShapeLayers[B].SetClusteringConfiguration(VEClusteringType.None)
}this._bk=false};CMapClusterManager.prototype.IsClusteringEnabled=function(A){if(A==null){return this._bk}var B=this.GetClusterConfigByShapeLayerID(A);
var C=this._bk&&B!=null&&B.Enabled===true;return C};CMapClusterManager.prototype.GetClusterConfigByShapeLayerID=function(A){for(var B=0;
B<this.ClusterConfigs.length;B++){if(this.ClusterConfigs[B].ShapeLayerID==A){return this.ClusterConfigs[B]}}return null};
CMap.prototype._ag=function(){this._al="VirtualEarthV1";this._bu=1;this._bv={}};CMap.prototype.InitDelayed=function(C){function D(F,G){var E=document.createElement("script");
E.type="text/javascript";E.src=F;document.getElementsByTagName("head")[0].appendChild(E)}var A=this;function B(){if(VELoaded==true){setTimeout(function(){A.Init(C)
},1)}else{setTimeout(B,50)}}B();D(C["VEUrl"])};CMap.prototype.Init=function(X){try{var B=this;if(this._ab!=null){this._bw=this._ab;
this._ab=X;for(var m in this._bw){this._ab[m]=this._bw[m]}}else{this._ab=X}function H(r,i){X[r]=Map.GetParam(r,i)}H("SessionGuid","");
H("PoiJSServiceUrl","../../YM/Poi/PoiJSService.aspx");H("ImagePath","../Layout/Images/");H("OpenDetailInfoInNewWindow",true);
H("PoiLayers",{Default:{Icon:0}});H("PoiPointIcons",[{Url:this.GetParam("ImagePath")+"Map/PoiDefault.gif",Width:14,Height:14,IsNumbered:true}]);
H("PoiPointIconShadow",this.GetParam("ImagePath")+"Map/PoiPointShadowCentered.png");H("PoiPointIconsByNumber",false);H("PoiPointClickable",true);
H("PoiPointClickAction","OpenDetailInfo");H("MapElement","MapControlFrame");H("DebugElement","MapDebug");H("PoiListContainerElement","PoiListContainer");
H("PopUpOpacity",0.9);H("DebugMode",false);H("DebugLevel",1);H("Lux",0);H("Luy",0);H("Rlx",0);H("Rly",0);H("MoveLapFactor",0.5);
H("PopUpPositionHoriz","auto");H("PopUpPositionVert","auto");H("PopUpOffsetIconFactor",0.5);H("PopUpOffsetX",1);H("PopUpOffsetY",1);
H("DetailInfoBaseLink","");H("DetailInfoDB",-1);H("SingleClickAction","ZoomIn");H("PoiDetailMemoFields","");H("PoiDetailObjectListItems","");
H("RouteCoords","");H("RouteLineColor","rgba(0,0,102,0.6)");H("RouteLineWidth",12);H("ControlFrameBorderWidth",8);H("ControlFrameMoveNWidth",200);
H("ControlFrameMoveNWWidth",15);H("MapStyle","Map");H("ForeignMapStyles","");H("AvailableMapStyles","");H("ActionMode","Zoom");
H("ZoomBoxBorderWidth",2);H("ZoomBoxBorderColor","#63656b");H("ZoomBoxColor","#fff");H("ZoomBoxOpacity",0.5);H("Animate",false);
H("InverseWheelZoom",false);H("StartNewGeoSearchOnRectChange",false);H("ToolbarInitialOpacity",0.8);H("ToolbarActiveOpacity",0.8);
H("ToolbarInactiveOpacity",0.7);H("ToolbarSupportsLocales","true");H("ToolbarImagesBasePath",this.GetParam("BaseUrl")+"YM/Layout/Images/Map/Toolbar/");
H("ToolbarSupportedLocales","de-DE,de-AT,de-CH,en-US,en-GB,en-IN,en-SG,es-ES,fr-CH,fr-FR,hu-HU,it-CH,it-IT,nl-BE,fr-BE,en-AU,fi-FI,zh-CN,pl-PL,en-ZA,sv-SE,ru-RU,cs-CZ,uk-UA,en-JM,es-MX,ja-JP");
H("ToolbarFallbackLocale","de-DE");H("HighlightBirdseyeButtonOnAvailable",true);H("UpdatePoiList",1);H("ClusteringEnabled",false);
H("VEController",false);H("OverrideCursor",true);H("MSVEToken","");H("IE6",(document.all&&(navigator.userAgent.toLowerCase().indexOf("msie 6.")!=-1)));
H("InvisibleGif","//www.yellowmap.de/YM/Layout/Images/Map/Invisible.gif");H("Partner","YM");var h=this.GetParam("ZoomLevel");
var T=this.GetParam("BirdseyeOrientation","x");var R=document.getElementById("VirtualEarthMapContainer");R.style.position="relative";
var d=this.GetParam("Width");var I=this.GetParam("Height");R.style.width=d+"px";R.style.height=I+"px";if(this.GetParam("DebugMode")){this.Debug=new CDebugConsole(this.GetParam("DebugElement"),this.GetParam("DebugLevel"))
}else{this.Debug=new CDebugConsoleDummy()}this.LocRM=new CResourceManager("Map_");this._an=new CMapPoiLayerManager(this);
this._ao=new CMapOverlayManager(this);this.PoiClient=new CPoiJSServiceClient(this.GetParam("PoiJSServiceUrl"),this.GetParam("SessionGuid"),this.Debug);
this.PoiClient.DataHandler=function(i,r){return B.PoiDataHandler(i,r)};this.PoiClient.InfoHandler=function(i,s,r){return B.PoiInfoHandler(i,s,r)
};this.PoiClient.ErrorHandler=function(i,s,r){return B.PoiErrorHandler(i,s,r)};this.PoiPopUpHideTimeout=0;var Y=document.getElementById(this.GetParam("MapElement"));
var p={X:(this.GetParam("Rlx")+this.GetParam("Lux"))/2,Y:(this.GetParam("Luy")+this.GetParam("Rly"))/2};var b=this.Mercator2GeoDec(p);
var A=this.Mercator2GeoDec({X:this.GetParam("Lux"),Y:this.GetParam("Luy")});var C=this.Mercator2GeoDec({X:this.GetParam("Rlx"),Y:this.GetParam("Rly")});
this._u=new VEMap("VirtualEarthMapContainer");var U=this;var a=this._u;this.MapLoaded=false;this._u.onLoadMap=function(){U.MapLoaded=true
};if(Map.GetParam("AvailableMapStyles")!=null){var N=Map.GetParam("AvailableMapStyles").split(",");if(N.length==1&&N[0].length>0){this._u.SetDashboardSize(VEDashboardSize.Tiny)
}else{if(Map.GetParam("VEController")=="Small"){this._u.SetDashboardSize(VEDashboardSize.Small)}else{if(Map.GetParam("VEController")=="Tiny"){this._u.SetDashboardSize(VEDashboardSize.Tiny)
}else{this._u.SetDashboardSize(VEDashboardSize.Normal)}}}}T=T.toLowerCase();switch(T){case"n":T=VEOrientation.North;break;
case"s":T=VEOrientation.South;break;case"e":case"o":T=VEOrientation.East;break;case"w":T=VEOrientation.West;break;default:T=null;
break}if(h){if(T&&this.GetParam("MapStyle")=="Birdseye"){var g=new VEMapOptions();g.BirdseyeOrientation=T;this._u.LoadMap(new VELatLong(b.Y,b.X),h,VEMapStyle.Birdseye,false,VEMapMode.Mode2D,false,0,g);
var c=this;setTimeout(function(){var r=Map._PoiLayerManager.GetLayer("DefaultLocation");var i=c.Mercator2GeoDec({X:r.PoiPoints[0].mx,Y:r.PoiPoints[0].my});
c._Map.SetBirdseyeScene(new VELatLong(i.Y,i.X),T,h,null)},500)}else{this._u.LoadMap(new VELatLong(b.Y,b.X),h,this.SetMapStyle(this.GetParam("MapStyle"),true),false,VEMapMode.Mode2D,false,0)
}}else{function q(v,w,t,u,s){v-=30;w-=40;for(var r=1;r<20;r++){var x=156543.04*Math.cos(s*Math.PI/180)/Math.pow(2,r);if((x*v)<t||(x*w)<u){return r-1
}}return 19}var K=this.GetParam("Width");var G=this.GetParam("Height");var W=this.GetParam("Lux");var n=this.GetParam("Rlx");
var E=this.GetParam("Luy");var J=this.GetParam("Rly");var V=this._ap(E)*Math.abs(W-n);var Q=this._ap((E+J)/2)*Math.abs(E-J);
var f=(new VELatLong(b.Y,b.X)).Latitude;if(T&&this.GetParam("MapStyle")=="Birdseye"){var g=new VEMapOptions();g.BirdseyeOrientation=T;
this._u.LoadMap(new VELatLong(b.Y,b.X),q(K,G,V,Q,f),VEMapStyle.Birdseye,false,VEMapMode.Mode2D,false,0,g);var c=this;setTimeout(function(){var r=Map._PoiLayerManager.GetLayer("DefaultLocation");
var i=c.Mercator2GeoDec({X:r.PoiPoints[0].mx,Y:r.PoiPoints[0].my});c._Map.SetBirdseyeScene(new VELatLong(i.Y,i.X),T,h,null)
},500)}else{this._u.LoadMap(new VELatLong(b.Y,b.X),q(K,G,V,Q,f),this.SetMapStyle(this.GetParam("MapStyle"),true),false,VEMapMode.Mode2D,false,0)
}}var M=this.GetParam("MSVEToken");if(M!=null&&M!=""){this._u.SetClientToken(M);this._u.AttachEvent("ontokenexpire",function(){location.reload(true)
});this._u.AttachEvent("ontokenerror",function(){})}var o=this._u.Dispose;if(window.addEventListener){window.addEventListener("unload",o,false)
}else{if(window.attachEvent){window.attachEvent("onunload",o)}else{var D=window.onunload;window.onunload=function(){if(typeof D==="function"){D()
}o()}}}var L=3;var Z=false;if(!this.GetParam("VEController")){this._u.HideDashboard()}this._u.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
this._u.ClearInfoBoxStyles();this._bx();this._ar=new CMapOverlaysLayer(this.GetParam("Width"),this.GetParam("Height"));R.firstChild.appendChild(this._ar.Element);
this._by=new CMapMessageLayer();this._u.AddControl(this._by.Element);if(!this.GetParam("VEController")){this._bz=new CMapToolbar();
this.RegisterCallback("InitCultureRes",function(){B.InitToolbar()});document.getElementById("VirtualEarthMapContainer").appendChild(this._bz.Element)
}this._ca(this.GetParam("ActionMode"));setTimeout(function(){setTimeout(function(){U.BirdseyeOrientationToolbar=new CMapBirdseyeOrientationToolbar();
Map.GetMap().AddControl(U.BirdseyeOrientationToolbar.Element)},1)},1);if(Map.GetParam("OverrideCursor")){this._u.vemapcontrol.SetCursor=function(i){};
this.SetCursor("default")}if(!Map.GetParam("ZoomBoxDisabled",false)){var O=document.createElement("div");O.style.position="absolute";
O.style.left="0px";O.style.top="0px";O.style.width="0px";O.style.height="0px";O.className="YMZoomBox";this._cb=document.createElement("div");
this._cb.style.position="absolute";this._cb.style.left="0px";this._cb.style.top="0px";this._cb.style.width="1px";this._cb.style.height="1px";
this._cb.style.visibility="hidden";this._cb.style.background=this.GetParam("ZoomBoxColor");this._cb.style.border=this.GetParam("ZoomBoxBorderWidth")+"px solid "+this.GetParam("ZoomBoxBorderColor");
this._cb.onmousemove=function(i){B.OnMouseMove(i)};this._cb.onmouseup=function(i){B.OnMouseUp(i)};this.SetElementOpacity(this._cb,this.GetParam("ZoomBoxOpacity"));
O.oncontextmenu=function(i){i=i||window.event;return false};this._cb.oncontextmenu=function(i){i=i||window.event;return false
};O.appendChild(this._cb);this._u.AddControl(O)}this._u.AttachEvent("onmousedown",function(i){return B.OnMouseDown(i)});this._u.AttachEvent("onmousemove",function(i){return B.OnMouseMove(i)
});this._u.AttachEvent("onmouseup",function(i){return B.OnMouseUp(i)});var k=window.ero.getElement();if(k){k.style.display="none"
}for(var m=0;m<R.childNodes.length;m++){var j=R.childNodes[m];if(j.className.indexOf("MSVE_PoweredByLogo")>-1){var F=this.GetParam("BaseUrl")+"YM/Layout/Images/Map/VirtualEarthYellowmap.png";
if(j.tagName.toLowerCase()=="img"){j.src=F}else{j.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='scale')";
j.style.width="184px";j.style.height="29px"}j.style.cursor="default";break}}if(!this.GetParam("VEController")){B._CBeA=this._cc;
setTimeout(function(){B._CBeA()},5000)}this.PoiClient.Enable();if(this._ab["PrintMode"]){this.SetPrintMode(true)}Map.CurrentTopLeftLatLong=new VELatLong(A.Y,A.X);
Map.CurrentBottomRightLatLong=new VELatLong(C.Y,C.X);this.ShapeManager=new CShapeManager(this._u);this.ClusterManager=new CMapClusterManager();
if(X["ClusteringEnabled"]){this.ClusterManager.EnableClustering()}if(this.GetParam("RouteCoords")){this._cd()}this._ai();
for(var e in this.GetParam("PoiLayers")){this._ah("PoiLayerInit",e)}this._u.AttachEvent("onchangemapstyle",function(i){Map.OnMapStyleChange(i)
});this.Initialised=true;this._ah("Init",B);setTimeout(function(){setTimeout(function(){a.AttachEvent("onchangeview",function(i){B.OnRectChange(i)
})},300)},300);if(navigator.userAgent.indexOf("Firefox/3.5")!=-1){R.addEventListener("DOMMouseScroll",function(i){i.stopPropagation();
i.preventDefault();i.cancelBubble=false;return false},false)}MapStarterQueue.Start()}catch(l){var U=this;setTimeout(function(){U.Init(X)
},100)}};CMap.prototype._bx=function(){if(!this.GetParam("DisableMoveButtons",false)){var L=document.getElementById(this.GetParam("MapElement"));
var H=["N","NE","E","SE","S","SW","W","NW"];var B=this.GetParam("ControlFrameBorderWidth");var A=this.GetParam("Width")+B*2;
var D=this.GetParam("Height")+B*2;var F=this.GetParam("ControlFrameMoveNWidth");var M=this.GetParam("ControlFrameBorderWidth");
var N=this.GetParam("ControlFrameMoveNWWidth");var C=[(A-F)/2,A-N,A-M,A-N,(A-F)/2,0,0,0];var K=[0,0,(D-F)/2,D-N,D-M,D-N,(D-F)/2,0];
var I=this;for(var J=0;J<H.length;J++){var E=H[J];var G=document.createElement("img");G.src=this.GetParam("ImagePath")+"Map/MapMove"+E+".gif";
G.className="MapMoveButton";G.style.position="absolute";G.style.left=C[J]+"px";G.style.top=K[J]+"px";G.moveDir=E;G.style.cursor="pointer";
G.onclick=function(){I.Move(this.moveDir)};L.appendChild(G)}}};CMap.prototype._ce=function(B,F,E,H){var C=E;var I=[];for(var G=0;
G<C.length;G+=2){var J=this.Mercator2GeoDec({X:parseInt(C[G]),Y:parseInt(C[G+1])});I.push(new VELatLong(J.Y,J.X))}var A=new VEShape(VEShapeType.Polyline,I);
var D=new VEColor(0,0,106,0.6);A.SetLineColor(D);A.SetLineWidth(F);A.SetCustomIcon('<div style="display:none"></div>');this._u.AddShape(A)
};CMap.prototype._cd=function(){var A=this.GetParam("RouteCoords").split(" ");this._ce(this.GetParam("RouteLineColor"),this.GetParam("RouteLineWidth"),A,"Route");
this.PoiDataHandler({JSLayerID:"DefaultRouteStartEnd",BC:""},[{a:"0",mx:parseInt(A[0]),my:parseInt(A[1]),e:"",t:"",i:"Start",n:1,prio:1000},{a:"0",mx:parseInt(A[A.length-2]),my:parseInt(A[A.length-1]),e:"",t:"",i:"End",n:2,prio:1000}]);
this.QueuePoiLayer("DefaultRouteWaypoint")};CMap.prototype.InitToolbar=function(){var F=Map.GetParam("ToolbarImagesBasePath");
if(F.charAt(F.length-1)!="/"){F+="/"}if(this.GetParam("ToolbarSupportsLocales")===true||this.GetParam("ToolbarSupportsLocales")==="true"){var E=this.GetParam("Locale",this.GetParam("ToolbarFallbackLocale","de-DE"));
var D=this.GetParam("ToolbarSupportedLocales").split(",");var A=false;for(var B=0;B<D.length;B++){if(E.toLowerCase()==D[B].toLowerCase()){A=true;
break}}if(!A){E=this.GetParam("ToolbarFallbackLocale","de-DE")}F+=E+"/"}var C=this;this._bz.AddButton(F+"MapButtonZoomIn.gif",17,17,function(){C.ZoomIn()
},false,this.LocRM.GetString("ZoomIn"),"ZoomIn");this._bz.AddButton(F+"MapButtonZoomOut.gif",17,17,function(){C.ZoomOut()
},false,this.LocRM.GetString("ZoomOut"),"ZoomOut");this._bz.AddSpacing(5);this._bz.AddButton(F+"MapButtonOverview.gif",17,17,function(){C.ToggleOverview()
},false,this.LocRM.GetString("ToggleOverview"),"ToggleOverview");var G=this.GetParam("AvailableMapStyles");if(G==""||(G!="Map"&&G.indexOf("Map")>-1)){this._bz.AddSpacing(5);
this._cf=this._bz.AddButton(F+"MapButtonMap.gif",64,17,function(){C.SetMapStyle("Map")},this._am=="Map",this.LocRM.GetString("StyleMap"),"StyleMap")
}if(G==""||(G!="Satellite"&&G.indexOf("Satellite")>-1)){this._cg=this._bz.AddButton(F+"MapButtonSatellite.gif",64,17,function(){C.SetMapStyle("Satellite")
},this._am=="Satellite",this.LocRM.GetString("StyleSatellite"),"StyleSatellite")}if(G==""||(G!="Hybrid"&&G.indexOf("Hybrid")>-1)){this._ch=this._bz.AddButton(F+"MapButtonHybrid.gif",64,17,function(){C.SetMapStyle("Hybrid")
},this._am=="Hybrid",this.LocRM.GetString("StyleHybrid"),"StyleHybrid")}if(G==""||(G!="Birdseye"&&G.indexOf("Birdseye")>-1)){this._ci=this._bz.AddButton(F+"MapButtonBirdseye.gif",64,17,function(){C.SetMapStyle("Birdseye")
},this._am=="Birdseye",this.LocRM.GetString("StyleBirdseye"),"StyleBirdseye")}this._ca(this.GetParam("ActionMode"));this._cc()
};CMap.prototype.GetUniqueID=function(){return this._bu++};CMap.prototype._cj=function(A){var B={X:0,Y:0};if(A&&typeof A.pageX!="undefined"){B.X=A.pageX;
B.Y=A.pageY}else{var C=(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")?"documentElement":"body";
B.X=window.event.clientX+document[C].scrollLeft;B.Y=window.event.clientY+document[C].scrollTop}return B};CMap.prototype.OnMouseOver=function(A){if(A.elementID!=null){}};
CMap.prototype._cc=function(){this.Debug.Info("CheckBirdseyeAvail.");if(!this._ci){return}if(!this._ci._origSrc){this._ci._origSrc=this._ci.src
}if(typeof this._ck=="undefined"){this._ck=false}if(this._u.IsBirdseyeAvailable()){this.Debug.Info("Birdseye available");
this._ci.src=this._ci._origSrc.replace(".gif","Highlight.gif");this._bz.SetButtonEnabled(this._ci,true);if((this.GetParam("HighlightBirdseyeButtonOnAvailable")!=="false"&&this.GetParam("HighlightBirdseyeButtonOnAvailable")!==false)||this._am==="Birdseye"){this._bz.SetButtonActive(this._ci,true)
}if(this._am!="Birdseye"&&!this._ck){this.ShowMessage(this.LocRM.GetString("BirdseyeAvailable"),"BirdseyeAvailable")}this._ck=true
}else{this.HideMessage("BirdseyeAvailable");this._ci.src=this._ci._origSrc;this._bz.SetButtonEnabled(this._ci,false);this._ck=false
}};CMap.prototype.UpdatePOIs=function(){var A=this._aj();this.UpdateLayers(A);this._ah("RectChange",A)};CMap.prototype.OnMapStyleChange=function(B){var A="";
switch(B.mapStyle){case"r":A="Map";break;case"a":A="Satellite";break;case"h":A="Hybrid";break;case"b":case"o":A="Birdseye";
break}this._am=A;Map.LogMapStyleChange(A)};CMap.prototype.OnRectChange=function(A,D){if(this._cb!=null){this._cb.style.visibility="hidden"
}var C=this._u.GetMapView();var E=Math.abs(C.TopLeftLatLong.Longitude-C.BottomRightLatLong.Longitude)/200;if((Math.abs(C.TopLeftLatLong.Longitude-Map.CurrentTopLeftLatLong.Longitude)<E&&Math.abs(C.TopLeftLatLong.Latitude-Map.CurrentTopLeftLatLong.Latitude)<E&&Math.abs(C.BottomRightLatLong.Longitude-Map.CurrentBottomRightLatLong.Longitude)<E&&Math.abs(C.BottomRightLatLong.Latitude-Map.CurrentBottomRightLatLong.Latitude)<E)){this.CurrentTopLeftLatLong=new VELatLong(C.TopLeftLatLong.Latitude,C.TopLeftLatLong.Longitude);
this.CurrentBottomRightLatLong=new VELatLong(C.BottomRightLatLong.Latitude,C.BottomRightLatLong.Longitude);return}this.CurrentTopLeftLatLong=new VELatLong(C.TopLeftLatLong.Latitude,C.TopLeftLatLong.Longitude);
this.CurrentBottomRightLatLong=new VELatLong(C.BottomRightLatLong.Latitude,C.BottomRightLatLong.Longitude);if(this.DisableSearch){return
}Map.HidePoiPopUp();this._cl=true;if(!this.GetParam("VEController")){this._cc()}var B=this._aj();if(typeof(this.DisableNextSearchOnRectChange)=="undefined"||!this.DisableNextSearchOnRectChange){this.UpdateLayers(B)
}this.DisableNextSearchOnRectChange=false;this.HidePoiPopUp();this._ah("RectChange",B)};CMap.prototype.OnMouseDown=function(A){this.HidePoiPopUp();
if((this._cm=="Move"?A.rightMouseButton:A.leftMouseButton)&&(!Map.GetParam("ZoomBoxDisabled",false))){this._cn=A.mapX;this._co=A.mapY;
var B=this._cj(A);this._cp=B.X;this._cq=B.Y;this.IsMouseDown=true;if(!Map.GetParam("ZoomBoxDisabled",false)){this._cb.style.left=(this._cn)+"px";
this._cb.style.width="0px";this._cb.style.top=(this._co)+"px";this._cb.style.height="0px";var C=this._cb;setTimeout(function(){C.style.visibility="visible"
},100);this._cb.style.cursor="crosshair";this.SetCursor("crosshair");this.IsZoomBoxActive=true;this.PoiClient.AbortRequest();
this.HideMessage()}return true}else{this.SetCursor("move");return false}};CMap.prototype.OnMouseMove=function(B){if(this.IsZoomBoxActive){var C=this._cj(B);
var A=C.X-this._cp+this._cn;var D=C.Y-this._cq+this._co;if(A>=this._cn){this._cb.style.left=(this._cn)+"px";this._cb.style.width=(A-this._cn)+"px"
}else{this._cb.style.left=(A)+"px";this._cb.style.width=(this._cn-A)+"px"}if(D>=this._co){this._cb.style.top=(this._co)+"px";
this._cb.style.height=(D-this._co)+"px"}else{this._cb.style.top=(D)+"px";this._cb.style.height=(this._co-D)+"px"}return true
}return false};CMap.prototype.OnMouseUp=function(C){this.SetCursor(this._cm=="Move"?"move":"default");if(this.IsZoomBoxActive){this.IsZoomBoxActive=false;
var E=this._cj(C);var A=E.X-this._cp+this._cn;var G=E.Y-this._cq+this._co;this._cb.style.visibility="hidden";var F=Math.sqrt(Math.pow(this._cn-A,2)+Math.pow(this._co-G,2));
if(F<30){return false}var B=this._u.PixelToLatLong(new VEPixel(A,G));var D=this._u.PixelToLatLong(new VEPixel(this._cn,this._co));
this._u.SetMapView([B,D]);return true}return false};CMap.prototype.ShowMessageWait=function(A){this.LastMessageWait=A;this.MessageShown=true;
this.ShowMessage('<img src="'+this.GetParam("BaseUrl")+'YM/Layout/Images/Map/ajax-mini.gif" /> <span style="position:relative; top:-7px">'+A+"</span>","Wait")
};CMap.prototype.ShowMessage=function(B,A){if(this.TO!=null){clearTimeout(this.TO);this.TO=null}this._cr=A;this._by.SetText(B);
this._by.Show()};CMap.prototype.HideMessage=function(A,B){if(B==null){Map.TO=setTimeout(function(){Map.HideMessage(A,true);
Map.TO=null},500)}else{if(B){if(!A||A==this._cr){this._by.Hide();Map.MessageShown=false}this._cr=null}}};CMap.prototype._aj=function(){var A={Lux:0,Luy:0,Rlx:0,Rly:0};
if(!this._u){A.Lux=this.GetParam("Lux");A.Luy=this.GetParam("Luy");A.Rlx=this.GetParam("Rlx");A.Rly=this.GetParam("Rly");
return A}var B=this._u.GetMapView();if(B.TopLeftLatLong.Longitude&&B.BottomRightLatLong.Longitude){var H={X:B.TopLeftLatLong.Longitude,Y:B.TopLeftLatLong.Latitude};
H=this.GeoDec2Mercator(H);A.Lux=H.X;A.Luy=H.Y;H={X:B.BottomRightLatLong.Longitude,Y:B.BottomRightLatLong.Latitude};H=this.GeoDec2Mercator(H);
A.Rlx=H.X;A.Rly=H.Y}else{var G=this._u.GetBirdseyeScene();var D=this._u.vemapcontrol.GetObliqueScene();G.PixelToLatLong=function(N,Q){var O=D.PixelToLatLong(N,Q);
return{Longitude:O.longitude,Latitude:O.latitude}};var M=this.GeoDec2Mercator({X:this._u.vemapcontrol.GetCenterLongitude(),Y:this._u.vemapcontrol.GetCenterLatitude()});
var I=G.PixelToLatLong(new VEPixel(0,0),this._u.GetZoomLevel());var L=G.PixelToLatLong(new VEPixel(this.GetParam("Width"),this.GetParam("Height")),this._u.GetZoomLevel());
var C={X:I.Longitude,Y:I.Latitude};C=this.GeoDec2Mercator(C);var F={X:L.Longitude,Y:L.Latitude};F=this.GeoDec2Mercator(F);
var J=(F.X-C.X)/2;var E=(C.Y-F.Y)/2;A.Lux=M.X-J;A.Luy=M.Y+E;A.Rlx=M.X+J;A.Rly=M.Y-E}if(A.Luy<A.Rly){var K=A.Luy;A.Luy=A.Rly;
A.Rly=K}if(A.Lux>A.Rlx){var K=A.Lux;A.Lux=A.Rlx;A.Rlx=K}return A};CMap.prototype.GetCurrentMapRect=function(){return this._aj()
};CMap.prototype.HndlIntrnl=function(A){if(this._bv[A]){this._bv[A]()}};CMap.prototype._bt=function(B){var E=false;if(document.all&&(navigator.userAgent.toLowerCase().indexOf("msie 6.")!=-1)){E=true
}else{if(document.all&&document.body&&(typeof document.body.style.filter!="undefined")){var D=-1;if(navigator.appName=="Microsoft Internet Explorer"){var C=navigator.userAgent;
var A=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(A.exec(C)!=null){D=parseFloat(RegExp.$1)}}E=true}}if(typeof B=="undefined"||B==null||B==""){return E
}else{return(E&&new RegExp(/\.png$/ig).test(B))}};CMap.prototype.PngHackNeeded=function(A){return this._bt(A)};CMap.prototype.GetPoiPointIconObject=function(PoiPoint,LayerID){var Icon=new Object();
Icon.Width=0;Icon.Height=0;Icon.OffsetX=0;Icon.OffsetY=0;Icon.Url="";Icon.Class="";Icon.Index=-1;Icon.Name="";var Parts=PoiPoint.i.split(",");
Icon.Index=parseInt(Parts[0]);if(Parts.length>1){Icon.Name=Parts[1]}if(Icon.Index==-1){return}if(!Icon.Index){Icon.Index=0
}var ResultNumber=PoiPoint.n;if(PoiPoint.iu){var IU=eval("("+PoiPoint.iu+")");Icon.Url=IU.u;Icon.Width=IU.w;Icon.Height=IU.h
}else{var PoiIcon=this.GetParam("PoiPointIcons")[Icon.Index];var IsInShadow=((LayerID=="Premium"||LayerID=="Standard"||LayerID=="Basis"||LayerID=="Free")&&(ResultNumber<0&&PoiIcon.ShadowUrl!=null&&PoiIcon.ShadowUrl!=""));
if(!IsInShadow){Icon.Url=PoiIcon.Url;Icon.Width=PoiIcon.Width;Icon.Height=PoiIcon.Height}else{Icon.Width=PoiIcon.ShadowWidth;
Icon.Height=PoiIcon.ShadowHeight;Icon.Url=PoiIcon.ShadowUrl}if(Icon.Url.indexOf("{")>-1){var ReplaceStr=Icon.Url.match(/{.*}/)[0];
var InnerList=ReplaceStr.replace("{","").replace("}","").split(",");var Found=false;for(var i=0;i<InnerList.length;i++){if(Icon.Name==InnerList[i]){Found=true;
break}}Icon.Url=Icon.Url.replace(ReplaceStr,Found?Icon.Name:InnerList[0])}if(this.GetParam("PoiPointIconsByNumber")&&PoiIcon.IsNumbered&&ResultNumber>0){if(Icon.Url.match(/.gif$/i)){Icon.Url=Icon.Url.replace(".gif","-"+ResultNumber+".gif")
}else{if(Icon.Url.match(/.png$/i)){Icon.Url=Icon.Url.replace(".png","-"+ResultNumber+".png")}}}var Href=window.location.href;
var Search=window.location.search;if(Search){Href=Href.substring(0,Href.indexOf(Search))}var BaseUrl=Href.substring(0,Href.lastIndexOf("/")+1);
BaseUrl=BaseUrl.substring(0,BaseUrl.lastIndexOf("/")+1);Icon.Url=(Icon.Url.indexOf("://")==-1?BaseUrl:"")+Icon.Url}Icon.OffsetX=0;
Icon.OffsetY=0;if(LayerID!="DefaultRouteStartEnd"&&LayerID!="DefaultRouteWaypoint"){Icon.Class="NormalMapIcon MapIcon"+LayerID+" MapIconResultNumber"+ResultNumber
}else{Icon.Class="RouteStartEnd Route"+Icon.Name}return Icon};CMap.prototype.GetPoiPointHighlightIconObject=function(E,B,H,I){var G=new Object();
G.ID=this.GetUniqueID();G.Url="";G.Width=0;G.Height=0;var C=-1;var A="";var D=E.i.split(",");C=parseInt(D[0]);if(D.length>1){A=D[1]
}if(C==-1){return}if(!C){C=0}var F=this.GetParam("PoiPointIcons")[C];if(F&&typeof F.HighlightUrl!="undefined"&&F.HighlightUrl!=null&&F.HighlightUrl!=""){if(E.n>0){G.Url=F.HighlightUrl;
G.Width=F.HighlightWidth;G.Height=F.HighlightHeight}else{G.Url=F.ShadowHighlightUrl;G.Width=F.ShadowHighlightWidth;G.Height=F.ShadowHighlightHeight
}return G}if(B=="OverlayLocalNews"){G.Url="../../YM/Layout/Images/Map/HighlightNews.gif";G.Width=38;G.Height=38}else{if(B=="DefaultShadow"){G.Url="../../YM/Layout/Images/Map/PoiPointHighlight.gif";
G.Width=23;G.Height=23}else{if(B=="Default"){G.Url="../../YM/Layout/Images/Map/PoiPointHighlightLarge.gif";G.Width=30;G.Height=30
}else{if(B=="DefaultPremium"){G.Url="../../YM/Layout/Images/Map/PoiPointHighlightLarge.gif";G.Width=30;G.Height=30}else{if(H==14&&I==14&&!this.GetParam("IsNewPoiResult")){G.Url="../../YM/Layout/Images/Map/PoiPointHighlightLarge.gif";
G.Width=29;G.Height=29}else{if(H==14&&I==14&&this.GetParam("IsNewPoiResult")){G.Url="../../YM/Layout/Images/Map/HighlightIconSmall.png";
G.Width=21;G.Height=21}else{if(B=="Premium"||B=="Standard"||B=="Basis"||B=="Free"){if(H==28&&I==28){G.Url=this.GetParam("ImagePath")+"Map/HighlightIconBig.png";
G.Width=32;G.Height=32}else{if(H==19&&I==19){G.Url=this.GetParam("ImagePath")+"Map/HighlightIconSmall.png";G.Width=21;G.Height=21
}}}else{return}}}}}}}return G};CMap.prototype.AddInternalHandler=function(B,A){this._bv[B]=A};CMap.prototype.ShowPoi=function(MapLayer,Id,PoiPoint,Priority){var Shape=Map.ShapeManager.GetShapeFromCache(MapLayer.ID,PoiPoint.n,PoiPoint);
var ZIndex=this.GetZIndexForPoi(MapLayer.ID,PoiPoint.n);var Coord=this.Mercator2GeoDec({X:PoiPoint.mx,Y:PoiPoint.my});if(Shape!=null){var LatLong=new VELatLong(Coord.Y,Coord.X);
Shape.SetPoints([LatLong]);Shape.SetZIndex(ZIndex);Shape.YMExtension.Visible=true;Shape.YMExtension.Ebinr=PoiPoint.e;Shape.YMExtension.PoiId=PoiPoint.id;
Shape.YMExtension.LayerID=PoiPoint.layer;Map.ShapeManager.MoveShape(Shape,PoiPoint.layer,ZIndex);var MapPoi=new CMapPoi(MapLayer,PoiPoint,Shape);
this._bv[Shape.YMExtension.OverID]=function(){MapPoi.HoverHandler()};this._bv[Shape.YMExtension.OutID]=function(){MapPoi.UnhoverHandler()
};this._bv[Shape.YMExtension.ClickID]=function(){MapPoi.ClickHandler()};return MapPoi}var OverID=this.GetUniqueID();var OutID=this.GetUniqueID();
var ClickID=this.GetUniqueID();var Icon=this.GetPoiPointIconObject(PoiPoint,MapLayer.ID);var HighlightIcon=this.GetPoiPointHighlightIconObject(PoiPoint,MapLayer.ID,Icon.Width,Icon.Height);
var MapIconLinkActive=Map.GetParam("MapIconLinkActive",true);var PoiIcon;var Div=document.createElement("div");var HighlightingEnabled=typeof HighlightIcon!=="undefined"&&HighlightIcon!=null&&typeof HighlightIcon.Url!=="undefined"&&HighlightIcon.Url!=null&&String(HighlightIcon.Url).length>0;
if(HighlightingEnabled){var HghImg=document.createElement("img");if(!Map.PngHackNeeded(HighlightIcon.Url)){HghImg.src=HighlightIcon.Url
}else{HghImg.src=Map.GetParam("InvisibleGif")}HghImg.id=HighlightIcon.ID;HghImg.className="MapIconHighlight";with(HghImg.style){position="absolute";
width=HighlightIcon.Width+"px";height=HighlightIcon.Height+"px";zIndex=ZIndex-1;visibility="hidden";display="block";left=-Math.round(HighlightIcon.Width/2)+"px";
top=-Math.round(HighlightIcon.Height/2)+"px";if(!MapIconLinkActive){cursor="move"}if(Map.PngHackNeeded(HighlightIcon.Url)){filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+HighlightIcon.Url+"',sizingMethod='scale')"
}}HghImg.setAttribute("onclick","Map.HndlIntrnl('"+ClickID+"')");HghImg.setAttribute("onmouseover","Map.HndlIntrnl('"+OverID+"')");
HghImg.setAttribute("onmouseout","Map.HndlIntrnl('"+OutID+"')");Div.appendChild(HghImg)}var Img=document.createElement("img");
if(!Map.PngHackNeeded(Icon.Url)){Img.src=Icon.Url}else{Img.src=Map.GetParam("InvisibleGif")}Img.className=Icon.Class;with(Img.style){position="absolute";
width=Icon.Width+"px";height=Icon.Height+"px";left=-Math.round(Icon.Width/2)+"px";top=-Math.round(Icon.Height/2)+"px";zIndex=ZIndex;
if(!MapIconLinkActive){cursor="move"}if(Map.PngHackNeeded(Icon.Url)){filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Icon.Url+"',sizingMethod='crop')"
}}Img.setAttribute("onclick","Map.HndlIntrnl('"+ClickID+"')");Img.setAttribute("onmouseover","Map.HndlIntrnl('"+OverID+"')");
Img.setAttribute("onmouseout","Map.HndlIntrnl('"+OutID+"')");Div.appendChild(Img);PoiIcon='<span style="position:absolute;overflow:visible;display:block;width:0;height:0;left:13px;top:13px;">'+Div.innerHTML+"</span>";
while(Div.childNodes.length>0){Div.removeChild(Div.childNodes[0])}HghImg=null;Img=null;Div=null;var Shape=null;Shape=new VEShape(VEShapeType.Pushpin,[new VELatLong(Coord.Y,Coord.X)]);
Shape.SetCustomIcon(PoiIcon);Shape.SetZIndex(ZIndex);Shape.YMExtension={};Shape.YMExtension.HighlightID=HighlightIcon?HighlightIcon.ID:-1;
Shape.YMExtension.Icon=PoiPoint.i;Shape.YMExtension.LayerID=MapLayer.ID;Shape.YMExtension.ResultNumber=PoiPoint.n;Shape.YMExtension.ZIndex=ZIndex;
Shape.YMExtension.OverID=OverID;Shape.YMExtension.OutID=OutID;Shape.YMExtension.ClickID=ClickID;Shape.YMExtension.Ebinr=PoiPoint.e;
Shape.YMExtension.PoiId=PoiPoint.id;Shape.YMExtension.LayerID=PoiPoint.layer;Shape.YMExtension.Visible=true;this._bv[OverID]=function(){MapPoi.HoverHandler()
};this._bv[OutID]=function(){MapPoi.UnhoverHandler()};this._bv[ClickID]=function(){MapPoi.ClickHandler()};var MapPoi=new CMapPoi(MapLayer,PoiPoint,Shape);
Map.ShapeManager.AddShape(Shape,ZIndex,MapLayer.ID);return MapPoi};CMap.prototype.GetZIndexForPoi=function(B,A){if(B=="DefaultLocation"){return 900
}if(A>0){switch(B){case"DefaultPremium":case"Premium":return 20000-A;case"Default":case"Standard":return 16000-A;case"Image":return 12000-A;
case"Basis":return 9000-A;case"Free":return 9000-A;case"DefaultRouteStartEnd":return 21000;case"DefaultRouteWaypoint":return 21010;
default:return 1000}}else{switch(B){case"DefaultPremium":return 1800;case"Premium":return 16100;case"Standard":return 12100;
case"Basis":return 8000;case"Free":return 8000;case"DefaultRouteStartEnd":return 21000;case"DefaultRouteWaypoint":return 21010;
default:return 1000}}};CMap.prototype.RedrawAll=function(){var B=Map.GetMap().GetShapeLayerCount();for(var C=0;C<B;C++){var D=Map.GetMap().GetShapeLayerByIndex(C);
var A=D.GetShapeCount();for(var E=0;E<A;E++){var F=D.GetShapeByIndex(E);if(F.YMExtension&&F.YMExtension.ZIndex){F.SetZIndex(F.YMExtension.ZIndex)
}F.Redraw()}}};CMap.prototype.ShowOverlay=function(A){var B=this._ar;B.AddOverlay(A)};CMap.prototype.ShowHighlight=function(A,C,D,B){};
CMap.prototype.HideHighlight=function(A){};CMap.prototype.SetCursor=function(A){if(Map.GetParam("OverrideCursor")){var B=document.getElementById("VirtualEarthMapContainer");
B.style.cursor=A}};CMap.prototype.SetImageSource=function(B,A,D,C){if(/\.png$/i.test(A)&&(typeof B.style.filter!="undefined")&&parseInt(navigator.appVersion)<7){if(D&&C){B.src=this.GetParam("ImagePath")+"Map/Invisible.gif";
B.width=D;B.height=C}else{B.src=A.replace(".png","Invisible.gif")}B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"',sizingMethod='scale')"
}else{B.src=A}};CMap.prototype.Move=function(C){var D=this.GetParam("MoveLapFactor");var A=0;var B=0;switch(C){case"N":B=(D);
break;case"NE":B=(D);A=(D);break;case"E":A=(D);break;case"SE":B=-(D);A=(D);break;case"S":B=-(D);break;case"SW":B=-(D);A=-(D);
break;case"W":A=-(D);break;case"NW":B=(D);A=-(D);break;default:break}this._u.Pan(Math.round(A*this.GetParam("Width")),Math.round((-1)*B*this.GetParam("Height")))
};CMap.prototype.ZoomIn=function(){this._u.ZoomIn()};CMap.prototype.ZoomOut=function(){this._u.ZoomOut()};CMap.prototype.SetCenter=function(E,D,F){var C=this.Mercator2GeoDec({X:E,Y:D});
function G(){Map.GetMap().DetachEvent("onchangeview",G);if(F&&typeof(F)=="function"){F()}}var B=new VELatLong(C.Y,C.X);var A=this._u.GetCenter();
if(Math.abs(B.Latitude-A.Latitude)<0.001&&Math.abs(B.Longitude-A.Longitude)<0.001){if(F!=null&&typeof F=="function"){F()}}else{if(F!=null&&typeof(F)=="function"){this._u.AttachEvent("onchangeview",G)
}this._u.SetCenter(B)}};CMap.prototype.GetCenter=function(){var A=this._aj();var B={X:(A.Rlx+A.Lux)/2,Y:(A.Luy+A.Rly)/2};
return B};CMap.prototype.SetRadius=function(D){var B=this._aj();var C={X:(B.Rlx+B.Lux)/2,Y:(B.Luy+B.Rly)/2};var E={X:C.X-D,Y:C.Y+D};
var A={X:C.X+D,Y:C.Y-D};E=this.Mercator2GeoDec(E);A=this.Mercator2GeoDec(A);this._u.SetMapView([new VELatLong(E.Y,E.X),new VELatLong(A.Y,A.X)])
};CMap.prototype.Resize=function(D,C){this.SetParam("Width",D);this.SetParam("Height",C);var B=document.getElementById("VirtualEarthMapContainer");
if(B){B.style.width=D+"px";B.style.height=C+"px"}var A=document.getElementById("MapControlFrame");if(A){A.style.width=D+"px";
A.style.height=C+"px"}this._u.Resize(D,C)};CMap.prototype.ToggleOverview=function(){if(this._cs){this._cs=false;this._u.HideMiniMap()
}else{this._cs=true;this._u.ShowMiniMap(8,this.GetParam("Height")-200)}};CMap.prototype.ToggleActionMode=function(){if(this._cm=="Move"){this._ca("Zoom")
}else{this._ca("Move")}};CMap.prototype._ca=function(A){if(A=="Zoom"){this._cm="Zoom";this.SetCursor("default")}else{this._cm="Move";
this.SetCursor("move")}};CMap.prototype._ct=function(){return(navigator.userAgent.indexOf("Opera")>-1||navigator.userAgent.search(/Firefox\/1\.0/)>-1||navigator.userAgent.search(/Firefox\/0\./)>-1)
};CMap.prototype._cu=function(){return;var B=this._aj();var D=document.location.href;var A="";if(D.indexOf("#")>=0){A=D.substring(D.indexOf("#"));
D=D.substring(0,D.indexOf("#"))}var C=D.replace(/&*MapStyle=[a-zA-Z]*/,"");C=C.replace(/&*SessionGuid=[a-zA-Z0-9-]*/,"");
C=C.replace(/&*Lux=[0-9]*/,"");C=C.replace(/&*Luy=[0-9]*/,"");C=C.replace(/&*Rlx=[0-9]*/,"");C=C.replace(/&*Rly=[0-9]*/,"");
C=C.replace(/&*GeoFormatIn=[0-9]*/,"");C=C+(C.indexOf("?")>-1?"":"?")+"&SessionGuid="+this.GetParam("SessionGuid")+"&Lux="+Math.round(B.Lux)+"&Luy="+Math.round(B.Luy)+"&Rlx="+Math.round(B.Rlx)+"&Rly="+Math.round(B.Rly)+"&GeoFormatIn=3&MapStyle=Map&MapControl=AJAXV3";
C+=A;document.location.href=C};CMap.prototype.SetMapStyle=function(B,I){if(B=="Birdseye"&&(I||!this._u.IsBirdseyeAvailable())){B="Hybrid";
if(I){var C=this;setTimeout(function(){C.SetMapStyle("Birdseye")},2000)}}if(!I&&this.GetParam("ForeignMapStyles").indexOf(B)>-1){var A=this._aj();
var F=document.location.href;var G="";if(F.indexOf("#")>=0){for(var E=F.indexOf("#");E<F.length;E++){G+=F.charAt(E)}F=F.replace(G)
}var D=F.replace(/&*MapStyle=[a-zA-Z]*/,"");D=D.replace(/&*SessionGuid=[a-zA-Z0-9-]*/,"");D=D.replace(/&*Lux=[0-9]*/,"");
D=D.replace(/&*Luy=[0-9]*/,"");D=D.replace(/&*Rlx=[0-9]*/,"");D=D.replace(/&*Rly=[0-9]*/,"");D=D.replace(/&*GeoFormatIn=[0-9]*/,"");
D=D+(D.indexOf("?")>-1?"":"?")+"&SessionGuid="+this.GetParam("SessionGuid")+"&Lux="+Math.round(A.Lux)+"&Luy="+Math.round(A.Luy)+"&Rlx="+Math.round(A.Rlx)+"&Rly="+Math.round(A.Rly)+"&GeoFormatIn=3&MapStyle="+B;
D+=G;document.location.href=D;return"r"}var H="h";switch(B){case"Map":if(!I){this._u.SetMapStyle(VEMapStyle.Road);this.BirdseyeOrientationToolbar.Hide()
}H="r";break;case"Satellite":if(!I){this._u.SetMapStyle(VEMapStyle.Aerial);this.BirdseyeOrientationToolbar.Hide()}H="a";break;
case"Hybrid":if(!I){this._u.SetMapStyle(VEMapStyle.Hybrid);this.BirdseyeOrientationToolbar.Hide()}H="h";break;case"Birdseye":if(!I){this._u.SetMapStyle(VEMapStyle.Birdseye);
this._cs=false;this.HideMessage("BirdseyeAvailable");this.BirdseyeOrientationToolbar.Show()}H="o";break;default:H="h";break
}this._am=B;if(!I){this._cv()}return H};CMap.prototype.LogMapStyleChange=function(A){this.PoiClient.InvokeRequest({LogGisMapEvent:this._ae+1,MapControl:this._al,MapStyle:A,PreserveSessionExceptParas:"MapStyle",Action:"UpdateUserSessionValues"});
this._ae=0};CMap.prototype.SetBirdseyeOrientation=function(A){this._cl=true;this._u.SetBirdseyeOrientation(A);this.BirdseyeOrientationToolbar.SetOrientation(A)
};CMap.prototype._cv=function(){if(!this._cf){return}this._bz.SetButtonActive(this._cf,false);this._bz.SetButtonActive(this._cg,false);
this._bz.SetButtonActive(this._ch,false);this._bz.SetButtonActive(this._ci,false);switch(this._am){case"Map":this._bz.SetButtonActive(this._cf,true);
break;case"Satellite":this._bz.SetButtonActive(this._cg,true);break;case"Hybrid":this._bz.SetButtonActive(this._ch,true);
break;case"Birdseye":this._bz.SetButtonActive(this._ci,true);break;default:break}};CMap.prototype.ShowPoiPopUp=function(F,B){var G;
for(var D=0;D<this._an.Layers.length;D++){G=this._an.Layers[D];for(var A=0;A<G.PoiPoints.length;A++){var C=G.PoiPoints[A];
if(C.n==F){var E=C.h;if(E){G.PoiPointMouseOver(E,C);E.ShowPopUp(B)}return}}}};CMap.prototype.UnHighlightPoiPoint=function(){if(this._at){this._at.UnHighlight()
}};CMap.prototype.Hide=function(){this.BirdseyeOrientationToolbar.Hide(true);this._by.Hide(true);this._bz.Hide();var A=document.getElementById(this.GetParam("MapElement"));
if(A){A.style.display="none"}};CMap.prototype.Mercator2GeoDec=function(A){var C={X:0,Y:0};var B=(180/Math.PI)*(A.X/this._aa+0);
var D=(180/Math.PI)*(Math.atan(Math.exp(A.Y/this._aa))-(Math.PI/4))/0.5;C.X=B;C.Y=D;return C};CMap.prototype.Mercator2Pixel=function(A){var C=this.Mercator2GeoDec(A);
var B=this._u.LatLongToPixel(new VELatLong(C.Y,C.X));return{X:B.x,Y:B.y}};CMap.prototype.GeoDec2Mercator=function(A){var C={X:0,Y:0};
var B=A.X;var D=A.Y;C.X=this._aa*((Math.PI/180)*((B)-0));C.Y=this._aa*Math.log(Math.tan((Math.PI/4)+(Math.PI/180)*D*0.5));
return C};CMap.prototype.SetElementOpacity=function(A,B){if(typeof A.style.filter!="undefined"){if(B>=1){A.style.filter=""
}else{A.style.filter=(B==null)?"":"Alpha(Opacity="+Math.round(B*100)+")"}}else{A.style.opacity=(B==null)?"":B}};CMap.prototype.AddDivForToolbar=function(A){A.onclick=function(B){B=B?B:window.event;
B.cancelBubble=true};A.onmousedown=function(B){B=B?B:window.event;B.cancelBubble=true};this._u.AddControl(A);A.style.zIndex=400;
A.style.position="absolute"};CMap.prototype._cw=null;CMap.prototype._cx=null;CMap.prototype.DisablingDrawMode=false;CMap.prototype.EnableDrawMode=function(C,A){if(Map.DisablingDrawMode!=null&&Map.DisablingDrawMode==true){setTimeout(function(){Map.EnableDrawMode(C,A)
},100);return}if(this._af){this.DisableDrawMode()}this._af=true;var B=this._u;function E(G){var F=B.PixelToLatLong(new VEPixel(G.mapX,G.mapY));
var H=Map.GeoDec2Mercator({X:F.Longitude,Y:F.Latitude});return C(H)}function D(G){var F=B.PixelToLatLong(new VEPixel(G.mapX,G.mapY));
var H=Map.GeoDec2Mercator({X:F.Longitude,Y:F.Latitude});return A(H)}this._cw=E;this._cx=D;this._u.AttachEvent("onclick",this._cw);
this._u.AttachEvent("ondoubleclick",this._cx)};CMap.prototype.DisableDrawMode=function(){Map.DisablingDrawMode=true;if(!this._af){return
}this._af=false;this._u.DetachEvent("onclick",this._cw);this._cw=null;Map.DetachDoubleClick=function(){this._u.DetachEvent("ondoubleclick",this._cx);
Map.DisablingDrawMode=false};setTimeout(function(){Map.DetachDoubleClick()},100)};CMap.prototype.EnableShapeEvents=function(A){var D=this._u;
var C=this._cy;var B=function(F){if(F.elementID==null){return}var E=D.GetShapeById(F.elementID);for(var G in C){if(E.GetID()==C[G].GetID()){if(A!=null){A("onclick",G)
}break}}};this._u.AttachEvent("onmouseover",B);this._u.AttachEvent("onmouseout",B);this._u.AttachEvent("onclick",B)};CMap.prototype.HidePolyElement=function(A){if(this._cy[A]!=null){this._u.DeleteShape(this._cy[A]);
this._cy[A]=null}};CMap.prototype.DrawCircle=function(D,A,B,C){};CMap.prototype.SetZoomLevel=function(A){this._u.SetZoomLevel(A)
};CMap.prototype.GetZoomLevel=function(){var A=null;if(this._u){A=this._u.GetZoomLevel()}return A};CMap.prototype._cy=new Object();
CMap.prototype._cz=null;CMap.prototype.DrawPoint=function(F,D,A){if(this._cy[A]!=null){this._u.DeleteShape(this._cy[A]);this._cy[A]=null
}var C=this.Mercator2GeoDec(F);var E=new VELatLong(C.Y,C.X);var B=new VEShape(VEShapeType.Pushpin,E);B.SetCustomIcon(D);if(this._cz==null){this._cz=new VEShapeLayer();
this._u.AddShapeLayer(this._cz)}this._cz.AddShape(B);return B};CMap.prototype.DrawPolyLocation=function(G,E,A,C){if(this._cy[A]!=null){this._u.DeleteShape(this._cy[A]);
this._cy[A]=null}var D=this.Mercator2GeoDec(G);var F=new VELatLong(D.Y,D.X);var B=new VEShape(VEShapeType.Pushpin,F);B.SetCustomIcon(E);
if(this._cz==null){this._cz=new VEShapeLayer();this._u.AddShapeLayer(this._cz)}if(C!=null){var E="";C.SetIcon=function(H){B.SetCustomIcon(H);
B.ShowIcon()};C.GetIcon=function(){return E}}this._cz.AddShape(B);this._cy[A]=B;B.ShowIcon();return B};CMap.prototype.DrawPolyLine=function(C,L,J,D,U){if(this._cy[D]!=null){this._u.DeleteShape(this._cy[D]);
this._cy[D]=null}var O=new Array();for(var M=0;M<J.length;M++){var Q=this.Mercator2GeoDec(J[M]);O.push(new VELatLong(Q.Y,Q.X))
}var T=new VEShape(VEShapeType.Polyline,O);var N,K,E,I;if(C!=null&&C!=""){C=C.replace(/\s+/g,"");C=C.replace("rgba","");C=C.replace(/\(/g,"");
C=C.replace(/\)/g,"");var F=C.split(",");N=F[0];K=F[1];E=F[2];I=F[3]}T.SetLineColor(new VEColor(N,K,E,I));T.SetLineWidth(L);
if(this._cz==null){this._cz=new VEShapeLayer();this._u.AddShapeLayer(this._cz)}this._cz.AddShape(T);if(U!=null){var H="";
U.SetIcon=function(A){T.SetCustomIcon(A);T.ShowIcon()};U.GetIcon=function(){return H}}else{T.HideIcon()}this._cy[D]=T;return T
};CMap.prototype.DrawPolygon=function(J,O,D,H){if(this._cy[D]!=null){this._u.DeleteShape(this._cy[D]);this._cy[D]=null}var I=new Array();
var W=0,a=0;var U=O.length-1;if((O[U-1].X-O[U].X)<10&&(O[U-1].Y-O[U].Y)<10){U--}for(var K=0;K<U;K++){W+=O[K].X;a+=O[K].Y;
var F=this.Mercator2GeoDec(O[K]);I.push(new VELatLong(F.Y,F.X))}W/=I.length;a/=I.length;var Q=this.Mercator2GeoDec({X:W,Y:a});
var E=new VELatLong(Q.Y,Q.X);var V=new VEShape(VEShapeType.Polygon,I);var T=0;var b=0;for(var K=0;K<I.length;K++){var L=Map.GetMap().LatLongToPixel(I[K]);
T+=L.x;b+=L.y}T/=I.length;b/=I.length;E=Map.GetMap().PixelToLatLong(new VEPixel(T,b));var N,C,X,Y;if(J!=null&&J!=""){J=J.replace(/\s+/g,"");
J=J.replace("rgba","");J=J.replace(/\(/g,"");J=J.replace(/\)/g,"");var Z=J.split(",");N=Z[0];C=Z[1];X=Z[2];Y=Z[3]}V.SetLineColor(new VEColor(N,C,X,Y));
V.SetFillColor(new VEColor(N,C,X,Y));V.SetLineWidth(1);var M="";H.SetIcon=function(A){V.SetCustomIcon(A);V.ShowIcon()};H.GetIcon=function(){return M
};H.GetCenterCoord=function(){};this._u.AddShape(V);V.ShowIcon();P=V;this._cy[D]=V;return V};CMap.prototype.AddTooltipToShape=function(C,B){var A;
if(this._cy[C]!=null){A=this._cy[C]}A.SetDescription("skhfkjshfkj jksdhf k hfdsjkhf ksfhkj dshf");S=A};CMap.prototype.DivMovingWithMap=function(G,C,D,F,H){var E=this.Mercator2GeoDec({X:C,Y:D});
var A=new VEShape(VEShapeType.Pushpin,new VELatLong(E.Y,E.X));var B=this._u;A.SetCustomIcon(G.innerHTML);G.SetPosition=function(){};
G.Show=function(){};G.Hide=function(I){A.Hide()};G.Remove=function(){B.DeleteShape(A)};G.Move=function(J,K){B.DeleteShape(A);
var I=Map.Mercator2GeoDec({X:J,Y:K});A=new VEShape(VEShapeType.Pushpin,new VELatLong(I.Y,I.X));A.SetCustomIcon(G.innerHTML);
B.ClearInfoBoxStyles();B.AddShape(A)};G.Show();return G};CMap.prototype.GetMap=function(){return this._u};CMap.prototype.GetCurrentRect=function(){return this._aj()
};CMap.prototype.MakeMapPrintable=function(){var A=document.getElementById("MapControlFrame").getElementsByTagName("img");
for(var B=0;B<A.length;B++){A[B].style.zIndex=70}};CMap.prototype.ChangeLocalTexts=function(){};CMap.prototype.SetPrintMode=function(A){if(A==null){A=true
}if(this._u){this._u.SetPrintOptions(new VEPrintOptions(A))}else{setTimeout(function(){Map.SetPrintMode(A)},100)}};var Map=new CMap();