function MessageWindow(bounds, id) {
  this.bounds_ = bounds;
  this.id_= id;
  var mwdiv_;
}

MessageWindow.prototype = new GOverlay();

// Creates the DIV representing this MessageWindow.
MessageWindow.prototype.initialize = function(map) {
  // Calculate the DIV coordinates of two opposite corners of our bounds to
  // get the size and position of our MessageWindow
  var c1 = map.fromLatLngToDivPixel(this.bounds_.getSouthWest());
  var c2 = map.fromLatLngToDivPixel(this.bounds_.getNorthEast());

  // Create the DIV representing our MessageWindow
  var mwdiv = document.createElement("div");
  mwdiv.setAttribute('id','mapmessage');

  // Now position our DIV based on the DIV coordinates of our bounds
  mwdiv.style.position = "absolute";
  mwdiv.style.left = Math.min(c2.x, c1.x) + "px";
  mwdiv.style.top = Math.min(c2.y, c1.y) + "px";
  mwdiv.style.zIndex = 10000;

  // create inner div holding content
  var idiv = document.getElementById(this.id_); //document.createElement("div");
  idiv.style.backgroundColor = "white";
  idiv.style.padding = "10px";
  idiv.style.paddingTop = "25px";
  idiv.style.border = '1px solid black';
  idiv.style.position = 'relative';
  idiv.style.zIndex = 1;
  idiv.style.width = Math.abs(c2.x - c1.x) + "px";
  idiv.style.height = Math.abs(c2.y - c1.y) + "px";
  idiv.style.display = 'block';
  // idiv.innerHTML = document.getElementById(this.id_).innerHTML;
  mwdiv.appendChild(idiv);

  // create close gif
  var img = document.createElement('img');
  img.src = "http://www.google.com/intl/en_ALL/mapfiles/close.gif";
  img.style.padding = 0;
  img.style.margin = 0;
  img.style.border = 0;
  img.style.position = "absolute";
  img.style.top='8px';
  img.style.left=(Math.abs(c2.x - c1.x)-8)+'px';
  try{img.style.cursor='pointer';}catch(e){img.style.cursor='hand';}
  img.onclick=function(){mwdiv.style.display = 'none';};
  idiv.appendChild(img);

  // create shadow 
  var shadow = document.createElement("div");
  shadow.style.position = 'absolute';
  shadow.style.left = '10px';
  shadow.style.top = '10px';
  shadow.style.padding = idiv.style.padding;
  shadow.style.backgroundColor = 'black';
  shadow.style.opacity = 0.4;
  shadow.style.width = idiv.style.width;
  shadow.style.height = idiv.style.height;
  mwdiv.appendChild(shadow);

  // Our MessageWindow is flat against the map, so we add our selves to the
  // FLOAT_PANE pane, which is at the same z-index as the InfoWindow
  // map.getPane(G_MAP_FLOAT_PANE).appendChild(div);
  document.getElementsByTagName('body')[0].appendChild(mwdiv);

  this.mwdiv_ = mwdiv;
}

// Remove the main DIV from the map pane
MessageWindow.prototype.remove = function() {
  fadeOut(100,this.mwdiv_);
  this.mwdiv_.style.display = 'none';
  // this.mwdiv_.parentNode.removeChild(this.mwdiv_);
}

// Copy our data to a new MessageWindow
MessageWindow.prototype.copy = function() {
  return new MessageWindow(this.bounds_, this.id_);
}

// Redraw the MessageWindow based on the current projection and zoom level
MessageWindow.prototype.redraw = function(force) {
  return;
}

