if (GBrowserIsCompatible()) {
      var gmarkers = [];
      var gicons = [];

      gicons["athletic"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/07/soccericon.png");
	  gicons["athletic"].iconSize = new GSize(32,40);
          gicons["athletic"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["athletic"].imageMap = [3,3, 27,3, 27,27, 3,27];
gicons["athletic"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["athletic"].shadowSize = new GSize(52, 37);
	  gicons["athletic"].iconAnchor = new GPoint(16, 36);
	  gicons["athletic"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["cultinst"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/justiceicon.png");
	  gicons["cultinst"].iconSize = new GSize(32,40);
          gicons["cultinst"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["cultinst"].imageMap = [3,3, 27,3, 27,27, 3,27];
gicons["cultinst"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["cultinst"].shadowSize = new GSize(52, 37);
	  gicons["cultinst"].iconAnchor = new GPoint(16, 36);
	  gicons["cultinst"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["dining"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/restauranticon.png");
	  gicons["dining"].iconSize = new GSize(32,40);
          gicons["dining"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["dining"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["dining"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["dining"].shadowSize = new GSize(52, 37);
	  gicons["dining"].iconAnchor = new GPoint(16, 36);
	  gicons["dining"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["golf"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/golficon.png");
	  gicons["golf"].iconSize = new GSize(32,40);
          gicons["golf"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["golf"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["golf"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["golf"].shadowSize = new GSize(52, 37);
	  gicons["golf"].iconAnchor = new GPoint(16, 36);
	  gicons["golf"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["natsur"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/beautifulicon.png");
	  gicons["natsur"].iconSize = new GSize(32,40);3
          gicons["natsur"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["natsur"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["natsur"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["natsur"].shadowSize = new GSize(52, 37);
	  gicons["natsur"].iconAnchor = new GPoint(16, 36);
	  gicons["natsur"].infoWindowAnchor = new GPoint(15, 3);
	  
      gicons["parkfac"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/homeicon.png");     
	  gicons["parkfac"].iconSize = new GSize(32,40);
          gicons["parkfac"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["parkfac"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["parkfac"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["parkfac"].shadowSize = new GSize(52, 37);
	  gicons["parkfac"].iconAnchor = new GPoint(16, 36);
	  gicons["parkfac"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["picnic"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/picnicicon.png");
	  gicons["picnic"].iconSize = new GSize(32,40);
          gicons["picnic"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["picnic"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["picnic"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["picnic"].shadowSize = new GSize(52, 37);
	  gicons["picnic"].iconAnchor = new GPoint(16, 36);
	  gicons["picnic"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["play"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/playgroundicon.png");
	  gicons["play"].iconSize = new GSize(32,40);
          gicons["play"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["play"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["play"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["play"].shadowSize = new GSize(52, 37);
	  gicons["play"].iconAnchor = new GPoint(16, 36);
	  gicons["play"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["stats"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/fountainicon.png");
	  gicons["stats"].iconSize = new GSize(24,30);
          gicons["stats"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["stats"].imageMap = [3,3, 22,3, 22,22, 3,22]
gicons["stats"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow4.png";
	  gicons["stats"].shadowSize = new GSize(49, 30);
	  gicons["stats"].iconAnchor = new GPoint(15, 34);
	  gicons["stats"].infoWindowAnchor = new GPoint(15, 3);
	  
	  gicons["ten"] = new GIcon(G_DEFAULT_ICON, "http://www.forestparkforever.org/wp-content/uploads/2009/08/tennisicon.png");
	  gicons["ten"].iconSize = new GSize(32,40);
          gicons["ten"].transparent = "http://www.forestparkforever.org/wp-content/uploads/2009/08/iconclick.png";
gicons["ten"].imageMap = [3,3, 27,3, 27,27, 3,27]
gicons["ten"].shadow = "http://www.forestparkforever.org/wp-content/uploads/2009/08/shadow3.png";
	  gicons["ten"].shadowSize = new GSize(52, 37);
	  gicons["ten"].iconAnchor = new GPoint(16, 36);
	  gicons["ten"].infoWindowAnchor = new GPoint(15, 3);
	  
      function createMarker(point,name,html,category) {
        var marker = new GMarker(point,gicons[category]);
        // === Store the category and name info as a marker properties ===
        marker.mycategory = category;                                 
        marker.myname = name;
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html,{maxWidth:200},{Height:200});
        });
        gmarkers.push(marker);
        return marker;
      }

      // == shows all markers of a particular category, and ensures the checkbox is checked ==
      function show(category) {
        for (var i=0; i<gmarkers.length; i++) {
          if (gmarkers[i].mycategory == category) {
            gmarkers[i].show();
          }
        }
        // == check the checkbox ==
        document.getElementById(category+"box").checked = true;
      }

      // == hides all markers of a particular category, and ensures the checkbox is cleared ==
      function hide(category) {
        for (var i=0; i<gmarkers.length; i++) {
          if (gmarkers[i].mycategory == category) {
            gmarkers[i].hide();
          }
        }
        // == clear the checkbox ==
        document.getElementById(category+"box").checked = false;
        // == close the info window, in case its open on a marker that we just hid
        map.closeInfoWindow();
      }

      // == a checkbox has been clicked ==
      function boxclick(box,category) {
        if (box.checked) {
          show(category);
        } else {
          hide(category);
        }
      }

      function myclick(i) {
        GEvent.trigger(gmarkers[i],"click");
      }

      // create the map
    var map = new GMap2(document.getElementById("fpfmap"),{size:new GSize(450,600)});
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
	map.setMapType(G_NORMAL_MAP);
	var mt = map.getMapTypes();
	// Overwrite the getMinimumResolution() and getMaximumResolution() methods
      for (var i=0; i<mt.length; i++) {
        mt[i].getMinimumResolution = function() {return 13;}
        mt[i].getMaximumResolution = function() {return 18;}
	  }
      map.setCenter(new GLatLng(38.639358,-90.284164), 15);
	



      // Read the data
      GDownloadUrl("http://www.forestparkforever.org/wp-content/uploads/2009/08/import.xml", function(doc) {
        var xmlDoc = GXml.parse(doc);
        var markers = xmlDoc.documentElement.getElementsByTagName("marker");
          
        for (var i = 0; i < markers.length; i++) {
          // obtain the attribues of each marker
          var lat = parseFloat(markers[i].getAttribute("lat"));
          var lng = parseFloat(markers[i].getAttribute("lng"));
          var point = new GLatLng(lat,lng);
          var address = markers[i].getAttribute("address");
          var name = markers[i].getAttribute("name");
		  var img = markers[i].getAttribute("img");
          var html = "<center><u><b>"+name+"<\/b></u></center><br>"+ "<center>"+img+"</center>"+"<br>"+address;
          var category = markers[i].getAttribute("category");
          // create the marker
          var marker = createMarker(point,name,html,category);
          map.addOverlay(marker);
        }

        // == show or hide the categories initially ==
        show("athletic");
		hide("cultinst");
		hide("dining"); 
		hide("golf");
		hide("natsur");
		hide("parkfac");
        hide("picnic");
		hide("play");
		hide("stats");
		hide("ten");
		// == create the initial sidebar ==
        });
    }
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    

    

    //]]>
