var map;
var centerLatitude = 39.913028;
var centerLongitude = -86.121826;
var description = '<strong>Sitehawk Retail Real Estate</strong><br /><span class="small">8500 Keystone Crossing, Suite 170<br />Indianapolis, Indiana 46240<br /><a href="http://maps.google.com/maps?f=d&hl=en&geocode=&time=&date=&ttype=&saddr=&daddr=8500+keystone+crossing,indianapolis,+in&sll=39.913028,-86.121826&sspn=0.037262,0.062141&ie=UTF8&z=16&om=1" target="_blank">Get Directions ></a></span>'
var startZoom = 5;

function init() 
{
  if (GBrowserIsCompatible()) {
    // instantiate map and associate with div id
    map = new GMap2(document.getElementById("map"));
    // add map controls
    map.addControl(new GMapTypeControl());
    map.addControl(new GSmallMapControl());
    // set map location and zoom level
    map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);
    addMarker(centerLatitude, centerLongitude, description)
  }
}

function addMarker(latitude, longitude, description){
  // set lat/long of new marker - could also set a custom GIcon as 2nd argument here
  var marker = new GMarker(new GLatLng(latitude,longitude));
  // add listener to open info window upon marker click
  GEvent.addListener(marker, 'click', function(){
                                        marker.openInfoWindowHtml(description);
                                      }
  );
  // add marker to map
  map.addOverlay(marker);
}


// auto load the init function (similar to <body onload="init()")    
window.onload = init;
// garbage collection to release memory to the browser
window.onunload = GUnload;