function Map(_1,_2,_3,_4){if(!_1||!_2||!google.maps.BrowserIsCompatible()){return;}this.rootURL=_2;var _5=this.MIN_ZOOM=7;var _6=this.MAX_ZOOM=14;google.maps.Event.addDomListener(window,"unload",google.maps.Unload);this.gmap=new google.maps.Map2(_1);this.gmap.addMapType(G_PHYSICAL_MAP);this.gmap.removeMapType(G_SATELLITE_MAP);this.gmap.removeMapType(G_HYBRID_MAP);this.gmap.removeMapType(G_NORMAL_MAP);this.gmap.getMapTypes()[0].getMinimumResolution=function(){return _5;};this.gmap.getMapTypes()[0].getMaximumResolution=function(){return _6;};new google.maps.KeyboardHandler(this.gmap);this.gmap.addControl(new google.maps.SmallZoomControl());this.gmap.setCenter(new google.maps.LatLng(_3?_3:55.34,_4?_4:23.74),this.MIN_ZOOM);this.gmap.enableDragging();this.gmap.enableInfoWindow();this.gmap.enableScrollWheelZoom();this.gmap.enableContinuousZoom();this.gmap.disableGoogleBar();this.gmap.disableDoubleClickZoom();this.mapZone=new Array();this.mapZone[7]=new google.maps.LatLngBounds(new google.maps.LatLng(54.95,23.7),new google.maps.LatLng(55.4,24.1));this.mapZone[8]=new google.maps.LatLngBounds(new google.maps.LatLng(54.45,22.3),new google.maps.LatLng(55.9,25.35));this.mapZone[9]=new google.maps.LatLngBounds(new google.maps.LatLng(54.15,21.5),new google.maps.LatLng(56.2,26.2));google.maps.Event.bind(this.gmap,"move",this,this.onMapMove);this.markerManager=new google.maps.MarkerManager(this.gmap);this.ICON_STATION=new google.maps.Icon();this.ICON_STATION.image=this.rootURL+"media/images/ico/statoil.png";this.ICON_STATION.iconSize=new google.maps.Size(34,35);this.ICON_STATION.iconAnchor=new google.maps.Point(17,17);this.ICON_STATION_123=new google.maps.Icon();this.ICON_STATION_123.image=this.rootURL+"media/images/ico/statoil_123.png";this.ICON_STATION_123.iconSize=new google.maps.Size(42,19);this.ICON_STATION_123.iconAnchor=new google.maps.Point(21,9);this.markers=[];this.onMapMove();};Map.prototype.onMapMove=function(){var _7=this.gmap.getCenter();var _8=this.gmap.getZoom();if(!this.mapZone[_8]||this.mapZone[_8].containsLatLng(_7)){return;}var _9=this.mapZone[_8].getNorthEast().lng();var _a=this.mapZone[_8].getNorthEast().lat();var _b=this.mapZone[_8].getSouthWest().lng();var _c=this.mapZone[_8].getSouthWest().lat();var _d=_7.lng();var _e=_7.lat();if(_d<_b){_d=_b;}if(_d>_9){_d=_9;}if(_e<_c){_e=_c;}if(_e>_a){_e=_a;}this.gmap.setCenter(new google.maps.LatLng(_e,_d));};Map.prototype.onMarkerZIndexProcess=function(_f){return _f.id;};Map.prototype.createMarker=function(id,lat,lng,_13,_14){this.markers[id]=new google.maps.Marker(new google.maps.LatLng(lat,lng),{icon:_14?this.ICON_STATION_123:this.ICON_STATION,title:_13,zIndexProcess:this.onMarkerZIndexProcess});this.markers[id].id=id;this.markers[id].is123=_14;google.maps.Event.bind(this.markers[id],"click",this,function(){this.onMarkerClick(this.markers[id]);});google.maps.Event.bind(this.markers[id],"mouseover",this,function(){this.onMarkerMouseOver(this.markers[id]);});google.maps.Event.bind(this.markers[id],"mouseout",this,function(){this.onMarkerMouseOut(this.markers[id]);});return this.markers[id];};Map.prototype.addMarkers=function(_15){var _16=[];for(var i in _15){_16.push(this.createMarker(i,_15[i][0],_15[i][1],_15[i][2],_15[i][3]));}this.markerManager.addMarkers(_16,this.MIN_ZOOM);};Map.prototype.drawMarkers=function(){this.markerManager.refresh();};Map.prototype.onMarkerClick=function(_18){this.showStation(_18.id);};Map.prototype.onMarkerMouseOver=function(_19){try{_19.setImage(this.rootURL+"media/images/ico/statoil"+(_19.is123?"_123":"")+"_ov.png");}catch(e){}};Map.prototype.onMarkerMouseOut=function(_1a){try{_1a.setImage(this.rootURL+"media/images/ico/statoil"+(_1a.is123?"_123":"")+".png");}catch(e){}};Map.prototype.showStation=function(id){this.gmap.panTo(this.markers[id].getPoint());var _1c=document.getElementById("station_popup");if(_1c){_1c.style.display="block";if(!_1c.getElementById||!_1c.getElementById("throbber")){_1c.innerHTML="<div class=\"throbber\"><img id=\"throbber\" alt=\"\" src=\""+this.rootURL+"media/images/ico/throbber.gif\" /></div>";}google.maps.DownloadUrl(this.rootURL+"index.php?act=station&id="+id,function(_1d,_1e){_1c.innerHTML=_1d;});}};function MapPicker(_1f,_20,_21,_22,_23,_24){this.base=Map;this.base(_1f,_20,_22,_23);this.markerManager=new google.maps.MarkerManager(this.gmap,{trackMarkers:true});var _25={};_25.icon=this.ICON_STATION;if(_24){_25.clickable=false;}else{_25.draggable=true;_25.autoPan=false;}this.pickerMarker=new google.maps.Marker(new google.maps.LatLng(_22,_23),_25);if(!_21){this.markerManager.addMarker(this.pickerMarker,this.MIN_ZOOM);this.markerManager.refresh();}if(!_24){google.maps.Event.bind(this.gmap,"click",this,function(_26,_27){this.onMapPickerClick(_26,_27);});google.maps.Event.bind(this.pickerMarker,"dragend",this,this.onMapPickerMarkerDragEnd);google.maps.Event.bind(this.pickerMarker,"mouseover",this,function(){this.onMarkerMouseOver(this.pickerMarker);});google.maps.Event.bind(this.pickerMarker,"mouseout",this,function(){this.onMarkerMouseOut(this.pickerMarker);});}};MapPicker.prototype=new Map;MapPicker.prototype.onMapPickerClick=function(_28,_29){if(!_28){this.setPickerLocation(_29.lat(),_29.lng());}};MapPicker.prototype.onMapPickerMarkerDragEnd=function(){var _2a=this.pickerMarker.getLatLng();this.setPickerLocation(_2a.lat(),_2a.lng());};MapPicker.prototype.setPickerLocation=function(lat,lng){if(!this.markerManager.getMarkerCount(this.MIN_ZOOM)){this.markerManager.addMarker(this.pickerMarker,this.MIN_ZOOM);this.markerManager.refresh();}this.pickerMarker.setLatLng(new google.maps.LatLng(lat,lng));if(window.onMarkerLocationChanged){window.onMarkerLocationChanged(lat,lng);}};