var marker_full_url = static_url + "pics/marker-full.png";
var full_zoom = 1;
var markerFull = false;
var map = false;

function initialize()
{
    if (GBrowserIsCompatible())
    {
        var css = document.createElement("link");
        css.href = "http://www.maptimize.com/stylesheets/cluster.css";
        css.rel = "stylesheet";
        css.type="text/css";

        document.getElementsByTagName("head")[0].appendChild(css);

        document.getElementById("map_location").style.display = "block";

        var default_location = new GLatLng(48.8566667, 2.3509871);

        markerFull = new GIcon(G_DEFAULT_ICON);
        markerFull.image = marker_full_url;
        markerFull.iconSize = new GSize(25, 30);

        map = new GMap2(document.getElementById("map_location"));
        map.addControl(new GSmallZoomControl ());
        map.setCenter(default_location, full_zoom);

        var maptimizeMap = new Maptimize.Map(map, {
          onMarkerClicked: function(marker, id) {
            // marker: is an instance of Maptimize.Marker
            // id:     is the id you set for this marker in your CSV file
            jx.load(www_url + 'membres/miniprofil.php?id=' + marker.getId(), function(data) {
                marker.getGMarker().openInfoWindowHtml(data);
            });
          },
          onZoomMaxClusterClicked: function(cluster, ids) {
            // cluster: is an instance of Maptimize.Cluster
            // ids:     is an Array of all ids you set in your CSV file that are included in this cluster
            jx.load(www_url + 'membres/miniprofil.php?ids=' + ids, function(data) {
                cluster.getGMarker().openInfoWindowHtml(data);
            });
          }
        });
    }
}

window.onload = function() { initialize(); }
