function addPoints() {
    if (GBrowserIsCompatible()) {
        var hPoints = new Hashtable();
        var bounds = new GLatLngBounds();
        
        // Add a marker for each point using the indicated lat/long/icon/etc...
        // Store the marker in a hashtable so we can get at it later
        $("ul.points li.point").hide().each(function() {
            var lat = $(this).find("ul li.lat").text();
            var lng = $(this).find("ul li.lng").text();
            var htmlContent = $(this).find("div.popup").html();
            var pinIcon = $(this).find("img.icon").attr("src");
            var point = new GLatLng(lat, lng);
            var marker = createMarker(point, pinIcon, htmlContent);
            hPoints.put($(this).attr("id"), marker);
            map.addOverlay(marker);
            bounds.extend(point);
        });

        map.setCenter(bounds.getCenter());
        map.setZoom(map.getBoundsZoomLevel(bounds));
        
        // Add a click event to each of hte location points so the info window is displayed
        $("ul.locations li.location").each(function() {
            $(this).click(function() {
                var marker = hPoints.get($(this).attr("id").replace("loc_", "point_"));
                map.setCenter(marker.getLatLng(), 7);
                marker.openInfoWindowHtml($(this).find("div.popup").html());
            }).find("div.popup").hide();
        });
    }
}

// Creates a marker 
function createMarker(point, pinIcon, htmlContent) {
    // Create a custom icon for this point using our icon class
    var customIcon = new GIcon(G_DEFAULT_ICON);
    if (pinIcon != null) {
        customIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        customIcon.image = pinIcon;
        customIcon.iconSize = new GSize(30, 30);
        customIcon.shadowSize = new GSize(54, 30);
        customIcon.iconAnchor = new GPoint(9, 34);
        customIcon.infoWindowAnchor = new GPoint(16, 2)
        customIcon.infoShadowAnchor = new GPoint(18, 25);
    }

    // Set up our GMarkerOptions object
    markerOptions = { icon: customIcon };
    var marker = new GMarker(point, markerOptions);
    
    // Hook up event for the info window
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(htmlContent);
    });
    
    return marker;
}

