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