var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "http://chicagohomeestates.com/images/house_icons/house_icon.png";
tinyIcon.shadow = "http://chicagohomeestates.com/images/house_icons/house_icon_shadow.png";
tinyIcon.iconSize = new GSize(32, 29);
tinyIcon.shadowSize = new GSize(42, 31);
tinyIcon.iconAnchor = new GPoint(6, 20);
tinyIcon.infoWindowAnchor = new GPoint(5, 1);
var map = null;

// Set up our GMarkerOptions object literal
markerOptions = { icon:tinyIcon };

function createMarker(point, index, mtext) {
  // Create a lettered icon for this point using our icon class
  var letter = String.fromCharCode("A".charCodeAt(0) + index);
  var letteredIcon = new GIcon(tinyIcon);
  letteredIcon.image = "http://chicagohomeestates.com/images/house_icons/house_icon_" + index + ".png";

  // Set up our GMarkerOptions object
  markerOptions = { icon:letteredIcon };
  var marker = new GMarker(point, markerOptions);
//  GEvent.addListener(marker, "mouseover", function() {
//    marker.openInfoWindowHtml(mtext + "</b>");
//  });
//  GEvent.addListener(marker, "mouseout", function() {
//    marker.closeInfoWindow();
//  });
 GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(mtext + "</b>");
  });
return marker;
}
function initializeMap() {
  map = new GMap2(document.getElementById("map_canvas"));
  map.addControl(new GLargeMapControl());
  map.setCenter(new GLatLng(41.882047,-87.627916), 16);
}
function centerMap(bounds) {
mapZoom = map.getBoundsZoomLevel(bounds);
if (mapZoom < 5) mapZoom = 5;
if (mapZoom > 16) mapZoom = 16;
map.setCenter(bounds.getCenter(),mapZoom);
}
