function AvatarMarker(latlng,iconUrl,px) {
  this.latlng_ = latlng; 
  this.iconUrl_ = iconUrl;
  this.px = px;
}

AvatarMarker.prototype = new GOverlay();

// Creates the DIV representing this rectangle.
AvatarMarker.prototype.initialize = function(map) {
  // Create the DIV representing our rectangle
  var div = document.createElement("div");
  div.style.position = "absolute";

  // Our rectangle 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_FLOAT_PANE).appendChild(div);

  this.map_ = map;
  this.div_ = div;
  var thismarker = this;

  this.div_.onclick = function() {

	 GEvent.trigger(thismarker,'click');

  }

}

// Remove the main DIV from the map pane
AvatarMarker.prototype.remove = function() {
  this.div_.parentNode.removeChild(this.div_);
}

// Copy our data to a new AvatarMarker
AvatarMarker.prototype.copy = function() {
  return new AvatarMarker(this.latlng_,this.iconUrl_);
}

// Redraw the rectangle based on the current projection and zoom level
AvatarMarker.prototype.redraw = function(force) {

  if (!force) return;

  // Now position our DIV based on the DIV coordinates of our bounds
  this.div_.style.visibility = 'hidden';

  var attachingPoint = this.map_.fromLatLngToDivPixel(this.latlng_);


  this.div_.style.left = (attachingPoint.x - 10) + "px";
  this.div_.style.top = (attachingPoint.y  - 20) + "px";

  this.div_.innerHTML = '<img class="mapicon" style="width:'+this.px+'px; height:'+this.px+'px;" src="' + this.iconUrl_ + '" />';

  this.div_.style.visibility = 'visible';

}

AvatarMarker.prototype.openInfoWindowHtml = function(html) {

	this.map_.openInfoWindowHtml(this.latlng_,html,{pixelOffset : new GSize(0,-20)});

}