var vertical_offset = -28;
var horizontal_offset = -6;

function DivClusterOverlay(point, count, opt_weight, opt_color) {
      this.point_ = point;
      this.count_ = count;
      this.weight_ = opt_weight || 0;
      this.color_ = opt_color || "#888888";
    }
    DivClusterOverlay.prototype = new GOverlay();

    // Creates the DIV representing this DivClusterOverlay.
    DivClusterOverlay.prototype.initialize = function(map) {
      // Create the DIV representing our DivClusterOverlay
      var div = document.createElement("div");
      div.className = "clusterCount";
      div.innerHTML = this.count_;
      //div.style.color = "#BE1F24";
      /*div.style.color = "#FFFFFF";
      div.style.fontSize = "8px";
      div.style.textAlign = "center";
      div.style.fontWeight = "bold";
      div.style.position = "absolute";*/
      // Our DivClusterOverlay is flat against the map, so we add our selves to the
      // MAP_PANE pane, which is at the same z-index as the map itself (i.e.,
      // below the marker shadows)
      map.getPane(G_MAP_MARKER_PANE).appendChild(div);

      this.map_ = map;
      this.div_ = div;
    }

    // Remove the main DIV from the map pane
    DivClusterOverlay.prototype.remove = function() {
      this.div_.parentNode.removeChild(this.div_);
    }

    // Copy our data to a new DivClusterOverlay
    DivClusterOverlay.prototype.copy = function() {
      return new DivClusterOverlay(this.bounds_, this.count_, this.weight_, this.color_,
                           this.backgroundColor_, this.opacity_);
    }

    // Redraw the DivClusterOverlay based on the current projection and zoom level
    DivClusterOverlay.prototype.redraw = function(force) {

      // We only need to redraw if the coordinate system has changed
      if (!force) return;

      // Calculate the DIV coordinates of two opposite corners of our bounds to
      // get the size and position of our DivClusterOverlay
      var pixpnt = this.map_.fromLatLngToDivPixel(this.point_);
      
      // Always set size to 19x9 and offset to cover the icon
      this.div_.style.width = "19px";
      this.div_.style.height = "9px";
      this.div_.style.left = (pixpnt.x + horizontal_offset) + "px";
      if(this.count_ >= 1000)
      {
      	this.div_.style.left = (pixpnt.x + horizontal_offset - 3) + "px";
      }
      else
      {
      	this.div_.style.left = (pixpnt.x + horizontal_offset) + "px";
      }
      this.div_.style.top = (pixpnt.y + vertical_offset) + "px";
    }

