var g_MapCtrl=null,g_Comm=new CCommunication,g_map=null,g_tools=new CTools,g_container=null,g_markerTable=[],g_openInfoWindow=null,g_mapSizeFix=!1,g_MapRequestCache=[],g_customInfoWindow=null,g_customZoomSliderControl=null,g_customButtonControl=null,g_openBigMapButtonControl=null,g_LoadingDiv=null,g_lastMapMoveTimestamp=null,g_mouseOverMarker=null,g_contextMenu=null,g_stagePositionOverlay=null,g_SuggestContentPositionOverlay=null,g_AddNewSpectatorPointOverlay=null,g_MapLegendOverlay=null,g_GPSVideoOverlay= null,g_GMapTypes=new CGMapTypes,g_skipMapMoveEvent=!1,g_positionArrow=null,g_QueryServer=[],g_QueryingServer=!1,g_visibleGroups=[],g_Tour=null,g_mouseOverPolyline=null,OPEN_STREET_MAP_TYPE=null,copyright=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,'(<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>)'),copyrightCollection=new GCopyrightCollection('Kartendaten &copy; 2009 <a href="http://www.openstreetmap.org/">OpenStreetMap</a> Contributors'); copyrightCollection.addCopyright(copyright);var tilelayers_mapnik=[];tilelayers_mapnik[0]=new GTileLayer(copyrightCollection,0,18);tilelayers_mapnik[0].getTileUrl=function(b,a){return"http://tile.openstreetmap.org/"+a+"/"+b.x+"/"+b.y+".png"};tilelayers_mapnik[0].isPng=function(){return!0};tilelayers_mapnik[0].getOpacity=function(){return 1};OPEN_STREET_MAP_TYPE=new GMapType(tilelayers_mapnik,new GMercatorProjection(19),"Mapnik",{urlArg:"mapnik",linkColor:"#000000"}); function OnMouseOverShowInMap(b,a,e,c,d){b.isOver=!0;g_Comm&&setTimeout(function(){b.isOver&&g_Comm.SetMapCenterDynamicZoomin(a,e,c,d)},500)}function OnMouseOutShowNotInMap(b,a,e,c,d){b.isOver=!1;g_Comm&&g_Comm.SetMapCenterDynamicZoomin(a,e,c,d)} var GeoTools={calcVectorLength:function(b,a){var e=null;null!=b&&null!=a&&(e=Math.sqrt(Math.pow(b.lng()-a.lng(),2)+Math.pow(b.lat()-a.lat(),2)));return e},getVector:function(b,a){var e=null;null!==b&&null!==a&&(e=new GLatLng(a.lat()-b.lat(),a.lng()-b.lng()));return e},calcVectorAngle:function(b,a,e,c){b=GeoTools.getVector(b,a);e=GeoTools.getVector(e,c);c=null;null!==b&&null!==e&&(c=b.lng()*e.lng()+b.lat()*e.lat(),b=Math.sqrt(Math.pow(b.lng(),2)+Math.pow(b.lat(),2)),e=Math.sqrt(Math.pow(e.lng(),2)+ Math.pow(e.lat(),2)),c=Math.acos(c/(b*e)),c=360*c/(2*Math.PI));return c}}; function CGMapTypes(){this.mapTypeByName=null;this.initMapTypeByName=function(){this.mapTypeByName=[];this.mapTypeByName.G_NORMAL_MAP=G_NORMAL_MAP;this.mapTypeByName.G_SATELLITE_MAP=G_SATELLITE_MAP;this.mapTypeByName.G_HYBRID_MAP=G_HYBRID_MAP;this.mapTypeByName.G_PHYSICAL_MAP=G_PHYSICAL_MAP;this.mapTypeByName.G_MAPMAKER_NORMAL_MAP=G_MAPMAKER_NORMAL_MAP;this.mapTypeByName.G_MAPMAKER_HYBRID_MAP=G_MAPMAKER_HYBRID_MAP;this.mapTypeByName.G_MOON_ELEVATION_MAP=G_MOON_ELEVATION_MAP;this.mapTypeByName.G_MOON_VISIBLE_MAP= G_MOON_VISIBLE_MAP;this.mapTypeByName.G_MARS_ELEVATION_MAP=G_MARS_ELEVATION_MAP;this.mapTypeByName.G_MARS_VISIBLE_MAP=G_MARS_VISIBLE_MAP;this.mapTypeByName.G_MARS_INFRARED_MAP=G_MARS_INFRARED_MAP;this.mapTypeByName.G_SKY_VISIBLE_MAP=G_SKY_VISIBLE_MAP;this.mapTypeByName.G_SATELLITE_3D_MAP=G_SATELLITE_3D_MAP;this.mapTypeByName.OPEN_STREET_MAP_TYPE=OPEN_STREET_MAP_TYPE};this.getMapTypeByName=function(b){var a=null;null!=b&&(null==this.mapTypeByName&&this.initMapTypeByName(),a=this.mapTypeByName[b]); return a};this.getMapTypeName=function(b){if(null!=b){if(b==G_NORMAL_MAP)return"G_NORMAL_MAP";if(b==G_SATELLITE_MAP)return"G_SATELLITE_MAP";if(b==G_HYBRID_MAP)return"G_HYBRID_MAP";if(b==G_PHYSICAL_MAP)return"G_PHYSICAL_MAP";if(b==G_MAPMAKER_NORMAL_MAP)return"G_MAPMAKER_NORMAL_MAP";if(b==G_MAPMAKER_HYBRID_MAP)return"G_MAPMAKER_HYBRID_MAP";if(b==G_MOON_ELEVATION_MAP)return"G_MOON_ELEVATION_MAP";if(b==G_MOON_VISIBLE_MAP)return"G_MOON_VISIBLE_MAP";if(b==G_MARS_ELEVATION_MAP)return"G_MARS_ELEVATION_MAP"; if(b==G_MARS_VISIBLE_MAP)return"G_MARS_VISIBLE_MAP";if(b==G_MARS_INFRARED_MAP)return"G_MARS_INFRARED_MAP";if(b==G_SKY_VISIBLE_MAP)return"G_SKY_VISIBLE_MAP";if(b==G_SATELLITE_3D_MAP)return"G_SATELLITE_3D_MAP";if(b==OPEN_STREET_MAP_TYPE)return"OPEN_STREET_MAP_TYPE"}return null};this.getMapTypeNumber=function(b){if(null!=b){if(b==G_NORMAL_MAP)return 0;if(b==G_SATELLITE_MAP)return 1;if(b==G_HYBRID_MAP)return 2;if(b==G_PHYSICAL_MAP)return 3;if(b==G_MAPMAKER_NORMAL_MAP)return 4;if(b==G_MAPMAKER_HYBRID_MAP)return 5; if(b==G_MOON_ELEVATION_MAP)return 6;if(b==G_MOON_VISIBLE_MAP)return 7;if(b==G_MARS_ELEVATION_MAP)return 8;if(b==G_MARS_VISIBLE_MAP)return 9;if(b==G_MARS_INFRARED_MAP)return 10;if(b==G_SKY_VISIBLE_MAP)return 11;if(b==G_SATELLITE_3D_MAP)return 12;if(b==OPEN_STREET_MAP_TYPE)return 13}return null}} function CGroup(b,a,e,c,d,g,f,h){this.ID=g_tools.GetID();this.aFilters=[];this.filterText=null;this.AlwaysVisible=!0;this.ParentGroup=this.Name=null;this.PercentBarrier=0;this.ShowSubGroups=this.Show=!0;this.PntCenter=this.PntSW=this.PntNE=null;this.aMapObjects=[];this.aGroups=[];this.aVisibleObjects=[];this.isEmpty=this.isLoading=!1;this.loadingGFX=null;this.isVisible=!1;this.isLoaded=function(){return this.isEmpty||1<this.aMapObjects.length||0<this.aGroups.length};this.showGroupLoading=function(){if(null!= this.PntNE&&null!=this.PntSW&&null==this.loadingGFX){var a=new GLatLng(this.PntNE.lat(),this.PntSW.lng()),a=[this.PntSW,new GLatLng(this.PntSW.lat(),this.PntNE.lng()),this.PntNE,a,this.PntSW];this.loadingGFX=new GPolygon(a,"#000000",2,0.25,"#FF9933",0.15);g_map.addOverlay(this.loadingGFX)}};this.hideGroupLoading=function(){null!=this.loadingGFX&&(g_map.removeOverlay(this.loadingGFX),this.loadingGFX=null)};this.RefreshMap=function(){if(null!=g_map&&null!=this.PntNE&&null!=this.PntSW){this.isVisible= !0;var a=g_map.getBounds(),b=a.getSouthWest(),c=a.getNorthEast(),b=b.lat();c.lat();var c=g_tools.CalculateFillRate(this.PntSW.lat(),this.PntSW.lng(),this.PntNE.lat(),this.PntNE.lng()),e=this.aMapObjects;if("embedded"!=g_MapCtrl.getMapSize()&&this instanceof CGroup&&"default"!=this.Name&&"GLOBALS"!=this.Name&&0<c&&c>=this.PercentBarrier){if(!1===this.isLoaded()&&null==g_QueryServer[this.Name]){g_QueryServer[this.Name]=!0;g_QueryServer.push(this.Name.replace(";","_"));this.showGroupLoading();this.isLoading= !0;return}if(!0===this.isEmpty){if(0==this.aMapObjects.length&&0==this.aGroups.length)return}else if(!1===this.isLoaded())return}this.isLoaded()&&null!=this.loadingGFX&&this.hideGroupLoading();"default"!=this.Name&&c>=this.PercentBarrier&&null==g_visibleGroups[this.Name]&&(g_visibleGroups.push(this),g_visibleGroups[this.Name]=!0);if(g_MapCtrl.IsFilteredOut(this))this.RemoveFromMap();else{var d=g_tools.BinarySearch(e,b);if(null!=d){for(var g=[],f=[],b=[],h=d;h<e.length&&0<=h;h++)if(d=e[h],null!=d&& (d=d[1],null!=d&&null==g[d.ID])){g[d.ID]=d;var l=d.getBounds(),m=a.containsBounds(l),n=a.intersects(l);if(null!=l&&(!0===m||!0===n))d instanceof CGroup?"default"!=d.Name&&d.Name!=this.Name&&(f[f.length]=d):g_tools.IsMapObject(d)&&!g_MapCtrl.IsFilteredOut(d)&&(b[b.length]=d)}a=[];e=!1;for(g=0;g<f.length;g++)d=f[g],c>=this.PercentBarrier?(e=!0,d.RefreshMap(),a[d.ID]=d):d.RemoveFromMap();for(c=0;c<b.length;c++)if(d=b[c],!0==this.AlwaysVisible||!1==e)d.AddOverlay(),a[d.ID]=d;if(null!=this.aVisibleObjects&& 0<this.aVisibleObjects.length)for(var q in this.aVisibleObjects)d=this.aVisibleObjects[q],null!=d&&null==a[d.ID]&&(d instanceof CGroup?d.RemoveFromMap():g_tools.IsMapObject(d)&&d.RemoveOverlay());this.aVisibleObjects=a}"default"===this.Name&&"embedded"!=g_MapCtrl.getMapSize()&&(g_MapCtrl.cleanGroupQueryList(),0<g_QueryServer.length&&!g_QueryingServer&&(g_QueryingServer=!0,g_MapCtrl.queryServer()),this.manageFilters())}}};this.renderFilters=function(a,b){if(null!=a&&0<a.length){for(var c={".filterText":"name", ".CustomCheckBox@onclick":"onclick"},e=jQuery(".filterTable"),d=jQuery(e).find("tr:first").hide(),e=e.find("tbody"),g=[],f=jQuery(".filterTable tr:not(:first)"),h=0;h<f.length;h+=1){var l=f[h],m=jQuery(l).find(".CustomCheckBox")[0];!0===m.checked?g[m.groupName]=l:jQuery(l).remove()}for(h=0;h<a.length;h+=1)null!=a[h]&&(null==g[a[h].groupName]?(f=a[h],l=d.clone(),l.show(),m=jQuery(l).find(".CustomCheckBox")[0],e.append(l),null!=b&&null!=b[f.category]&&void 0!=b[f.category]?jQuery(l).find(".filterCheckbox").css("margin-left", b[f.category]):jQuery(l).find(".filterCheckbox").css("margin-left","0"),l.render(f,c),m.groupName=f.groupName):(l=g[a[h].groupName],0<h?(m=jQuery(".filterTable tr:last")[0],m!=l&&jQuery(l).insertAfter(m),null!=b&&null!==b[a[h].category]&&void 0!==b[a[h].category]?jQuery(l).find(".filterCheckbox").css("margin-left",b[a[h].category]):jQuery(l).find(".filterCheckbox").css("margin-left","0")):jQuery(l).find(".filterCheckbox").css("margin-left","0")));jQuery(".filterTable").show()}else jQuery(".filterTable").hide()}; this.generateFiltersData=function(a,b){var c=null;if(null!=a&&0<a.length&&null!=b)for(var c=[],e=0;e<a.length;e+=1){var d=a[e];if(null!=d){var f={category:b,value:d.Name},f=JSON.stringify(f).replace(/"/g,"'");c[e]={name:d.filterText,onclick:"this.groupName = '"+d.Name+"'; toggleJsCheckboxState(this,false,true,\"g_Comm.AddInvertedFilter("+f+');","g_Comm.RemoveInvertedFilter('+f+');")',groupName:d.Name,group:d,category:b}}}return c};this.checkActiveFilters=function(a){var b=null;if(null!=a&&null!=g_MapCtrl.aInvertedFilters&& 0<g_MapCtrl.aInvertedFilters.length)for(var c=0;c<g_MapCtrl.aInvertedFilters.length;c+=1)if(null!=g_MapCtrl.aInvertedFilters[c])for(var e=0;e<g_MapCtrl.aInvertedFilters[c].length;e+=1)if(null!=g_MapCtrl.aInvertedFilters[c][e]){var d=g_MapCtrl.GetGroup(g_MapCtrl.aInvertedFilters[c][e].value);null!=d&&d.Name.match(a)&&(null==b&&(b=[]),b.push(d),b[d.Name]=d)}return b};this.manageFilters=function(){if(0<jQuery(".filterTable").length){var a=[],b=[],c=this.checkActiveFilters(/^STAGE;.*$/),e=this.checkActiveFilters(/^RALLY;.*$/), d=null!=c||null!=e;null==c&&(c=[]);null==e&&(e=[]);if(0<e.length||0<c.length||0<g_visibleGroups.length){for(var f=0;f<g_visibleGroups.length;f+=1)null==c[g_visibleGroups[f].Name]&&g_visibleGroups[f].Name.match(/^STAGE;.*$/)?c.push(g_visibleGroups[f]):null==e[g_visibleGroups[f].Name]&&g_visibleGroups[f].Name.match(/^RALLY;.*$/)&&(e.push(g_visibleGroups[f]),e[g_visibleGroups[f].Name]=g_visibleGroups[f]);if(d||null!=e&&1<e.length&&8>e.length)e=this.generateFiltersData(e,"RALLY"),null!=e&&(a=a.concat(e), b.STAGE="5px");if(d||null!=c&&1<c.length&&8>c.length)c=this.generateFiltersData(c,"STAGE"),null!=c&&(a=a.concat(c));a=a.sort(function(a,c){var b=!1;null!=a&&null!=c&&(b="RALLY"==a.category&&a.category==c.category?a.groupName>c.groupName:"STAGE"==a.category&&a.category==c.category?a.group.ParentGroup==c.group.ParentGroup?a.name>c.name:a.group.ParentGroup>c.group.ParentGroup:"STAGE"==a.category?a.group.ParentGroup>c.groupName:a.groupName>c.group.ParentGroup);return b})}this.renderFilters(a,b);g_MapCtrl.resizeMap()}g_visibleGroups= []};this.RemoveFromMap=function(){if(!0===this.isVisible){this.isVisible=!1;for(var a in this.aVisibleObjects){var c=this.aVisibleObjects[a];c instanceof CGroup?c.RemoveFromMap():g_tools.IsMapObject(c)&&c.RemoveOverlay()}}};this.getBounds=function(){var a=null;null!=this.PntSW&&null!=this.PntNE&&(a=new GLatLngBounds(this.PntSW,this.PntNE));return a};this.getSWPoint=function(){return this.PntSW};this.getNEPoint=function(){return this.PntNE};this.InsertMapObj=function(){};this.SetBounds=function(a, c){if(this.PntNE||this.PntSW){var b=this.PntSW.lat(),e=this.PntSW.lng();a.lat()<this.PntSW.lat()&&(b=a.lat());a.lng()<this.PntSW.lng()&&(e=a.lng());this.PntSW=new GLatLng(b,e);b=this.PntNE.lat();e=this.PntNE.lng();a.lat()>this.PntNE.lat()&&(b=a.lat());a.lng()>this.PntNE.lng()&&(e=a.lng());this.PntNE=new GLatLng(b,e)}else this.PntSW=a,this.PntNE=c;this.RefreshParentGroup()};this.UpdateGroupBounds=function(a,c){if(null!=a&&null!=c){var b=!1,e,d,f,g;null==this.PntSW||null==this.PntNE?(e=a.lat(),d=a.lng(), f=c.lat(),g=c.lng(),b=!0):(e=this.PntSW.lat(),d=this.PntSW.lng(),f=this.PntNE.lat(),g=this.PntNE.lng(),a.lat()<e&&(b=!0,e=a.lat()),a.lng()<d&&(b=!0,d=a.lng()),c.lat()>f&&(b=!0,f=c.lat()),c.lng()>g&&(b=!0,g=c.lng()));b&&(this.PntSW=g_tools.GetPoint(e,d),this.PntNE=g_tools.GetPoint(f,g),this.RefreshParentGroup())}};this.RefreshParentGroup=function(){var a=this.GetParentGroup();null!=a&&a.AddSubGroup(this)};this.GetParentGroup=function(){var a=this.ParentGroup;null==a&&(a="default");return g_MapCtrl.GetGroup(a)}; this.RemoveMapObject=function(a){a&&(a=g_tools.BinarySearch(this.aMapObjects,a.getSWPoint().lat()),null!=a&&null!=this.aMapObjects[a]&&(this.aMapObjects=g_tools.RemoveArrayElement(this.aMapObjects,a)))};this.AddMapObject=function(a){if(null!=a){var c=g_tools.InsertObject(this.aMapObjects,a,a.getSWPoint().lat()),c=g_tools.InsertObject(c[1],a,a.getNEPoint().lat());this.aMapObjects=c[1];this.UpdateGroupBounds(a.getSWPoint(),a.getNEPoint());this.isEmpty=!1}this.isLoading=!1;null!=this.loadingGFX&&this.hideGroupLoading()}; this.AddSubGroup=function(a){if(null!=a){var c=this.aGroups[a.Name];if(null!=c&&2<c.length){var b=g_tools.BinarySearch(this.aMapObjects,c[0]);null!=b&&b<this.aMapObjects.length&&this.aMapObjects[b][0]==c[0]&&null!=this.aMapObjects[b][1]&&this.aMapObjects[b][1].Name==a.Name&&g_tools.RemoveArrayElement(this.aMapObjects,b);c[0]!=c[1]&&(b=g_tools.BinarySearch(this.aMapObjects,c[1]),null!=b&&b<this.aMapObjects.length&&this.aMapObjects[b][0]==c[1]&&null!=this.aMapObjects[b][1]&&this.aMapObjects[b][1].Name== a.Name&&g_tools.RemoveArrayElement(this.aMapObjects,b))}c=[];c[0]=a.PntSW.lat();c[1]=a.PntNE.lat();c[2]=a;this.aGroups[a.Name]=c;c=g_tools.InsertObject(this.aMapObjects,a,a.PntSW.lat());this.aMapObjects=g_tools.InsertObject(c[1],a,a.PntNE.lat())[1];this.UpdateGroupBounds(a.PntSW,a.PntNE);this.isEmpty=!1}this.isLoading=!1;null!=this.loadingGFX&&this.hideGroupLoading()};this.Constructor=function(a,c,b,e,d,f,g,h){this.Name=a;this.filterText=h;this.ParentGroup=c;null!=d&&d instanceof Array&&(this.aFilters= d,null!=a&&(this.aFilters[a]=!0));null!=b&&(this.PercentBarrier=parseFloat(b));null!=f&&(this.Show="false"==f?!1:!0);null!=g&&(this.ShowSubGroups="false"==g?!1:!0);null!=e&&(this.AlwaysVisible="false"==e?!1:!0)};this.Constructor(b,a,e,c,d,g,f,h)} function CMapObject(b,a,e){this.MapObjectID=this.LatestGeneration=this.GroupName=this.Me=null;this.GetMe=function(){return this.LatestGeneration.Me};this.SetMe=function(a){this.LatestGeneration.Me=a};this.AddOverlay=function(){};this.RemoveOverlay=function(){};this.generateMapObject=function(){};this.RemoveFromMap=function(){};this.getSWPoint=function(){};this.getNEPoint=function(){};this.getGroup=function(){return g_MapCtrl.GetGroup(this.GroupName)};this.getParentGroup=function(){var a=g_MapCtrl.GetGroup(this.GroupName); return null!=a?a.GetParentGroup():null};this.Constructor=function(a,b,e){null!=a&&(this.LatestGeneration=b);null!=b&&null!=this.LatestGeneration&&(this.LatestGeneration.GroupName=a);this.MapObjectID=e};this.Constructor(b,a,e)} function CCustomZoomSliderControl(){this.divSliderBarBackground=this.divSliderBar=this.divSlider=this.divButtonDown=this.divButtonUp=this.div=null;this.slotHeight=8;this.buttonHeight=25;this.slotCount=18;this.actSlot=-999;this.mY=0;this.sliderInMotion=!1;this.curSliderPos=null;this.mouseIsOverControl=this.leftMouseKeyPressed=!1;this.OnMainDivMouseOver=function(){g_customZoomSliderControl.mouseIsOverControl=!0;document.onmousemove=g_customZoomSliderControl.OnMouseMove;document.onmouseup=g_customZoomSliderControl.OnMouseUp}; this.OnMainDivMouseOut=function(){g_customZoomSliderControl.mouseIsOverControl=!1;g_customZoomSliderControl.leftMouseKeyPressed||(document.onmousemove=null,document.onmouseup=null)};this.OnMouseUp=function(){g_customZoomSliderControl.leftMouseKeyPressed=!1;g_customZoomSliderControl.sliderInMotion=!1;g_customZoomSliderControl.mouseIsOverControl||(document.onmousemove=null,document.onmouseup=null);g_customZoomSliderControl.divSliderBar.className="sliderBarDIV sliderBarDIVDefaultMouseCursor"};this.CalcMouseCoords= function(b){var a=b.clientX+document.body.scrollLeft-document.body.clientLeft,e=b.clientY+document.body.scrollTop-document.body.clientTop;if(b.pageX||b.pageY)a=b.pageX,e=b.pageY;return{x:a,y:e}};this.OnMouseMove=function(b){b=b||window.event;b=g_customZoomSliderControl.CalcMouseCoords(b);g_customZoomSliderControl.mY=b.y;g_customZoomSliderControl.sliderInMotion&&g_customZoomSliderControl.MoveSliderByMousePos()};this.OnSliderMouseDown=function(){g_customZoomSliderControl.leftMouseKeyPressed=!0;g_customZoomSliderControl.sliderInMotion= !0;g_customZoomSliderControl.divSliderBar.className="sliderBarDIV sliderBarDIVClosedHand"};this.MoveSliderByMousePos=function(){var b=this.mY;if(null!=b){var a=g_tools.getElementAbsolutePosition(this.divSliderBar).y;this.MoveSliderToRelativePosition(b-a)}};this.MoveSliderToRelativePosition=function(b){if(null!=b){var a=this.getSliderBarHeight(),e=null;0<=b&&b<=a?e=b:0>b?e=0:b>=a&&(e=a-this.slotHeight);b=this.slotCount-parseInt(e/this.slotHeight);b!=this.actSlot&&null!=e&&(a=e%this.slotHeight,e-=a, a/this.slotHeight>=this.slotHeight&&(e+=this.slotHeight),this.divSlider.style.top=e+this.buttonHeight+"px",g_map.getZoom()!=b-1&&0<=b-1&&g_map.setZoom(b-1));this.actSlot=b}};this.SetSliderPosBySlot=function(b){this.MoveSliderToRelativePosition(this.getSliderBarHeight()-(b+1)*this.slotHeight)};this.SlideUp=function(){g_map.zoomIn()};this.SlideDown=function(){g_map.zoomOut()};this.OnSliderBarClick=function(){g_customZoomSliderControl.MoveSliderByMousePos()};this.getDownButtonTop=function(){return this.getSliderBarHeight()+ this.buttonHeight};this.getSliderBarHeight=function(){return this.slotHeight*this.slotCount};this.getControlHeight=function(){return 2*this.buttonHeight+this.getSliderBarHeight()};this.OnMapTypeChanged=function(){var b=g_map.getCurrentMapType();b.getMinimumResolution();this.slotCount=b.getMaximumResolution()+1;this.divSliderBarBackground.style.height=this.getSliderBarHeight()+"px";this.divSliderBar.style.height=this.getSliderBarHeight()+"px";this.actSlot=-1;this.SetSliderPosBySlot(g_map.getZoom())}; this.init=function(b){b=b.getContainer();this.div=document.createElement("div");this.div.className="zoomSliderControlMainDiv";this.div.style.minheight=this.getControlHeight()+"px";this.div.onmouseover=this.OnMainDivMouseOver;this.div.onmouseout=this.OnMainDivMouseOut;this.divButtonUp=document.createElement("div");this.divButtonUp.className="sliderUpDIV";this.divButtonUp.onclick=this.SlideUp;this.divButtonUp.style.height=this.buttonHeight+"px";this.div.appendChild(this.divButtonUp);this.divSliderBarBackground= document.createElement("div");this.divSliderBarBackground.className="sliderBarBackgroundDIV";this.divSliderBarBackground.style.height=this.getSliderBarHeight()+"px";this.div.appendChild(this.divSliderBarBackground);this.divSliderBar=document.createElement("div");this.divSliderBar.className="sliderBarDIV sliderBarDIVDefaultMouseCursor";this.divSliderBar.onclick=this.OnSliderBarClick;this.divSliderBar.style.height=this.getSliderBarHeight()+"px";this.divSliderBarBackground.appendChild(this.divSliderBar); this.divSlider=document.createElement("div");this.divSlider.className="sliderDIV";this.divSlider.onmousedown=this.OnSliderMouseDown;this.divSlider.style.height=this.slotHeight+"px";this.div.appendChild(this.divSlider);this.divButtonDown=document.createElement("div");this.divButtonDown.className="sliderDownDIV";this.divButtonDown.onclick=this.SlideDown;this.divButtonDown.style.height=this.buttonHeight+"px";this.div.appendChild(this.divButtonDown);b.appendChild(this.div);return this.div}} CCustomZoomSliderControl.prototype=new GControl(!1,!1);CCustomZoomSliderControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(25,50))};CCustomZoomSliderControl.prototype.initialize=function(b){return this.init(b)};CCustomZoomSliderControl.prototype.printable=function(){return!1};CCustomZoomSliderControl.prototype.selectable=function(){return!1}; function CCustomSmallZoomControl(){this.divButtonDown=this.divButtonUp=this.div=null;this.SlideUp=function(){g_map.zoomIn()};this.SlideDown=function(){g_map.zoomOut()};this.init=function(b){b=b.getContainer();this.div=document.createElement("div");this.div.className="zoomSliderControlMainDiv";this.div.style.minheight="50px";this.divButtonUp=document.createElement("div");this.divButtonUp.className="sliderUpDIV";this.divButtonUp.onclick=this.SlideUp;this.divButtonUp.id="mapDivButtonUp";this.divButtonUp.innerHTML= "+";this.div.appendChild(this.divButtonUp);this.divButtonDown=document.createElement("div");this.divButtonDown.className="sliderDownDIV";this.divButtonDown.onclick=this.SlideDown;this.divButtonDown.id="mapDivButtonDown";this.divButtonDown.innerHTML="-";this.div.appendChild(this.divButtonDown);b.appendChild(this.div);return this.div}}CCustomSmallZoomControl.prototype=new GControl(!1,!1); CCustomSmallZoomControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(10,5))};CCustomSmallZoomControl.prototype.initialize=function(b){return this.init(b)};CCustomSmallZoomControl.prototype.printable=function(){return!1};CCustomSmallZoomControl.prototype.selectable=function(){return!1}; function COpenBigMapButtonControl(){this.openBigMapButton=null;this.OnOpenBigMapButtonClick=function(){parent.location="/RallyMaps/karte"};this.init=function(b){b=b.getContainer();this.buttonCount=0;var a=document.createElement("img");a.title="humppa";a.src="/RallyMaps/graphics/dave/map/MapControlNavigationButtonSmallTransparent.png";this.openBigMapButton=document.createElement("div");this.openBigMapButton.className="mapOpenBigMapControlButtonDiv";this.openBigMapButton.onclick=function(){null!=g_openBigMapButtonControl&& g_openBigMapButtonControl.OnOpenBigMapButtonClick()};this.openBigMapButton.appendChild(a);b.appendChild(this.openBigMapButton);return this.openBigMapButton}}COpenBigMapButtonControl.prototype=new GControl(!1,!1);COpenBigMapButtonControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,10))};COpenBigMapButtonControl.prototype.initialize=function(b){return this.init(b)};COpenBigMapButtonControl.prototype.printable=function(){return!1}; COpenBigMapButtonControl.prototype.selectable=function(){return!1};function CCustomLogo(b){this.div=null;this.divCSSClass=b;this.href=null;this.init=function(a){if(a)return a=a.getContainer(),this.div=document.createElement("div"),this.div.className=this.divCSSClass,this.href=document.createElement("a"),this.href.setAttribute("href",g_MapCtrl.getMapLink()),this.href.setAttribute("target","_blank"),this.href.appendChild(this.div),a.appendChild(this.href),this.href}} CCustomLogo.prototype=new GControl(!1,!1);CCustomLogo.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,15))};CCustomLogo.prototype.initialize=function(b){return this.init(b)};CCustomLogo.prototype.printable=function(){return!1};CCustomLogo.prototype.selectable=function(){return!1}; function CLoadingOverlay(b){this.div=null;this.divCSSClass=b;this.init=function(a){if(a)return a=a.getContainer(),this.div=document.createElement("div"),this.div.className=this.divCSSClass,this.div.setAttribute("id","map_loader_div"),a.appendChild(this.div),this.div};this.hide=function(){this.div.style.display="none"};this.show=function(){this.div.style.display="block"}}CLoadingOverlay.prototype=new GControl(!1,!1); CLoadingOverlay.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,30))};CLoadingOverlay.prototype.initialize=function(b){return this.init(b)};CLoadingOverlay.prototype.printable=function(){return!1};CLoadingOverlay.prototype.selectable=function(){return!1}; function CStreetViewOverlay(b){this.mapOverlay=new CMapOverlay("StreetViewOverlayContainer",new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(12,40)));this.dragger=b;this.closeOverlay=function(){this.dragger.removeStreetViewMapOverlay();this.mapOverlay.hide()};b=jQuery("#StreetViewOverlayContainer .customInfoWindowCloseButton")[0];b.streetViewOverlay=this;b.overlayInstance=this.mapOverlay;this.hide=function(){this.mapOverlay.hide()};this.show=function(){this.mapOverlay.show()};this.isShow=function(){return this.mapOverlay.isShow()}; this.init=function(a,b){this.mapOverlay.init(a,b)};this.getPanPoint=function(){};this.getBounds=function(){returnval={bounds:null,center:null};var a=g_map.getBounds(),b=a.getSouthWest(),a=a.getNorthEast(),c=7*((a.lat()-b.lat())/100),d=5*((a.lng()-b.lng())/100),b=new GLatLng(b.lat()+c,b.lng()+d),a=new GLatLng(a.lat()-c,a.lng()-d),g=new GLatLng(a.lat(),b.lng()),f=new GLatLng(b.lat(),a.lng()),h=new GSize(530,410),j=g_map.getSize(),i=new GPoint;i.x=j.width-this.mapOverlay.controlPosition.offset.width- h.width;i.y=this.mapOverlay.controlPosition.offset.height;var k=new GPoint;k.x=i.x;k.y=i.y+h.height;h=new GPoint;h.x=j.width;h.y=k.y;i=g_map.fromContainerPixelToLatLng(i);i=new GLatLng(g.lat(),i.lng()-d);k=g_map.fromContainerPixelToLatLng(k);k=new GLatLng(k.lat()-c,i.lng());g_map.fromContainerPixelToLatLng(h);h=new GLatLng(k.lat(),a.lng());returnval.bounds=new GPolygon([b,g,i,k,h,f,b]);returnval.center=new GLatLng(b.lat()+(i.lat()-b.lat())/2,b.lng()+(i.lng()-b.lng())/2);return returnval}} function CStreetViewClient(){this.getNearestPanorama=function(b,a,e){window._1rge46r3uo=function(a){if(void 0===a)a={},a.code=GStreetviewClient.ReturnValues.NO_NEARBY_PANO,a.query=b.lat()+","+b.lng();else{a.Location.latlng=new GLatLng(a.Location.lat,a.Location.lng);a.Location.pov={yaw:void 0,pitch:void 0,zoom:void 0};a.location=a.Location;a.copyright=a.Data.copyright;for(var d=0;d<a.Links.length;d+=1)a.Links[d].yaw=parseFloat(a.Links.yawDeg);a.links=a.Links;a.code=GStreetviewClient.ReturnValues.SUCCESS}e(a); window._1rge46r3uo=void 0};a="http://maps.google.com/cbk?output=json&oe=utf-8&cb_client=api&ll="+b.lat()+"%2C"+b.lng()+"&radius="+a+"&callback=_1rge46r3uo";loadjscssfile(a,"JS")}} function CStreetView(b){this.map=b;this.markerDragger=this.dragger=null;this.controlOverlay=new CMapOverlay("streetViewGrabber",new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(26,12)));this.controlOverlay.show();(new CMapOverlay("StreetViewAnnouncmentContainer",new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(57,14)))).show();this.controlOverlay.mainDIV.onmouseout=function(){jQuery(".streetViewGrabber").toggleClass("DisHover",!1);this.dragger.moveTo(new GPoint(0,0));this.dragger.setDraggableCursor("move"); jQuery(".streetViewGrabberHidden")[0].style.height="34px";jQuery(".streetViewGrabberHidden")[0].style.width="26px"};this.controlOverlay.mainDIV.onmouseoutFunction=this.controlOverlay.mainDIV.onmouseout;this.init=function(a){var b=jQuery(".streetViewGrabberHidden")[0],c=new GDraggableObject(b,{draggingCursor:"auto",draggableCursor:"move"});this.dragger=c;this.controlOverlay.mainDIV.dragger=this.dragger;c.map=a;c.me=b;c.parent=this;c.guy=jQuery(".streetViewGrabberHidden .streetViewGuyContainer")[0]; c.guyIsVisible=!1;c.lastPosition={left:0,top:0};c.streetViewOverlay=new GStreetviewOverlay;c.streetViewOverlay.parent=c;c.streetViewClient=new CStreetViewClient;c.timerID=null;c.guyMarker=null;c.arrowMarker=null;c.streetViewMapOverlay=new CStreetViewOverlay(c);c.streetviewPanorama=null;c.getCurrentPosition=function(){var a=jQuery(this.me).position();a.left+=c.parent.controlOverlay.controlPosition.offset.width;a.top+=c.parent.controlOverlay.controlPosition.offset.height;var b=new GPoint(a.left+30, a.top+60),b=this.map.fromContainerPixelToLatLng(b);return{position:a,latlng:b}};c.drawArrowMarker=function(a,b){if(null!=a&&null!=b){var c=this.parent.getMarkerOrientation(b),c=new GMarker(a,{icon:this.parent.getArrowIcon(c),draggable:!1});c.clearEvents=function(){GEvent.clearInstanceListeners(this)};c.map=this.map;c.parent=this;c.destroy=function(){this.clearEvents();this.map.removeOverlay(this);this.parent.arrowMarker=null};this.map.addOverlay(c);null!=this.arrowMarker&&(this.map.removeOverlay(this.arrowMarker), this.arrowMarker.clearEvents());this.arrowMarker=c}};c.refreshGuyMarker=function(){var a=this.streetviewPanorama.getLatLng(),b=this.parent.getMarkerOrientation(this.streetviewPanorama.getPOV().yaw),a=new GMarker(a,{icon:this.parent.getGuyIcon(b),draggable:!0});a.dragger=this;a.clearEvents=function(){GEvent.clearInstanceListeners(this)};a.destroy=function(){this.clearEvents();this.dragger.map.removeOverlay(this);this.dragger.guyMarker.arrowMarker=null};GEvent.addListener(a,"mouseover",function(a){jQuery(".streetViewGrabber").toggleClass("DisHover", !0);jQuery(".streetViewGrabberHidden")[0].style.height="52px";jQuery(".streetViewGrabberHidden")[0].style.width="49px";a=this.dragger.map.fromLatLngToContainerPixel(a);a.x-=51;a.y-=43;this.dragger.moveTo(a);this.dragger.setDraggableCursor("pointer")});this.map.addOverlay(a);null!==this.guyMarker&&(this.map.removeOverlay(this.guyMarker),this.guyMarker.clearEvents());this.guyMarker=a};c.removeStreetViewMapOverlay=function(){null!==c.streetviewPanorama&&(c.streetviewPanorama.remove(),GEvent.clearListeners(c.streetviewPanorama), c.streetviewPanorama=null);null!==c.guyMarker&&c.guyMarker.destroy();null!==c.arrowMarker&&c.arrowMarker.destroy()};this.showPanorama=function(a,b){this.dragger.showPanorama(a,b)};c.showPanorama=function(a,b){null!==a&&null!==b&&(null===c.streetviewPanorama&&(c.streetviewPanorama=new GStreetviewPanorama(jQuery(".GStreetviewPanorama")[0],{enableFullScreen:!0,features:{streetView:!0,userPhotos:!1}}),c.streetviewPanorama.parent=c,c.streetviewPanorama.onPOVChanged=function(){this.parent.refreshGuyMarker(); var a=c.streetViewMapOverlay.getBounds(),b=this.parent.map.getCenter(),e=new GLatLng(this.getLatLng().lat()-a.center.lat(),this.getLatLng().lng()-a.center.lng()),b=new GLatLng(b.lat()+e.lat(),b.lng()+e.lng());g_MapCtrl.PanMapIfPointOutOfSight(this.getLatLng().lat(),this.getLatLng().lng(),!0,a.bounds,b);g_MapCtrl.refreshPermaLink()},GEvent.addListener(c.streetviewPanorama,"yawchanged",c.streetviewPanorama.onPOVChanged),GEvent.addListener(c.streetviewPanorama,"pitchchanged",c.streetviewPanorama.onPOVChanged), GEvent.addListener(c.streetviewPanorama,"zoomchanged",c.streetviewPanorama.onPOVChanged),GEvent.addListener(c.streetviewPanorama,"initialized",c.streetviewPanorama.onPOVChanged),c.streetViewMapOverlay.show()),c.streetviewPanorama.setLocationAndPOV(a,b))};c.onStreetViewQueryDone=function(a,b,e){if(null!==a)if(a.code==GStreetviewClient.ReturnValues.SUCCESS){jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuy").toggleClass("Dis",!1);var h=a.location.latlng,j=new GLatLng(h.lat()+1, h.lng()),j=GeoTools.calcVectorAngle(h,e,h,j);0>GeoTools.getVector(h,e).lng()&&(j=-1*j+360);!0===b?(a=a.location.pov,a.yaw=j,c.showPanorama(h,a),c.resetArrow()):(this.drawArrowMarker(h,j),jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuyGlow, .streetViewGrabberHidden .streetViewGuyContainer .streetViewGuyCircle").css("visibility","hidden"))}else c.disableStreetViewDraggingGuy();else alert("nothing found")};c.disableStreetViewDraggingGuy=function(){null!==this.guyMarker&&this.guyMarker.hide(); this.resetArrow();jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuy").toggleClass("Dis",!0)};c.resetArrow=function(){null!==this.arrowMarker&&this.arrowMarker.destroy();jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuyGlow, .streetViewGrabberHidden .streetViewGuyContainer .streetViewGuyCircle").css("visibility","visible")};c.queryStreetView=function(a,b,e){if(null!=a){var h=c.map.fromLatLngToContainerPixel(a);h.x+=19;h=c.map.fromContainerPixelToLatLng(h); h=parseInt((new GPolyline([a,h])).getLength()/2);40>h&&(h=40);this.streetViewClient.getNearestPanorama(void 0!==e&&null!==e?e:a,h,function(e){c.onStreetViewQueryDone(e,b,a)})}};c.refreshFlyGuy=function(){var a=c.getCurrentPosition().position;jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuy").toggleClass("Dis",!1);if(null!==c.lastPosition){var b=jQuery(".streetViewGrabberHidden .streetViewGuyContainer .streetViewGuy");this.lastPosition.left>a.left?(b.toggleClass("Left",!0),b.toggleClass("Right", !1)):(b.toggleClass("Left",!1),b.toggleClass("Right",!0))}c.lastPosition=a;!1===c.guyIsVisible&&(c.guy.style.display="block",c.guyIsVisible=!0,c.map.addOverlay(c.streetViewOverlay));null!==c.guyMarker&&c.guyMarker.hide()};GEvent.addListener(c,"drag",function(){var a=this.getCurrentPosition().position;this.resetArrow();this.refreshFlyGuy();this.map.fromContainerPixelToLatLng(new GPoint(a.left,a.top+83));this.map.fromContainerPixelToLatLng(new GPoint(a.left+46,a.top));null!==c.timerID&&clearTimeout(c.timerID); c.timeoutHandler=function(){var a=c.getCurrentPosition();this.timerID=null;a.position.left==c.lastPosition.left&&a.position.top==c.lastPosition.top&&c.queryStreetView(a.latlng,!1)};c.timerID=setTimeout(c.timeoutHandler,500)});GEvent.addListener(c,"dragstart",function(){this.refreshFlyGuy();this.parent.controlOverlay.mainDIV.onmouseout=null;this.streetViewMapOverlay.closeOverlay()});GEvent.addListener(c,"dragend",function(){this.parent.controlOverlay.mainDIV.onmouseout=this.parent.controlOverlay.mainDIV.onmouseoutFunction; !0===this.guyIsVisible&&(this.queryStreetView(c.getCurrentPosition().latlng,!0),this.map.removeOverlay(this.streetViewOverlay),this.guy.style.display="none",this.guyIsVisible=!1);this.moveTo(new GPoint(0,0))})};this.getMarkerOrientation=function(a){var b=0;null!=a&&(0>a&&(a+=360),b=Math.round(a/22.5)%16);return b};this.guyIconSpritePositionArray=[new GPoint(49,710),new GPoint(0,34),new GPoint(98,710),new GPoint(98,364),new GPoint(0,364),new GPoint(98,416),new GPoint(98,312),new GPoint(98,796),new GPoint(98, 149),new GPoint(0,710),new GPoint(0,416),new GPoint(98,0),new GPoint(49,364),new GPoint(49,416),new GPoint(49,848),new GPoint(0,848),new GPoint(98,84)];this.getGuyIcon=function(a){var b=new GIcon(G_DEFAULT_ICON);b.imageMap=[26,13,30,14,32,28,27,28,28,36,18,35,18,27,16,26,16,20,16,14,19,13,22,8];b.iconSize=new GSize(49,52);b.iconAnchor=new GPoint(25,35);if(void 0===a||null===a||0>a||16<a)a=16;b.shadow=null;b.sprite={image:"/graphics/dave/map/streetview/streetview-sprite.png",top:this.guyIconSpritePositionArray[a].y, left:this.guyIconSpritePositionArray[a].x};b.infoWindowAnchor=new GPoint(25,5);return b};this.arrowIconSpritePositionArray=[new GPoint(0,149),new GPoint(98,51),new GPoint(0,0),new GPoint(0,469),new GPoint(75,469),new GPoint(30,677),new GPoint(46,900),new GPoint(46,762),new GPoint(49,0),new GPoint(30,501),new GPoint(0,85),new GPoint(49,149),new GPoint(0,762),new GPoint(92,900),new GPoint(0,900),new GPoint(75,501)];this.getArrowIcon=function(a){var b=new GIcon(G_DEFAULT_ICON);b.imageMap=[0,0,49,0,49, 34,0,34];b.iconSize=new GSize(49,34);b.iconAnchor=new GPoint(23,16);if(void 0===a||null===a||0>a||16<a||isNaN(a))a=0;b.shadow=null;b.sprite={image:"/graphics/dave/map/streetview/streetview-sprite.png",top:this.arrowIconSpritePositionArray[a].y,left:this.arrowIconSpritePositionArray[a].x};return b};this.init(this.map)} function CCustomButtonControl(b,a){this.divs=[];this.buttonCSSClass="mapControlButtonDiv";this.buttonCSSClassActive="mapControlButtonDivActive";this.mapLegendButtonCSSClass="mapControlLegendButtonDiv";this.mapLegendButtonCSSClassActive="mapControlLegendButtonDivActive";this.enableButtonsBitMask=b;this.buttonCount=0;this.isRenderLoaderDIV=a;this.LoaderDIV=null;this.SetActiveButton=function(a){if(null!=this.divs&&(null==a&&(a=g_map.getCurrentMapType()),null!=a))for(var b=0;b<this.buttonCount;b+=1)this.divs[b].innerHTML== a.getName()?(this.divs[b].className=this.buttonCSSClassActive,this.divs[b].style.display="none"):"?"!=this.divs[b].innerHTML&&"mapControlSubListContainerDiv"!=this.divs[b].className&&(this.divs[b].className=this.buttonCSSClass,this.divs[b].style.display="block")};this.OnButtonClick=function(a){g_map&&g_map.setMapType(a)};this.init=function(a){null==this.enableButtonsBitMask&&(this.enableButtonsBitMask=1099511627775);if(0<this.enableButtonsBitMask){a=a.getContainer();this.buttonCount=0;var b=1,d=this; this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]=document.createElement("div"),this.divs[this.buttonCount].innerHTML="Karte"==G_NORMAL_MAP.getName()?"Welt":"World",this.divs[this.buttonCount].className=this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){g_MapCtrl&&g_MapCtrl.ShowWorldBoundingBox()},this.buttonCount+=1);b<<=1;this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]=document.createElement("div"),this.divs[this.buttonCount].innerHTML=G_NORMAL_MAP.getName(),this.divs[this.buttonCount].className= this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){d.OnButtonClick(G_NORMAL_MAP)},this.buttonCount+=1);b<<=1;this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]=document.createElement("div"),this.divs[this.buttonCount].innerHTML=G_SATELLITE_MAP.getName(),this.divs[this.buttonCount].className=this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){d.OnButtonClick(G_SATELLITE_MAP)},this.buttonCount+=1);b<<=1;this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]= document.createElement("div"),this.divs[this.buttonCount].innerHTML=G_HYBRID_MAP.getName(),this.divs[this.buttonCount].className=this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){d.OnButtonClick(G_HYBRID_MAP)},this.buttonCount+=1);b<<=1;this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]=document.createElement("div"),this.divs[this.buttonCount].innerHTML=G_PHYSICAL_MAP.getName(),this.divs[this.buttonCount].className=this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){d.OnButtonClick(G_PHYSICAL_MAP)}, this.buttonCount+=1);b<<=1;this.enableButtonsBitMask&b&&(this.divs[this.buttonCount]=document.createElement("div"),this.divs[this.buttonCount].innerHTML=G_SATELLITE_3D_MAP.getName(),this.divs[this.buttonCount].className=this.buttonCSSClass,this.divs[this.buttonCount].onclick=function(){d.OnButtonClick(G_SATELLITE_3D_MAP)},this.buttonCount+=1);if(this.enableButtonsBitMask&b<<1){var b=document.getElementById("AddContextSubMenuContainer"),g=document.getElementById("add_content_submenu");this.divs[this.buttonCount]= document.createElement("div");this.divs[this.buttonCount].className="mapControlSubListContainerDiv";this.divs[this.buttonCount].isDropDown=!0;this.divs[this.buttonCount].isDroped=!1;this.divs[this.buttonCount].dropDown=g;this.divs[this.buttonCount].onmouseover=function(){!1===this.isDroped&&(this.dropDown.style.display="block",this.isDroped=!0)};this.divs[this.buttonCount].onmouseout=function(){!0===this.isDroped&&(this.dropDown.style.display="none");this.isDroped=!1};this.divs[this.buttonCount].appendChild(b); this.buttonCount+=1}this.divs[this.buttonCount]=document.createElement("div");this.divs[this.buttonCount].innerHTML="?";this.divs[this.buttonCount].className=this.mapLegendButtonCSSClass;this.divs[this.buttonCount].onclick=function(){null!=g_MapLegendOverlay&&("big"==g_MapCtrl.getMapSize()?g_MapLegendOverlay.isShow()?g_MapLegendOverlay.hide():g_MapLegendOverlay.show():OpenPopup(customMapLegendPageUrl,"title",495,395,"yes",0))};this.buttonCount+=1;b=document.createElement("div");!0==this.isRenderLoaderDIV&& (this.LoaderDIV=document.createElement("div"),this.LoaderDIV.setAttribute("id","map_button_control_loader_div"),this.LoaderDIV.className="mapLoadingDiv",b.appendChild(this.LoaderDIV));for(g=0;g<this.buttonCount;g+=1)b.appendChild(this.divs[g]);a.appendChild(b);return b}};this.hideLoader=function(){null!=this.LoaderDIV&&(this.LoaderDIV.style.display="none")};this.showLoader=function(){null!=this.LoaderDIV&&"embedded"!=g_MapCtrl.getMapSize()&&(this.LoaderDIV.style.display="block",setTimeout(function(){g_customButtonControl.hideLoader()}, 1E4))};this.isShowLoader=function(){return null!=this.LoaderDIV&&"none"!=this.LoaderDIV.style.display};this.isHideLoader=function(){return!this.isShowLoader()}}CCustomButtonControl.prototype=new GControl(!1,!1);CCustomButtonControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,10))};CCustomButtonControl.prototype.initialize=function(b){return this.init(b)};CCustomButtonControl.prototype.printable=function(){return!1}; CCustomButtonControl.prototype.selectable=function(){return!1}; function CSingleButtonControl(b,a,e,c,d){this.div=null;this.buttonCSSClass="mapControlButtonDiv";this.buttonCSSClassActive="mapControlButtonDivActive";this.distanceFromReferencePoint=new GSize(a,e);this.ReferencePoint=b;this.label=c;this.eventHandler=d;this.init=function(a){a=a.getContainer();this.div=document.createElement("div");this.div.innerHTML=this.label;this.div.className=this.buttonCSSClass;this.div.onclick=this.eventHandler;a.appendChild(this.div);return this.div}} CSingleButtonControl.prototype=new GControl(!1,!1);CSingleButtonControl.prototype.getDefaultPosition=function(){return new GControlPosition(this.ReferencePoint,this.distanceFromReferencePoint)};CSingleButtonControl.prototype.initialize=function(b){return this.init(b)};CSingleButtonControl.prototype.printable=function(){return!1};CSingleButtonControl.prototype.selectable=function(){return!1}; function CCustomInfoWindow(b,a){this.contentUrl=b;this.marker=a;this.gmarker=a.Me;this.infoWindowBounds=this.footerDiv=this.iframe=this.loadingDiv=this.mainAreaDiv=this.customDiv=null;this.markerSize={height:null,width:null};this.contentDivSize={height:null,width:null,offsetX:null,offsetY:null};this.OnCloseInfoWindow=function(){var a=this;null!=g_customInfoWindow&&(a=g_customInfoWindow);a instanceof CCustomInfoWindow&&(g_map.removeOverlay(a),a.iframe.src="",null!=a.customDiv&&null!=a.customDiv.parentNode&& a.customDiv.parentNode.removeChild(a.customDiv),null!=a.footerDiv&&null!=a.footerDiv.parentNode&&a.footerDiv.parentNode.removeChild(a.footerDiv),null!=a.marker&&a.marker.OnInfoWindowClose(a.marker));this.marker&&this.marker.OnInfoWindowClose(this.marker)};this.RedrawDivs=function(){null==this.markerSize.height&&(this.markerSize.height=this.gmarker.getIcon().iconSize.height);var a=g_map.fromLatLngToDivPixel(this.gmarker.getPoint()).y,b=g_map.fromLatLngToDivPixel(this.gmarker.getPoint()).x;null==this.contentDivSize.height&& (this.contentDivSize.height=parseInt(cssRule("."+this.customDiv.className,"min-height")),this.contentDivSize.width=parseInt(cssRule("."+this.customDiv.className,"min-width")));var d=parseInt(this.contentDivSize.width/2),g=this.contentDivSize.height+80+this.markerSize.height,f=a-g-50,h=b+d+50,j=g_map.fromDivPixelToLatLng(new GPoint(b-d-50,a+50)),f=g_map.fromDivPixelToLatLng(new GPoint(h,f));this.infoWindowBounds=new GLatLngBounds(j,f);null!=this.customDiv&&(this.customDiv.style.top=a-g+"px",this.customDiv.style.left= b-d+"px");null!=this.footerDiv&&(this.footerDiv.style.top=a-60-this.markerSize.height+"px",this.footerDiv.style.left=b+"px")};this.initCustomInfoWindow=function(a){if(null!=this.gmarker){var b="customInfoWindowDivRALLY";!0==this.marker.aFilters.CTRYMARKER?b="customInfoWindowDivCTRY":!0==this.marker.aFilters.RALLYMARKER?b="customInfoWindowDivRALLY":!0==this.marker.aFilters.STAGEMARKER?b="customInfoWindowDivSTAGE":!0==this.marker.aFilters.SPECTATORPOINT?b="customInfoWindowDivSPECTATORPOINT":!0==this.marker.aFilters.VIDEO? b="customInfoWindowDivVIDEO":!0==this.marker.aFilters.PHOTO?b="customInfoWindowDivPHOTO":!0==this.marker.aFilters.COLLECTION&&(b="customInfoWindowDivCOLLECTION");this.footerDiv=document.createElement("div");this.footerDiv.className="customInfoWindowFooter";this.customDiv=document.createElement("div");this.mainAreaDiv=document.createElement("div");var d=document.createElement("div");d.className="customInfoWindowCloseButton";d.onclick=this.OnCloseInfoWindow;this.mainAreaDiv.className="customInfoWindowContentDiv"; this.customDiv.className=b;this.loadingDiv=document.createElement("div");this.loadingDiv.className="customInfoWindowLoadingDiv";var b=document.createElement("div"),g=document.createElement("div");b.className="customInfoWindowLoadingImgDiv";g.className="customInfoWindowLoadingTxtDiv";g.innerHTML="loading";var f=parseInt(cssRule("."+this.loadingDiv.className,"height")),h=parseInt(cssRule("."+this.loadingDiv.className,"height")),j=parseInt(cssRule("."+this.customDiv.className,"min-height")),i=parseInt(cssRule("."+ this.customDiv.className,"min-width"));this.loadingDiv.style.left=parseInt((i-h)/2)+"px";this.loadingDiv.style.top=parseInt((j-f)/2)+"px";this.loadingDiv.appendChild(b);this.loadingDiv.appendChild(g);this.iframe=document.createElement("iframe");this.iframe.src=this.contentUrl;this.iframe.allowTransparency="true";this.iframe.frameBorder="0";this.iframe.className="customInfoWindowIframe";this.iframe.style.visibility="hidden";this.mainAreaDiv.appendChild(this.loadingDiv);this.mainAreaDiv.appendChild(this.iframe); this.customDiv.appendChild(d);this.customDiv.appendChild(this.mainAreaDiv);this.RedrawDivs();a=a.getPane(G_MAP_FLOAT_PANE);a.appendChild(this.customDiv);a.appendChild(this.footerDiv);this.marker.OnInfoWindowOpen(this.marker)}};this.OnIframeLoaded=function(){this.mainAreaDiv.removeChild(this.loadingDiv);this.iframe.style.visibility="visible"};this.MoveMapToMakeInfoWindowVisible=function(){var a=g_map.getBounds();if(!a.containsBounds(this.infoWindowBounds)){var b=g_map.fromLatLngToContainerPixel(a.getSouthWest()), d=g_map.fromLatLngToContainerPixel(a.getNorthEast()),g=g_map.fromLatLngToContainerPixel(this.infoWindowBounds.getSouthWest()),f=g_map.fromLatLngToContainerPixel(this.infoWindowBounds.getNorthEast());g_map.getContainer();var h=g_map.fromLatLngToContainerPixel(g_map.getCenter()),j=0;0>f.y?j=f.y:g.y>b.y&&(j=g.y-b.y);b=0;f.x>d.x?b=f.x-d.x:0>g.x&&(b=g.x);d=new GPoint;d.x=h.x+b;d.y=h.y+j;h=g_map.fromContainerPixelToLatLng(d);a.getSouthWest().lng()>a.getNorthEast().lng()&&(h=new GLatLng(h.lat(),this.gmarker.getPoint().lng())); g_map.panTo(h)}}}CCustomInfoWindow.prototype=new GOverlay;CCustomInfoWindow.prototype.initialize=function(b){this.initCustomInfoWindow(b);this.MoveMapToMakeInfoWindowVisible()};CCustomInfoWindow.prototype.redraw=function(){this.RedrawDivs()};CCustomInfoWindow.prototype.remove=function(){}; function CMapOverlay(b,a){this.controlPosition=this.mainDIV=null;this.hide=function(){null!=this.mainDIV&&(this.mainDIV.style.display="none")};this.show=function(){null!=this.mainDIV&&(this.mainDIV.style.display="block")};this.isShow=function(){return null!=this.mainDIV&&"block"==this.mainDIV.style.display};this.init=function(a,b){null!=a&&null!=g_map&&null!=b&&(this.mainDIV=document.getElementById(a),null!=this.mainDIV&&(g_map.getContainer().appendChild(this.mainDIV),b.apply(this.mainDIV),this.controlPosition= b,this.hide()))};this.init(b,a)} function GPSVideoOverlay(){this.mapOverlay=new CMapOverlay("GPSVideoMapOverlayContainer",new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(12,40)));this.hide=function(){try{void 0!=onFlashPlayerClose&&onFlashPlayerClose()}catch(b){}this.mapOverlay.hide();g_MapCtrl.HidePositionArrow(!0)};this.show=function(b){null!=b&&(this.mapOverlay.show(),g_Comm.InvokeBeanMethod("OnLoadVideo",b))};this.isShow=function(){return this.mapOverlay.isShow()};this.init=function(b,a){this.mapOverlay.init(b,a)};this.getBounds= function(){var b=g_map.getBounds(),a=b.getSouthWest(),b=b.getNorthEast(),e=7*((b.lat()-a.lat())/100),c=5*((b.lng()-a.lng())/100),a=new GLatLng(a.lat()+e,a.lng()+c),b=new GLatLng(b.lat()-e,b.lng()-c),d=new GLatLng(b.lat(),a.lng()),g=new GLatLng(a.lat(),b.lng()),f=new GSize(336,343),h=g_map.getSize(),j=new GPoint;j.x=h.width-this.mapOverlay.controlPosition.offset.width-f.width;j.y=this.mapOverlay.controlPosition.offset.height;var i=new GPoint;i.x=j.x;i.y=j.y+f.height;f=new GPoint;f.x=h.width;f.y=i.y; j=g_map.fromContainerPixelToLatLng(j);j=new GLatLng(d.lat(),j.lng()-c);i=g_map.fromContainerPixelToLatLng(i);i=new GLatLng(i.lat()-e,j.lng());g_map.fromContainerPixelToLatLng(f);f=new GLatLng(i.lat(),b.lng());return new GPolygon([a,d,j,i,f,g,a])}} function CStagePositionOverlay(){this.target=this.mapContextMenuDIV=this.markerContextMenuDIV=this.containerDIV=null;this.show=function(b,a){if(null!=b&&null!=a){var e=g_map.fromLatLngToContainerPixel(b);e.x+=5;var e=g_map.fromContainerPixelToLatLng(e),c=a.calcVectorLength(b,e),e=a.calculateDistanceFromPoint(b);if(null!=e&&null!=e.distance&&e.distance<c){g_Comm.ShowPositionArrow(e.linePoint.lat(),e.linePoint.lng());var c=!1,b=g_map.fromLatLngToContainerPixel(b),d=b.x+20,g=b.y+-80;d>g_map.getSize().width- 120&&(d=g_map.getSize().width-120);g>g_map.getSize().height-100&&(g=g_map.getSize().height-100);d=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(d,g));null!=a&&a instanceof GPolyline&&(d.apply(this.containerDIV),c=!0,this.target=a);e={distanceFromStart:(e.distanceFromStart/1E3).toFixed(2)+"km",distanceToFinish:((a.getLength()-e.distanceFromStart)/1E3).toFixed(2)+"km"};$p("#mapStagePositionContainer").autoRender(e);!0==c&&(this.containerDIV.style.display="block")}else this.hide(a)}};this.hide=function(){this.containerDIV.style.display= "none";g_Comm.HidePositionArrow(!1)};this.BuildMarkerContextMenu=function(){};this.BuildMapContextMenu=function(){this.containerDIV=document.getElementById("MapStagePositionMenuOverlayContainer");this.containerDIV.style.display="none";g_map.getContainer().appendChild(this.containerDIV)};this.OnClose=function(){this.target=null;this.hide()};this.init=function(){this.BuildMapContextMenu()};this.init()} function CContextMenu(){this.target=this.mapContextMenuDIV=this.markerContextMenuDIV=this.contextMenuDIV=null;this.show=function(b,a){this.hide();var e=!1,c=b.x,d=b.y;c>g_map.getSize().width-120&&(c=g_map.getSize().width-120);d>g_map.getSize().height-100&&(d=g_map.getSize().height-100);c=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(c,d));null!=a&&a instanceof CMarker&&!0==a.aFilters.CONTENT&&(c.apply(this.contextMenuDIV),e=!0,this.target=a);!0==e&&(this.contextMenuDIV.style.display="block")}; this.hide=function(){this.contextMenuDIV.style.display="none"};this.BuildMarkerContextMenu=function(){};this.BuildMapContextMenu=function(){this.contextMenuDIV=document.getElementById("MapContentContextMenuOverlayContainer");this.contextMenuDIV.style.display="none";g_map.getContainer().appendChild(this.contextMenuDIV)};this.OnClose=function(){this.target=null;this.hide()};this.OnSuggestContentPosition=function(){this.hide();null!=this.target&&(g_Comm.SetSuggestContentPositionContentId(this.target.MarkerID), g_SuggestContentPositionOverlay.show())};this.init=function(){this.BuildMapContextMenu()};this.init()} function CSuggestContentPositionOverlay(){this.baseDIV=null;this.show=function(){this.baseDIV.style.display="block";g_MapCtrl.ClickableMap=!0};this.hide=function(){this.baseDIV.style.display="none";g_MapCtrl.ClickableMap=!1;g_Comm.RemoveUserClickMarker()};this.BuildBaseDIV=function(){this.baseDIV=document.getElementById("SuggestContentPositionMenuOverlayContainer");this.baseDIV.style.display="none";g_map.getContainer().appendChild(this.baseDIV);(new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10, 36))).apply(this.baseDIV)};this.OnClose=function(){this.hide()};this.init=function(){this.BuildBaseDIV()};this.init()} function CAddNewSpectatorPointOverlay(){this.baseDIV=null;this.show=function(){this.baseDIV.style.display="block";g_MapCtrl.ClickableMap=!0;var b=document.getElementById("addSpectatorPointForm:tagsInput");null!=b&&b.click()};this.hide=function(){this.baseDIV.style.display="none";g_MapCtrl.ClickableMap=!1;g_Comm.RemoveUserClickMarker()};this.BuildBaseDIV=function(){this.baseDIV=document.getElementById("AddSpectatorPointMenuOverlayContainer");this.baseDIV.style.display="none";g_map.getContainer().appendChild(this.baseDIV); (new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,36))).apply(this.baseDIV)};this.OnClose=function(){this.hide()};this.init=function(){this.BuildBaseDIV()};this.init()} function CMarker(b,a,e,c,d,g,f,h,j,i,k,o){this.ID=g_tools.GetID();this.MarkerID=null;this.aFilters=[];this.parent=CMapObject.prototype;this.InfoWindowText=this.ToolTipText=this.Point=this.MarkerStyle=null;this.InfoWindowOn="never";this.InfoWindowOpen=this.Dragable=!1;this.onClickCallback=null;this.styleNotFound=!1;this.OpenInfoWindow=function(){"big"==g_MapCtrl.getMapSize()&&p(this)};this.closeInfoWindow=function(){null!=g_customInfoWindow&&(g_customInfoWindow.OnCloseInfoWindow(),g_customInfoWindow.remove(), g_customInfoWindow=null,g_MapCtrl.MarkerInfoWindowOpen=null);g_GPSVideoOverlay.hide()};var p=function(a){"big"==g_MapCtrl.getMapSize()&&"mouseclick"==a.InfoWindowOn?(null!=g_customInfoWindow&&g_customInfoWindow.OnCloseInfoWindow(),g_customInfoWindow=null,null!=g_GPSVideoOverlay&&g_GPSVideoOverlay.isShow()&&g_GPSVideoOverlay.hide(),null!=a.onClickCallback?eval(a.onClickCallback):null!=a.InfoWindowText&&(g_customInfoWindow=new CCustomInfoWindow(a.InfoWindowText,a),g_map.addOverlay(g_customInfoWindow)), g_MapCtrl.MarkerInfoWindowOpen=a):"embedded"==g_MapCtrl.getMapSize()&&(a=a.getGroup(),null!=a&&g_MapCtrl.SetMapCenterDynamicZoominByBounds(a.getBounds()))};this.OnInfoWindowOpen=function(a){a.InfoWindowOpen=!0;g_Comm.SetEventInfoWindowOpen(a.MarkerID)};this.OnInfoWindowClose=function(a){a.InfoWindowOpen=!1;g_MapCtrl.MarkerInfoWindowOpen=null;g_Comm.SetEventInfoWindowClose(a.MarkerID);g_customInfoWindow=null};this.getBounds=function(){var a=null;null!=this.Point&&(a=new GLatLngBounds(this.Point,this.Point)); return a};this.RefreshPoint=function(){this.Me&&(GEvent.clearInstanceListeners(this.Me),g_map.removeOverlay(this.Me),this.Me=null);this.AddOverlay()};this.GenerateIcon=function(a){var b=null;if(null!=a&&null!=a.iconUrl){var c=20,e=34,d=10;null!=a.iconSize&&null!=a.iconSize.width&&null!=a.iconSize.height&&(c=parseInt(a.iconSize.width),e=parseInt(a.iconSize.height),d=parseInt(Math.round(c/2)));b=new GIcon(G_DEFAULT_ICON);b.iconSize=new GSize(c,e);b.iconAnchor=new GPoint(d,e);b.infoWindowAnchor=new GPoint(d, 0);b.infoShadowAnchor=new GPoint(d,0);b.shadow=a.iconShadowUrl;e=c=0;null!=a.iconSpritePosition&&(c=a.iconSpritePosition.x,e=a.iconSpritePosition.y);b.sprite={image:a.iconUrl,top:e,left:c};b.shadowSize=null!=a.iconShadowSize?new GSize(a.iconShadowSize.width,a.iconShadowSize.height):new GSize(0,0)}return a.icon=b};this.ConstructMapObject=function(){var a=g_MapCtrl.GetStyle(this.MarkerStyle);this.styleNotFound&&null!=a&&null!=this.Me&&g_map.removeOverlay(this.Me);if((this.styleNotFound=null==a)&&null== this.Me)a=g_MapCtrl.GetStyle("defaultMarker"),this.styleNotFound=!0;this.Me=a=new GMarker(this.Point,{clickable:!0,draggable:this.Dragable,icon:a.icon,title:this.ToolTipText});if(null!=a){var b=this;GEvent.addListener(a,"click",function(){p(b)});GEvent.addListener(a,"mouseover",function(){g_mouseOverMarker=b;"mouseover"==b.InfoWindowOn&&b.Me.openInfoWindowHtml(b.InfoWindowText)});GEvent.addListener(a,"mouseout",function(){g_mouseOverMarker=null});GEvent.addListener(a,"dragend",function(){b.Point= b.Me.getLatLng();g_MapCtrl.GetGroup(b.GroupName).UpdateGroupBounds(b.Point,b.Point);g_MapCtrl.SetUserMarker(b.Me.getLatLng());g_Comm.SetEventMapClick(b.Me.getLatLng())});g_map.addOverlay(a);!this.styleNotFound&&this.MarkerID==g_openInfoWindow&&(g_openInfoWindow=null,this.OpenInfoWindow())}return a};this.AddOverlay=function(){null!=g_MapCtrl&&!this.InfoWindowOpen&&(this.styleNotFound&&this.RemoveOverlay(),null==this.Me?this.ConstructMapObject():this.Me.show())};this.RemoveOverlay=function(){null!= this.Me&&!this.InfoWindowOpen&&!this.styleNotFound?this.Me.hide():this.styleNotFound&&null!=this.Me&&(g_map.removeOverlay(this.Me),this.Me=null)};this.getSWPoint=function(){return this.Point};this.getNEPoint=function(){return this.Point};this.Constructor=function(a,b,c,e,d,f,g,h,i,j,r,k){this.parent.constructor(a,this,r);this.MarkerStyle=d;this.ToolTipText=g;null!=h&&(this.InfoWindowOn=h);null!=f&&(this.InfoWindowText=f);null!=k&&(this.onClickCallback=k);null!=e&&(this.Dragable=e);null!=b&&null!= c&&(this.Point=new GLatLng(parseFloat(b),parseFloat(c)));null!=i&&(this.aFilters=g_tools.FilterString2FilterArray(i+";MARKER"));this.MarkerID=j;null!=this.MarkerID&&""!=this.MarkerID&&(g_markerTable[this.MarkerID]=this)};this.Constructor(b,a,e,c,d,g,f,h,j,i,k,o)}CMarker.prototype=new CMapObject;CMarker.prototype.constructor=CMarker; function CPolyline(b){this.ID=g_tools.GetID();this.aFilters=[];this.parent=CMapObject.prototype;this.Bounds=this.data=null;this.styleNotFound=!1;this.RemoveOverlay=function(){null!=this.Me&&!this.styleNotFound?this.Me.hide():null!=this.Me&&(g_map.removeOverlay(this.Me),this.Me=null)};this.getBounds=function(){return this.Bounds};this.AddOverlay=function(){null!=g_MapCtrl&&(this.styleNotFound&&this.RemoveOverlay(),null!=this.Me?(this.Me.isHidden(),this.Me.show()):this.ConstructMapObject())};this.getSWPoint= function(){var a=null;null!=this.Bounds&&(a=this.Bounds.getSouthWest());return a};this.getNEPoint=function(){var a=null;null!=this.Bounds&&(a=this.Bounds.getNorthEast());return a};this.ConstructMapObject=function(){var a=null;null!=g_MapCtrl&&(a=g_MapCtrl.GetStyle(this.data.styleName));(this.styleNotFound=null==a)&&(a=g_MapCtrl.GetStyle("defaultPolyline"));this.data.encodingOpts.color=a.color;this.data.encodingOpts.weight=a.width;this.data.encodingOpts.opacity=a.transparency;this.Me=GPolyline.fromEncoded(this.data.encodingOpts); this.Me.mouseOverListener=function(){GEvent.clearListeners(this,"mouseover");null!==g_mouseOverPolyline&&GEvent.addListener(g_mouseOverPolyline,"mouseover",g_mouseOverPolyline.mouseOverListener);g_mouseOverPolyline=this};GEvent.addListener(this.Me,"mouseover",this.Me.mouseOverListener);g_map.addOverlay(this.Me);return this.Me};this.Constructor=function(a){this.data=a;null!=a&&(this.parent.constructor(a.groupName,this,a.mapObjectId),this.Me=this.ConstructMapObject(),this.Me.hide(),null!=this.Me&&(this.Bounds= this.Me.getBounds()),null!=a.filters&&(null!=a.styleName&&a.filters.push(a.styleName),a.filters.push("POLYLINE"),this.aFilters=a.filters))};this.Constructor(b)}CMarker.prototype=new CMapObject;CMarker.prototype.constructor=CPolyline; function CPolygon(b){this.ID=g_tools.GetID();this.parent=CMapObject.prototype;this.aFilters=[];this.Bounds=null;this.styleNotFound=!1;this.RemoveOverlay=function(){null!=this.Me&&!this.styleNotFound?this.Me.hide():(g_map.removeOverlay(this.Me),this.Me=null)};this.getBounds=function(){return this.Bounds};this.AddOverlay=function(){null!=g_MapCtrl&&(this.styleNotFound&&this.RemoveOverlay(),null!=this.Me?this.Me.show():this.ConstructMapObject())};this.getSWPoint=function(){var a=null;null!=this.Bounds&& (a=this.Bounds.getSouthWest());return a};this.getNEPoint=function(){var a=null;null!=this.Bounds&&(a=this.Bounds.getNorthEast());return a};this.ConstructMapObject=function(){var a=null;null!=g_MapCtrl&&(a=g_MapCtrl.GetStyle(this.data.styleName));(this.styleNotFound=null==a)&&(a=g_MapCtrl.GetStyle("defaultPolygon"));this.data.encodedPolygon.color=a.fillColor;this.data.encodedPolygon.opacity=a.fillTransparency;this.data.encodedPolygon.outline=!0;this.data.encodedPolygon.fill=!0;for(var b=0;b<this.data.encodedPolygon.polylines.length;b+= 1)this.data.encodedPolygon.polylines[b].color=a.color,this.data.encodedPolygon.polylines[b].weight=a.width,this.data.encodedPolygon.polylines[b].opacity=a.transparency;this.Me=GPolygon.fromEncoded(this.data.encodedPolygon);g_map.addOverlay(this.Me);return this.Me};this.Constructor=function(a){null!=a&&(this.data=a,this.parent.constructor(a.groupName,this,a.mapObjectId),this.Me=this.ConstructMapObject(),this.Bounds=this.Me.getBounds(),null!=this.Me&&(g_map.addOverlay(this.Me),this.Me.hide()),null!= a.filters&&(null!=a.styleName&&a.filters.push(a.styleName),a.filters.push("POLYGON"),this.aFilters=a.filters))};this.Constructor(b)}CMarker.prototype=new CMapObject;CMarker.prototype.constructor=CPolygon; function initTheMap(b,a,e,c,d,g,f){var h=function(){null!=g_contextMenu&&g_contextMenu.hide()},j=function(a,b){null==a&&(a=g_map.getZoom());null==b&&(b=g_map.getZoom());g_customInfoWindow&&a&&b&&a!=b&&g_customInfoWindow.RedrawDivs();null!=g_customZoomSliderControl&&g_customZoomSliderControl.SetSliderPosBySlot(g_map.getZoom());g_MapCtrl.OnMapMove();g_MapCtrl.RefreshMap();g_MapCtrl.refreshPermaLink()};(function(a,b,c,e,d,f,g){if(GBrowserIsCompatible()&&(g_visibleGroups=[],g_QueryServer=[],g_QueryingServer= !1,g_MapRequestCache=[],g_markerTable=[],g_MapCtrl.resizeMap(),null!=g_container)){void 0==GMap2.prototype.superGetBounds&&(GMap2.prototype.superGetBounds=GMap2.prototype.getBounds);GMap2.prototype.getBounds=function(){var a=this.superGetBounds();if(2>this.getZoom())var a=new GLatLng(-90,-180),b=new GLatLng(90,180),a=new GLatLngBounds(a,b);return a};var l=null,m=null,n=null;"big"==e&&0<jQuery(".googleAdSensePublisherID").length&&(m=jQuery(".googleAdSensePublisherID")[0].value,n=jQuery(".googleAdSenseBigMapChannelID")[0].value, l={googleBarOptions:{style:"new",adsOptions:{client:m,channel:n,adsafe:"high",language:"de"}}});g_map=new GMap2(g_container,l);g_container.style.backgroundColor="gray";g_map.addMapType(OPEN_STREET_MAP_TYPE);g!=G_SATELLITE_3D_MAP&&(null==e&&(e="default"),g_MapLegendOverlay=new CMapOverlay("MapLegendOverlayContainer",new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(12,40))),1==jQuery("#MapStagePositionMenuOverlayContainer").length&&(g_stagePositionOverlay=new CStagePositionOverlay),"small"==e?(g_mapSizeFix= !0,g_customButtonControl=new CCustomButtonControl(26,!0),g_map.addControl(g_customButtonControl),g_customZoomSliderControl=null,g_map.addControl(new CCustomSmallZoomControl)):"embedded"==e?(g_mapSizeFix=!0,g_customButtonControl=new CCustomButtonControl(30,!0),g_map.addControl(g_customButtonControl),g_customZoomSliderControl=null,g_map.addControl(new CCustomSmallZoomControl),g_container.style.backgroundColor="transparent"):"big"==e&&(g_GPSVideoOverlay=new GPSVideoOverlay,g_mapSizeFix=!1,g_map.addControl(new GScaleControl), g_customButtonControl=new CCustomButtonControl(95,!0),g_map.addControl(g_customButtonControl),g_customZoomSliderControl=new CCustomZoomSliderControl,g_map.addControl(g_customZoomSliderControl),!1==g_MapCtrl.ClickableMap&&(g_contextMenu=new CContextMenu,g_SuggestContentPositionOverlay=new CSuggestContentPositionOverlay,g_AddNewSpectatorPointOverlay=new CAddNewSpectatorPointOverlay),e={maxAdsOnMap:2,style:G_ADSMANAGER_STYLE_ADUNIT,channel:n,position:new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0, 43))},(new GAdsManager(g_map,m,e)).enable(),g_map.streetView=new CStreetView(g_map)),GEvent.addListener(g_map,"movestart",h),GEvent.addListener(g_map,"moveend",function(){j()}),GEvent.addListener(g_map,"zoomend",function(a,b){j(a,b)}),GEvent.addListener(g_map,"load",function(){null!=g_customButtonControl&&g_customButtonControl.SetActiveButton();g_Comm.SetEventMapLoaded();var a=g_map.getBounds(),b=g_map.getCenter(),c=a.getSouthWest(),a=a.getNorthEast(),e=g_map.getCurrentMapType();g_Comm.SetEventMapMove(e, g_map.getZoom(),g_map.getZoom(),b,c,a);g_MapCtrl.resizeMap();g_map.getContainer().style.backgroundImage="none"}),GEvent.addListener(g_map,"maptypechanged",function(){if(g_map.getCurrentMapType()!==G_SATELLITE_3D_MAP){null!=g_customButtonControl&&g_customButtonControl.SetActiveButton();null!=g_customZoomSliderControl&&g_customZoomSliderControl.OnMapTypeChanged();var a=g_map,b=a.getZoom(),c=a.getCenter(),e=a.getBounds();e.getSouthWest();e.getNorthEast();var a=e.getSouthWest(),e=e.getNorthEast(),d=g_map.getCurrentMapType(); g_Comm.SetEventMapMove(d,b,b,c,a,e)}else null!=g_customZoomSliderControl&&(g_map.removeControl(g_customZoomSliderControl),g_map.removeControl(g_customButtonControl))}),GEvent.addListener(g_map,"singlerightclick",function(a){g_contextMenu.hide();null!=g_mouseOverMarker&&g_contextMenu.show(a,g_mouseOverMarker)}),GEvent.addListener(g_map,"click",function(a,b){g_contextMenu&&g_contextMenu.hide();!0==g_MapCtrl.ClickableMap&&(null!=g_customInfoWindow&&g_customInfoWindow.OnCloseInfoWindow(),g_MapCtrl.SetUserMarker(b), g_Comm.SetEventMapClick(b))}),GEvent.addListener(g_map,"mousemove",function(a){g_MapCtrl.mouseOverPosition=a;null!==g_mouseOverPolyline&&null!==g_stagePositionOverlay&&g_stagePositionOverlay.show(g_MapCtrl.mouseOverPosition,g_mouseOverPolyline)}));g?g_map.setMapType(g):g_map.addMapType(G_PHYSICAL_MAP);g_map.enableScrollWheelZoom();a=null==a&&null==d?7:parseInt(a);b=null==b?51.3:parseFloat(b);c=null==c?8.5:parseFloat(c);d&&f?(a=new GLatLng(b,c),d=new GLatLng(d,f),d=new GLatLngBounds(a,d),g_MapCtrl.SetWorldBoundingBoxByBoundingBox(d), f=g_map.getBoundsZoomLevel(d),g_map.setCenter(d.getCenter(),f)):g_map.setCenter(new GLatLng(b,c),a);!0==g_MapCtrl.ClickableMap?(g_MapCtrl.RemoveFilter("GLOBALS"),d=new CSingleButtonControl(G_ANCHOR_TOP_LEFT,40,10,"Reset",function(){g_MapCtrl&&g_MapCtrl.RemoveUserClickMarker();g_Comm&&g_Comm.SetEventMapEditResetButtonClick()}),g_map.addControl(d)):g_MapCtrl.AddFilter("GLOBALS");g_MapCtrl.resizeMap();null===g_MapCtrl.pingIntervallId&&(g_MapCtrl.pingLastMapLink=g_MapCtrl.getMapLink(),g_MapCtrl.pingIntervallId= setInterval(function(){var a=g_MapCtrl.getMapLink();a!=g_MapCtrl.pingLastMapLink&&(g_MapCtrl.pingLastMapLink=a,g_Comm.ping())},3E5));GPolygon.prototype.containsLatLng=function(a){for(var b=0,c=!1,e=a.lng(),a=a.lat(),d=0;d<this.getVertexCount();d++)if(b++,b==this.getVertexCount()&&(b=0),this.getVertex(d).lat()<a&&this.getVertex(b).lat()>=a||this.getVertex(b).lat()<a&&this.getVertex(d).lat()>=a)this.getVertex(d).lng()+(a-this.getVertex(d).lat())/(this.getVertex(b).lat()-this.getVertex(d).lat())*(this.getVertex(b).lng()- this.getVertex(d).lng())<e&&(c=!c);return c};GPolyline.prototype.containsLatLng=GPolygon.prototype.containsLatLng;GPolyline.prototype.calcVectorLength=GeoTools.calcVectorLength;GPolyline.prototype.calculateDistanceFromPoint=function(a){var b={linePoint:null,distance:null,lastVertex:null,distanceFromStart:null};if(null!=a&&1<this.getVertexCount())for(var c=this.getVertex(0),e=null,d=1;d<this.getVertexCount();d+=1){var e=this.getVertex(d),f=new GLatLng(e.lat()-c.lat(),e.lng()-c.lng()),g=(a.lng()*f.lng()+ a.lat()*f.lat()-f.lng()*c.lng()-f.lat()*c.lat())/(Math.pow(f.lng(),2)+Math.pow(f.lat(),2)),h=null,i=null;0>g?(h=c,i=d-1):1<g?(h=e,i=d):(h=new GLatLng(c.lat()+g*f.lat(),c.lng()+g*f.lng()),i=d-1);c=this.calcVectorLength(a,h);if(null==b.distance||b.distance>c)b.distance=c,b.linePoint=h,b.lastVertex=i;c=e}if(null!=b.linePoint&&null!=b.lastVertex){e=[];d=this.getVertexCount()/2;a=!1;if(b.lastVertex<d)for(d=0;d<=b.lastVertex;d+=1)e.push(this.getVertex(d));else{for(d=this.getVertexCount()-1;d>b.lastVertex;d-= 1)e.push(this.getVertex(d));a=!0}d=e[e.length-1];null!=d&&(b.linePoint.lat()!=d.lat()&&b.linePoint.lng()!=d.lng()&&e.push(b.linePoint),d=new GPolyline(e),b.distanceFromStart=d.getLength(),!0===a&&(b.distanceFromStart=this.getLength()-b.distanceFromStart))}return b};GPolygon.prototype.getCenter=function(){for(var a=0,b=0,c=1/(6*this.getArea()),e=0;e+1<this.getVertexCount();e+=1)var d=this.getVertex(e),f=this.getVertex(e+1),a=a+(d.lng()+f.lng())*(d.lng()*f.lat()-f.lng()*d.lat()),b=b+(d.lat()+f.lat())* (d.lng()*f.lat()-f.lng()*d.lat());return new GLatLng(b*c,a*c)};GPolyline.prototype.getCenter=GPolygon.prototype.getCenter}})(b,a,e,c,d,g,f)} function CMapControl(b){this.Map=this.baseUrl=null;this.aFilters=[];this.aFiltersIndex=[];this.aInvertedFilters=[];this.aInvertedFiltersIndex=[];this.aStyles=[];this.aGroups=[];this.aGroupsLat=[];this.aMapObjects=[];this.Comm=null;this.GroupAnchor=new CGroup("default",null,0,!0,!0);this.AutoSizeMap=!0;this.ClickableMap=!1;this.pingIntervallId=this.pingLastMapLink=this.mouseOverPosition=this.LastMapCenterDynamicZoominBounds=this.worldBoundingBox=this.mapSize=this.MarkerInfoWindowOpen=this.UserMarker= null;this.i18n=[];this.transMissionTimeoutHandler=null;this.cleanGroupQueryList=function(){for(var a=[],b=0;b<g_QueryServer.length;b+=1){var c=g_QueryServer[b],d=c.replace("_",";");g_MapCtrl.GetGroup(d).isLoaded()||a.push(c)}g_QueryServer=a};this.queryServer=function(){g_MapCtrl.OnMapMove();var a=g_map.getZoom(),b=g_map.getZoom();g_customInfoWindow&&a&&b&&a!=b&&g_customInfoWindow.RedrawDivs();null!=g_customZoomSliderControl&&g_customZoomSliderControl.SetSliderPosBySlot(g_map.getZoom());a=g_map.getBounds(); a.getSouthWest();a.getNorthEast();var c=g_map;c.getZoom();var a=c.getCenter(),d=c.getBounds(),c=d.getSouthWest(),g=d.getNorthEast();d.getSouthWest();d.getNorthEast();var d=g_map.getCurrentMapType(),f=this;this.transMissionTimeoutHandler&&clearTimeout(this.transMissionTimeoutHandler);this.transMissionTimeoutHandler=setTimeout(function(){f.queryServer()},4E3);g_Comm.SetEventMapMove(d,b,b,a,c,g)};this.getMapLink=function(){var a=null;if(g_map&&this.baseUrl){var a=this.i18n.baseUrl,b=g_map.getCenter().lat(), c=g_map.getCenter().lng(),d=g_map.getZoom(),g=g_GMapTypes.getMapTypeNumber(g_map.getCurrentMapType());if(g_map.streetView&&g_map.streetView.dragger.streetViewMapOverlay.isShow())var f=g_map.streetView.dragger.streetviewPanorama,b=f.getLatLng().lat(),c=f.getLatLng().lng(),f=f.getPOV(),a=a+(this.i18n.mapStreetViewLink+g+"/"+d+"/"+b+"/"+c+"/"+f.yaw+"/"+f.pitch+"/"+f.zoom);else a+=this.i18n.mapPositionLink+g+"/"+d+"/"+b+"/"+c,this.MarkerInfoWindowOpen&&this.MarkerInfoWindowOpen.MarkerID&&(b=this.MarkerInfoWindowOpen.MarkerID.split("__"), 3==b.length&&(a+=this.i18n.mapInfoWindowLink+b[1].toLowerCase()+"/"+b[2]))}return a};this.showLogo=function(a){g_map&&a&&g_map.addControl(new CCustomLogo(a))};this.ShowWorldBoundingBox=function(){this.SetMapCenterDynamicZoominByBounds(new GLatLngBounds(new GLatLng(-74.9,0),new GLatLng(75,0)))};this.SetWorldBoundingBox=function(a,b,c,d){this.worldBoundingBox=g_tools.GetBoundingBox(a,b,c,d)};this.SetWorldBoundingBoxByBoundingBox=function(a){this.worldBoundingBox=a};this.SetMapType=function(a){a&&g_map&& (a=g_GMapTypes.getMapTypeByName(a))&&g_map.setMapType(a)};this.OpenInfoWindow=function(a){this.CloseInfoWindow();if(null!=a){var b=g_markerTable[a];null!=b&&null!=b.Me?b.OpenInfoWindow():g_openInfoWindow=a}};this.CloseInfoWindow=function(){if(null!=this.MarkerInfoWindowOpen)try{this.MarkerInfoWindowOpen.closeInfoWindow()}catch(a){}};this.RemoveUserClickMarker=function(){if(null!=this.UserMarker){var a=this.GetGroup(this.UserMarker.GroupName);a&&(a.RemoveMapObject(this.UserMarker),g_map.removeOverlay(this.UserMarker.Me), this.UserMarker=null)}};this.SetUserMarker=function(a){null!=a&&a instanceof GLatLng&&(null==this.UserMarker?(this.AddGroup(new CGroup("GLOBALS",null,0,!0,["GLOBALS"],!0,!0)),this.UserMarker=new CMarker("GLOBALS",a.lat(),a.lng(),!0,"selectionArrow",null,null,"never","GLOBALS","USERMARKER"),this.AddMapObject(this.UserMarker)):this.UserMarker.Point=a,this.UserMarker.RefreshPoint())};this.IsFilteredOut=function(a){g_tools.IsMapObject(a);if(null!=a&&(a instanceof CGroup||g_tools.IsMapObject(a))){if(0< this.aInvertedFilters.length)for(var b=0;b<this.aInvertedFilters.length;b+=1){for(var c=this.aInvertedFilters[b],d=!1,g=0;g<c.length;g+=1){var f=c[g];if(null!=f&&null!=a.aFilters[f.category]&&!0==a.aFilters[f.category])if(a.ParentGroup!=f.value&&null==a.aFilters[f.value]||!1==a.aFilters[f.value])d=!0;else return!1}if(!0===d)return!0}for(b=0;b<this.aFilters.length;b++)if(f=this.aFilters[b],null!=f&&null!=a.aFilters[f]&&!0==a.aFilters[f])return!0}return!1};this.AddInvertedFilter=function(a){if(null!== a&&void 0!==a){var b=-1;null==this.aInvertedFiltersIndex[a.category]?(b=this.aInvertedFilters.length,this.aInvertedFiltersIndex[a.category]=this.aInvertedFilters.length,this.aInvertedFilters[b]=[]):b=this.aInvertedFiltersIndex[a.category];b=this.aInvertedFilters[b];if(0<b.length){for(var c=!1,d=0;d<b.length;d+=1)if(null!=b[d]&&b[d].value===a.value){c=!0;break}!1===c&&(b[b.length]=a)}else b[0]=a;this.TransmissionCompleted()}};this.RemoveInvertedFilter=function(a){if(null!==a&&void 0!==a&&null!=this.aInvertedFiltersIndex[a.category]){for(var b= this.aInvertedFilters[this.aInvertedFiltersIndex[a.category]],c=0;c<b.length;c+=1)if(null!=b[c]&&b[c].value==a.value){b[c]=null;break}0>=b.length&&(this.aInvertedFilters[this.aInvertedFiltersIndex[a.category]]=null,this.aInvertedFiltersIndex[a.category]=null);this.TransmissionCompleted()}};this.AddFilter=function(a){null==this.aFiltersIndex[a]&&(this.aFiltersIndex[a]=this.aFilters.length,this.aFilters[this.aFilters.length]=a,this.TransmissionCompleted())};this.RemoveFilter=function(a){null!=this.aFiltersIndex[a]&& (this.aFilters[this.aFiltersIndex[a]]=null,this.aFiltersIndex[a]=null,this.TransmissionCompleted())};this.resizeMap=function(){g_container=document.getElementById("map_canvar");if(null!=g_container)if("big"==g_MapCtrl.getMapSize()){window.onscroll=g_MapCtrl.resizeMap;var a=0,b=53,c=168;g_tools.isIE()&&(b=58,c=169);var d=g_tools.getWindowInnerWidth(),g=g_tools.getWindowInnerHeight(),f=parseInt(document.documentElement.scrollTop),h=parseInt(document.body.clientHeight),j=h>g,i=h-c-b,k=0,a=f>c?f:c;h> g?f>=c?(f=h-f,i=f-b>=g?g:f-b):(i=g-(c-f),f=h-f,i=f-b>=g?i:i-(g-(f-b))):i=g-b-c;k=d-174+3;g_tools.isIE()||j&&(k-=17);i+="px";g_container.style.position="absolute";g_container.style.height=i;g_container.style.width=k+"px";g_container.style.top=a+"px";if(a=document.getElementById("map_height_dummy"))a.style.height=i}else window.onscroll=null,g_container.style.position="relative",g_container.style.height="100%",g_container.style.minHeight="250px",g_container.style.width="100%",g_container.style.minWidth= "150px";g_map&&g_map.checkResize()};this.Test=function(){alert("test mapctrl")};this.TransmissionCompleted=function(){clearTimeout(this.transMissionTimeoutHandler);this.transMissionTimeoutHandler=null;this.RefreshMap()};this.RefreshMap=function(){null!=g_map&&this.GroupAnchor.RefreshMap()};this.OnMapMove=function(){};this.ClearMap=function(){null!=this.Map&&g_map.clearOverlays()};this.Unload=function(){GUnload()};this.InitMap=function(a,b,c,d,g,f,h,j,i,k){g_MapRequestCache=[];this.baseUrl=a;this.mapSize= g;this.i18n.baseUrl=a.substring(0,a.length-1);3===jQuery("#mapInfoWindowLink,#mapStreetViewLink,#mapPositionLink").length&&(this.i18n.mapInfoWindowLink=jQuery("#mapInfoWindowLink")[0].value,this.i18n.mapStreetViewLink=jQuery("#mapStreetViewLink")[0].value,this.i18n.mapPositionLink=jQuery("#mapPositionLink")[0].value);null!=f&&(f=g_tools.ParseBoolean(f),null!=f&&(this.ClickableMap=f));null!=g_map&&g_map.isLoaded()&&(this.Unload(),g_map=null);null!=h&&(h=g_tools.ParseBoolean(h),null!=h&&(this.AutoSizeMap= h));"big"==this.mapSize&&0==b&&(b=1);initTheMap(b,c,d,g,j,i,k)};this.AddMapObject=function(a){if(null!=a&&g_tools.IsMapObject(a)&&null!=a.GroupName&&(null==a.parent.MapObjectID||null==this.aMapObjects[a.parent.MapObjectID])){var b=this.GetGroup(a.GroupName);null!=b&&b.AddMapObject(a);this.aMapObjects[a.parent.MapObjectID]=!0}};this.SetGroupBounds=function(a,b,c){null!=a&&null!=b&&null!=c&&(a=this.GetGroup(a),null!=a&&a.SetBounds(b,c))};this.AddGroup=function(a){null!=a&&a instanceof CGroup&&null!= a.Name&&null==this.aGroups[a.Name]&&(this.aGroups[a.Name]=a)};this.GetGroup=function(a){return null!=a?this.aGroups[a]:null};this.AddStyle=function(a){if(null!=a&&null!=a.StyleName&&(this.aStyles[a.StyleName]=a,"MarkerStyle"==a.styleType&&"undefined"==typeof a.icon||null==a.icon))a.icon=(new CMarker).GenerateIcon(a)};this.GetStyle=function(a){var b=null;null!=a&&(b=this.aStyles[a]);return b};this.GetMapCenter=function(){return null!=g_map?g_map.getCenter():null};this.ContinuouslyMoveMapTimeoutId= null;this.ContinuouslyMoveMapLastDirection={dx:0,dy:0};this.ContinuouslyMoveMap=function(a,b){var c=!1;if(null!==this.ContinuouslyMoveMapTimeoutId){if(this.ContinuouslyMoveMapLastDirection.dx!==a||this.ContinuouslyMoveMapLastDirection.dy!==b)clearInterval(this.ContinuouslyMoveMapTimeoutId),c=!0}else c=!0;if(!0===c&&(0<a||0>a||0>b||0<b))this.ContinuouslyMoveMapTimeoutId=setInterval(function(){var c=new GSize(10*a,10*b);g_map.panBy(c)},100),this.ContinuouslyMoveMapLastDirection={dx:a,dy:b}};this.PanMapIfBBoxOutOfSight= function(a){if(a){var b=g_map.getBounds(),c=0,d=0;a.getSouthWest().lat()<b.getSouthWest().lat()?d=-1:a.getNorthEast().lat()>b.getNorthEast().lat()&&(d=1);a.getSouthWest().lng()<b.getSouthWest().lng()?c=1:a.getNorthEast().lng()>b.getNorthEast().lng()&&(c=-1);this.ContinuouslyMoveMap(c,d)}};this.PanMapIfPointOutOfSight=function(a,b,c,d,g){null==c&&(c=!1);if(g_map&&null!=a&&null!=b&&null!=g_map){g_skipMapMoveEvent=!c;a=new GLatLng(a,b);if(void 0==d||null==d)var d=g_map.getBounds(),b=d.getSouthWest(), d=d.getNorthEast(),c=20*((d.lat()-b.lat())/100),f=20*((d.lng()-b.lng())/100),b=new GLatLng(b.lat()+c,b.lng()+f),d=new GLatLng(d.lat()-c,d.lng()-f),d=new GLatLngBounds(b,d);d.containsLatLng(a)||(g&&(a=g),g_map.panTo(a))}};this.getZoom=function(){return g_map.getZoom()};this.setZoom=function(a){g_map&&g_map.setZoom(a)};this.SetMapCenter=function(a,b,c){null!=g_map&&null!=a&&null!=b&&(null==c&&(c=g_map.getZoom()),g_map.setCenter(new GLatLng(parseFloat(a),parseFloat(b)),parseInt(c)))};this.SetMapClick= function(a,b){if(null!=g_map&&null!=a&&null!=b){this.SetMapClickSilent(a,b);var c=new GLatLng(a,b);g_Comm.SetEventMapClick(c)}};this.SetMapClickSilent=function(a,b){null!=g_map&&null!=a&&null!=b&&this.SetUserMarker(new GLatLng(a,b))};this.SetMapCenterDynamicZoomin=function(a,b,c,d){this.SetMapCenterDynamicZoominByBounds(g_tools.GetBoundingBox(c,d,a,b))};this.SetMapCenterDynamicZoominByBounds=function(a){if(g_map&&a){var b=g_map.getBoundsZoomLevel(a);this.setCenterCheckMaxZoom(a.getCenter(),b);this.LastMapCenterDynamicZoominBounds= a}};this.ShowLastMapCenterDynamicZoominBounds=function(){this.LastMapCenterDynamicZoominBounds&&this.SetMapCenterDynamicZoominByBounds(this.LastMapCenterDynamicZoominBounds)};this.setCenterCheckMaxZoom=function(a,b){var c=g_map.getCenter();if(g_map.getZoom()!=b||c.lat()!=a.lat()||c.lng()!=a.lng())a&&g_map&&null!=b&&(13<b&&(g_map.getCurrentMapType()==G_SATELLITE_MAP||g_map.getCurrentMapType()==G_HYBRID_MAP)?g_map.getCurrentMapType().getMaxZoomAtLatLng(a,function(c){c&&c.status==G_GEO_SUCCESS&&b>c.zoom&& (b=c.zoom);g_map.setCenter(a,b)}):g_map.setCenter(a,b))};this.getMapSize=function(){return this.mapSize?this.mapSize:""};this.isLoaded=function(){var a=!1,b=document.getElementById("map_canvar");b&&0<b.childNodes.length&&g_map.isLoaded()&&(a=!0);return a};this.SetDefaults=function(){this.aGroups=[];this.GroupAnchor=new CGroup("default",null,0,!0,!0);this.aStyles=[];this.aGroups[this.GroupAnchor.Name]=this.GroupAnchor};this.ShowPositionArrow=function(a,b){if(null!=a&&null!=b)if(null===g_positionArrow|| void 0===g_positionArrow){var c=g_MapCtrl.GetStyle("pointArrow");null==c&&(c=g_MapCtrl.GetStyle("defaultMarker"));g_positionArrow=new GMarker(new GLatLng(a,b),{clickable:!1,draggable:!1,icon:c.icon});g_positionArrow.defaultStyle=null==c;g_map.addOverlay(g_positionArrow)}else!1===g_positionArrow.defaultStyle&&!g_MapCtrl.GetStyle("pointArrow")&&(this.HidePositionArrow(!0),this.ShowPositionArrow(a,b)),g_positionArrow.setLatLng(new GLatLng(a,b)),g_positionArrow.show()};this.HidePositionArrow=function(a){g_positionArrow&& (!0===a?(g_map.removeOverlay(g_positionArrow),g_positionArrow=null):g_positionArrow.hide())};this.ShowAddSpectatorPointMenuOverlay=function(){g_AddNewSpectatorPointOverlay.show();var a=g_MapCtrl.GetMapCenter();null!=a&&this.SetMapClick(a.lat(),a.lng())};this.refreshPermaLink=function(){if(null!=g_map&&"big"==g_MapCtrl.getMapSize()&&0<jQuery(".permaLinkOutput, .permaLinkInput").length){for(var a=this.getMapLink(),b={link:a},c=jQuery(".permaLinkOutput"),d=0;d<c.length;d+=1)jQuery(c[d]).attr("href", a);jQuery(".permaLinkInput").render(b,{"@value":"link"})}};this.Constructor=function(a){g_MapCtrl=this;window.onresize=this.resizeMap;jQuery(window).unload(function(){var a=g_map.getCenter().lat(),b=g_map.getCenter().lng(),d=g_map.getZoom(),g=g_GMapTypes.getMapTypeNumber(g_map.getCurrentMapType());if("embedded"!==g_MapCtrl.getMapSize())var f="/page/SetMapPositionPage.faces?mappositioncv="+d+"_"+a+"_"+b+"_"+g;GDownloadUrl(f);GUnload()});this.AddStyle({iconUrl:"http://www.google.com/mapfiles/marker.png", iconShadowUrl:null,iconSize:null,iconShadowSize:null,iconSpritePosition:null,StyleName:"defaultMarker",styleType:"MarkerStyle"});this.AddStyle({transparency:0.5,width:5,color:"#000000",StyleName:"defaultPolyline",styleType:"PolylineStyle"});this.AddStyle({fillColor:"#000000",fillTransparency:0.7,transparency:0.5,width:5,color:"#000000",StyleName:"defaultPolygon",styleType:"PolygonStyle"});this.Comm=a;this.aGroups[this.GroupAnchor.Name]=this.GroupAnchor};this.Constructor(b)} function CCommunication(){this.MapCtrl=null;this.objsReceivedCnt=0;this.Test=function(){alert("test");this.MapCtrl.Test()};this.getZoom=function(){return this.MapCtrl.getZoom()};this.setZoom=function(b){this.MapCtrl.setZoom(b)};this.SetSuggestContentPositionContentId=function(b){null!=b&&this.InvokeBeanMethod("OnBeginSuggestNewPosition",b)};this.showLogo=function(b){this.MapCtrl.showLogo(b)};this.SetWorldBoundingBox=function(b,a,e,c){g_MapCtrl&&g_MapCtrl.SetWorldBoundingBox(b,a,e,c)};this.InitMap= function(b,a,e,c,d,g,f,h,j,i){this.MapCtrl=new CMapControl(this);null==f&&(f=!0);i=null!=i&&"null"!=i?g_GMapTypes.getMapTypeByName(i):G_NORMAL_MAP;this.MapCtrl.InitMap(b,a,e,c,d,g,f,h,j,i)};this.SetMapType=function(b){this.MapCtrl.SetMapType(b)};this.AddInvertedFilter=function(b){this.MapCtrl.AddInvertedFilter(b)};this.AddInvertedFilters=function(b){if(null!==b&&void 0!==b&&""!==b&&b instanceof Array&&0<b.length)for(var a=0;a<b.length;a+=1)this.MapCtrl.AddInvertedFilter(b[a])};this.RemoveInvertedFilter= function(b){this.MapCtrl.RemoveInvertedFilter(b)};this.AddFilter=function(b){this.MapCtrl.AddFilter(b)};this.RemoveFilter=function(b){this.MapCtrl.RemoveFilter(b)};this.AddMarker=function(b,a,e,c,d,g,f,h,j,i,k,o){this.MapCtrl.AddMapObject(new CMarker(b,a,e,g_tools.ParseBoolean(c),d,g,f,h,j,i,k,o));this.objsReceivedCnt++};this.AddMarkerRange=function(){};this.AddPolygon=function(b){null!=b&&(this.MapCtrl.AddMapObject(new CPolygon(b)),this.objsReceivedCnt++)};this.AddPolygonRange=function(){};this.AddPolyline= function(b){null!=b&&(b=new CPolyline(b),null!=b&&(this.MapCtrl.AddMapObject(b),this.objsReceivedCnt++))};this.AddPolylineRange=function(){};this.AddGroupBounds=function(b,a,e,c,d){null!=b&&null!=a&&null!=e&&null!=c&&null!=d&&this.MapCtrl.SetGroupBounds(b,g_tools.GetPoint(a,e),g_tools.GetPoint(c,d))};this.AddGroup=function(b,a,e,c,d,g,f,h){"dummy"===b?(b=this.MapCtrl.GetGroup(a),null!=b&&(b.isEmpty=!0,b.isLoading=!1)):(d=g_tools.FilterString2FilterArray(d),b=new CGroup(b,a,e,c,d,g,f,h),this.MapCtrl.AddGroup(b))}; this.AddStyle=function(b){this.MapCtrl.AddStyle(b)};this.SetZoom=function(b){b&&this.MapCtrl.setZoom(b)};this.SetMapCenter=function(b,a,e){null!=this.MapCtrl&&(g_MapCtrl.CloseInfoWindow(),this.MapCtrl.SetMapCenter(b,a,e))};this.SetMapCenterDynamicZoomin=function(b,a,e,c){this.MapCtrl&&(g_MapCtrl.CloseInfoWindow(),this.MapCtrl.SetMapCenterDynamicZoomin(b,a,e,c))};this.TransmissionCompleted=function(){g_QueryServer=[];g_QueryingServer=!1;this.MapCtrl.TransmissionCompleted();setTimeout(function(){g_customButtonControl.hideLoader()}, 250)};this.ClearMap=function(){this.MapCtrl.ClearMap()};this.SetEventMapLoaded=function(){this.InvokeBeanMethod("GMapInitialized",this.objsReceivedCnt)};this.SetEventInfoWindowOpen=function(b){this.InvokeBeanMethod("OnInfoWindowOpen",b)};this.SetEventInfoWindowClose=function(b){this.InvokeBeanMethod("OnInfoWindowClose",b)};this.SetEventMapClick=function(b){this.InvokeBeanMethod("OnMapClick",b.lat()+";"+b.lng())};this.SetMapClickSilent=function(b,a){null!=b&&null!=a&&this.MapCtrl.SetMapClickSilent(b, a)};this.SetMapClick=function(b,a){null!=b&&null!=a&&this.MapCtrl.SetMapClick(b,a)};this.RemoveUserClickMarker=function(){this.MapCtrl.RemoveUserClickMarker()};this.SetEventMapMove=function(b,a,e,c,d,g){g_customButtonControl.showLoader();g_MapCtrl.cleanGroupQueryList();b=""+g_GMapTypes.getMapTypeName(b)+";"+this.objsReceivedCnt+";"+a+";"+e+";"+c.lat()+";"+c.lng()+";"+d.lat()+";"+d.lng()+";"+g.lat()+";"+g.lng()+";"+JSON.stringify(g_QueryServer)+";";g_MapCtrl.refreshPermaLink();this.InvokeBeanMethod("OnMapZoomMoveEnd", b)};this.SetEventMapMoveStart=function(){};this.SetEventZoomEnd=function(){};this.SetEventWindowOnLoad=function(){this.InvokeBeanMethod("OnWindowOnLoad",null)};this.OpenInfoWindow=function(b){null!=b&&g_MapCtrl&&g_MapCtrl.OpenInfoWindow(b)};this.CloseInfoWindow=function(){g_MapCtrl.CloseInfoWindow()};this.SetEventMapEditResetButtonClick=function(){this.InvokeBeanMethod("OnMapEditResetButtonClick")};this.MoveMapAndOpenInfoWindow=function(b,a,e,c,d){b=parseFloat(b);a=parseFloat(a);!isNaN(b)&&!isNaN(a)&& 0!=b&&0!=a?(g_MapCtrl.CloseInfoWindow(),g_MapCtrl.SetMapCenter(b,a,14),this.OpenInfoWindow(e)):null!=d&&null!=c&&("VIDEO"==c?this.ShowVideoDetails(d):"PHOTO"==c&&this.ShowPhotoDetails(d))};this.ShowCountry=function(b){b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowCtry",b))};this.ShowRally=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowRally",b))};this.ShowObjectUsingBounds=function(b,a,e,c,d){null!=b&&null!=a&&null!=e&&null!=c&&(g_MapCtrl.CloseInfoWindow(), this.SetMapCenterDynamicZoomin(b,a,e,c),null!=d&&this.OpenInfoWindow(d))};this.ShowStage=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowStage",b))};this.ShowCollectionDetails=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowCollectionDetails",b))};this.ShowVideoDetails=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowVideoDetails",b))};this.ShowPhotoDetails=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(), this.InvokeBeanMethod("OnShowPhotoDetails",b))};this.ShowContentOnMap=function(b){null!=b&&(g_MapCtrl.CloseInfoWindow(),this.InvokeBeanMethod("OnShowContentOnMap",b))};this.OpenBigMap=function(){this.InvokeBeanMethod("OpenBigMap")};this.ForceMapReInit=function(){this.InvokeBeanMethod("OnForceMapReInit")};this.ForceMapResize=function(){null!=this.MapCtrl&&this.MapCtrl.resizeMap()};this.InvokeBeanMethod=function(b){this.InvokeBeanMethod(b,null)};this.InvokeBeanMethod=function(b,a){var e=document.getElementById("InvokeSessionBeanMethodsForm:InvokeBeanMethod"); if(e){if(null==a||"undefined"==a)a=null;var c=b+"~"+a;e.value==c&&this.InvokeBeanMethod(null,null);e.value=c;iceSubmitPartial(document.getElementById("InvokeSessionBeanMethodsForm"),document.getElementById("InvokeSessionBeanMethodsForm:InvokeBeanMethod"))}else this.TransmissionCompleted()};this.ShowAddSpectatorPointMenuOverlay=function(){this.MapCtrl.ShowAddSpectatorPointMenuOverlay()};this.ShowPositionArrow=function(b,a){this.MapCtrl.ShowPositionArrow(b,a)};this.HidePositionArrow=function(b){this.MapCtrl.HidePositionArrow(b)}; this.PanMapIfPointOutOfSight=function(b,a,e,c){this.MapCtrl.PanMapIfPointOutOfSight(b,a,e,c)};this.refreshPermaLink=function(){this.MapCtrl.refreshPermaLink()};this.StartTour=function(b,a){if(null!=b&&0<b.length)for(var e=0;e<b.length;e+=1){var c=b[e];if(null!=c&&null!=c.showBounds)for(var d=0;d<c.showBounds.length;d+=1)if(null!=c.showBounds[d]){var g=c.showBounds[d];if(null!=g.bbox&&4==g.bbox.length){var f=new GLatLng(g.bbox[1],g.bbox[0]),g=new GLatLng(g.bbox[3],g.bbox[2]);c.showBounds[d]=new GLatLngBounds(f, g)}}}g_Tour=new sl.maps.tour.Tour(b,a);g_Tour.playTour()};this.AddTourItem=function(b){null!=b&&null!=g_Tour&&g_Tour.addTourItemData(b)};this.RequestTourData=function(b){null!=b&&this.InvokeBeanMethod("onRequestTourData",b)};this.ShowStreetViewPanorama=function(b,a){b&&a&&g_map&&g_map.streetView&&g_map.streetView.showPanorama(new GLatLng(b.flLat,b.flLng),a)};this.ping=function(){this.InvokeBeanMethod("OnPing")};this.Constructor=function(){};this.Constructor()}var isMapLoadedOnDemand=!1; function MapClientJSFileLoaded(){isSet("OnMapClientJSFileLoaded")&&!isMapLoadedOnDemand&&(isMapLoadedOnDemand=!0,OnMapClientJSFileLoaded())}MapClientJSFileLoaded();
