!function(){function t(e,r,o){this.extend(t,google.maps.OverlayView),this.map_=e,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var i=o||{};this.gridSize_=i.gridSize||60,this.minClusterSize_=i.minimumClusterSize||2,this.maxZoom_=i.maxZoom||null,this.styles_=i.styles||[],this.imagePath_=i.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=i.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,null!=i.zoomOnClick&&(this.zoomOnClick_=i.zoomOnClick),this.averageCenter_=!1,null!=i.averageCenter&&(this.averageCenter_=i.averageCenter),this.setupStyles_(),this.setMap(e),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",(function(){var t=s.map_.getZoom();s.prevZoom_!=t&&(s.prevZoom_=t,s.resetViewport())})),google.maps.event.addListener(this.map_,"idle",(function(){s.redraw()})),r&&r.length&&this.addMarkers(r,!1)}function e(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new r(this,t.getStyles(),t.getGridSize())}function r(t,e,o){t.getMarkerClusterer().extend(r,google.maps.OverlayView),this.styles_=e,this.padding_=o||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}t.prototype.MARKER_CLUSTER_IMAGE_PATH_="../images/m",t.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",t.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},t.prototype.onAdd=function(){this.setReady_(!0)},t.prototype.draw=function(){},t.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},t.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),r=new google.maps.LatLngBounds,o=0;t=e[o];o++)r.extend(t.getPosition());this.map_.fitBounds(r)},t.prototype.setStyles=function(t){this.styles_=t},t.prototype.getStyles=function(){return this.styles_},t.prototype.isZoomOnClick=function(){return this.zoomOnClick_},t.prototype.isAverageCenter=function(){return this.averageCenter_},t.prototype.getMarkers=function(){return this.markers_},t.prototype.getTotalMarkers=function(){return this.markers_.length},t.prototype.setMaxZoom=function(t){this.maxZoom_=t},t.prototype.getMaxZoom=function(){return this.maxZoom_},t.prototype.calculator_=function(t,e){for(var r=0,o=t.length,i=o;0!==i;)i=parseInt(i/10,10),r++;return{text:o,index:r=Math.min(r,e)}},t.prototype.setCalculator=function(t){this.calculator_=t},t.prototype.getCalculator=function(){return this.calculator_},t.prototype.addMarkers=function(t,e){for(var r,o=0;r=t[o];o++)this.pushMarkerTo_(r);e||this.redraw()},t.prototype.pushMarkerTo_=function(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",(function(){t.isAdded=!1,e.repaint()}))}this.markers_.push(t)},t.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw()},t.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r,o=0;r=this.markers_[o];o++)if(r==t){e=o;break}return-1!=e&&(t.setMap(null),this.markers_.splice(e,1),!0)},t.prototype.removeMarker=function(t,e){var r=this.removeMarker_(t);return!(e||!r)&&(this.resetViewport(),this.redraw(),!0)},t.prototype.removeMarkers=function(t,e){for(var r,o=!1,i=0;r=t[i];i++){var s=this.removeMarker_(r);o=o||s}if(!e&&o)return this.resetViewport(),this.redraw(),!0},t.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},t.prototype.getTotalClusters=function(){return this.clusters_.length},t.prototype.getMap=function(){return this.map_},t.prototype.setMap=function(t){this.map_=t},t.prototype.getGridSize=function(){return this.gridSize_},t.prototype.setGridSize=function(t){this.gridSize_=t},t.prototype.getMinClusterSize=function(){return this.minClusterSize_},t.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},t.prototype.getExtendedBounds=function(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),o=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),i=e.fromLatLngToDivPixel(r);i.x+=this.gridSize_,i.y-=this.gridSize_;var s=e.fromLatLngToDivPixel(o);s.x-=this.gridSize_,s.y+=this.gridSize_;var n=e.fromDivPixelToLatLng(i),a=e.fromDivPixelToLatLng(s);return t.extend(n),t.extend(a),t},t.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},t.prototype.resetViewport=function(t){for(var e,r=0;e=this.clusters_[r];r++)e.remove();var o;for(r=0;o=this.markers_[r];r++)o.isAdded=!1,t&&o.setMap(null);this.clusters_=[]},t.prototype.repaint=function(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout((function(){for(var e,r=0;e=t[r];r++)e.remove()}),0)},t.prototype.redraw=function(){this.createClusters_()},t.prototype.distanceBetweenPoints_=function(t,e){if(!t||!e)return 0;var r=(e.lat()-t.lat())*Math.PI/180,o=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 6371*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))},t.prototype.addToClosestCluster_=function(t){for(var r,o=4e4,i=null,s=(t.getPosition(),0);r=this.clusters_[s];s++){var n=r.getCenter();if(n){var a=this.distanceBetweenPoints_(n,t.getPosition());a=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0},e.prototype.getMarkerClusterer=function(){return this.markerClusterer_},e.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),o=0;t=r[o];o++)e.extend(t.getPosition());return e},e.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},e.prototype.getSize=function(){return this.markers_.length},e.prototype.getMarkers=function(){return this.markers_},e.prototype.getCenter=function(){return this.center_},e.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},e.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},e.prototype.getMap=function(){return this.map_},e.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e)for(var r,o=0;r=this.markers_[o];o++)r.setMap(this.map_);else if(this.markers_.length0&&this.anchor_[0]0&&this.anchor_[1]