window.onload = function() {

  if (GBrowserIsCompatible()) {

    // Create a new google map

    var map = new GMap2(document.getElementById('map'));

     

    // Center on the world

    map.setCenter(new GLatLng(37.16907157713011, -119.871826171875), 6);

     

    // Add controls

    map.addControl(new GLargeMapControl());

    map.addControl(new GMapTypeControl());

    

     // Attach mapeed plugin

    new Mapeed.Map(map, {

      onMarkerClicked: function(marker, id) {

        var content = ['ID: '         + id,

                       'Latitude: '   + marker.getGLatLng().lat(),

                       'Longitude: ' + marker.getGLatLng().lng()]

        marker.getGMarker().openInfoWindowHtml(content.join('<br/>'));

      },

      onZoomMaxClusterClicked: function(cluster, ids) {

        var content = ['IDs: '        + ids.join(','),

                       'Latitude: '   + cluster.getGLatLng().lat(),

                       'Longitude: ' + cluster.getGLatLng().lng()]

        cluster.getGMarker().openInfoWindowHtml(content.join('<br/>'));

      }

    });

  }

  

  window.onunload = GUnload;

};

