    if (GBrowserIsCompatible()) {
      // this variable will collect the html which will eventually be placed in the side_bar
      var drop_down_html = "";
	  var text_list_html = "";
    
      // arrays to hold copies of the markers and html used by the side_bar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var htmls = [];
      var i = 0;
      
      // === Create an associative array of GIcons() ===
      var gicons = [];
	  
      gicons["cricket"] = new GIcon(G_DEFAULT_ICON, "_templateFiles/images/icons/cricket.png");
	  gicons["cricket"].iconSize = new GSize(32,32);
	  
	  

      // A function to create the marker and set up the event window
      function createMarker(point,name,html) {
        // === create a marker with the requested icon ===
        var marker = new GMarker(point, gicons["cricket"]);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
        htmls[i] = html;
        // add a line to the side_bar html
        drop_down_html += '<option onClick="javascript:myclick(' + i + ')">' + name + '<\/a><\/option>';
		text_list_html += '<li><a href="javascript:myclick(' + (gmarkers.length-1) + ')">' + name + '<\/a></li>';
        i++;
        return marker;
      }


      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }


      // create the map
      var map = new GMap2(document.getElementById("map"));
	  
      // ====== Restricting the range of Zoom Levels =====
      // Get the list of map types      
      var mt = map.getMapTypes();
      // Overwrite the getMinimumResolution() and getMaximumResolution() methods
      for (var i=0; i<mt.length; i++) {
        mt[i].getMinimumResolution = function() {return 9;}
        mt[i].getMaximumResolution = function() {return 20;}
      }

      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng( -33.76216640916963,151.22783660888672), 12); //center of map (parramatta)


      // Read the data from example5.xml
      var request = GXmlHttp.create();
      request.open("GET", "grounds.xml", true);
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          var xmlDoc = GXml.parse(request.responseText);
          // obtain the array of markers and loop through it
          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 label = markers[i].getAttribute("label");
			var address = markers[i].getAttribute("address");
			var image = markers[i].getAttribute("image");
			
			//customise the HTML to appear in the infobox
			var html = ("<h4>") + label + ("<\/h4>") + address + ("<img src='") + image + ("' class='mapImg'");

			
			
			
            // === create the marker ===
            var marker = createMarker(point,label,html);
            map.addOverlay(marker);
          }
          // put the assembled drop_down_html contents into the side_bar div
		  document.getElementById("text_list").innerHTML = ("<ul>") + text_list_html + ("</ul>");
		}
      }
      request.send(null);
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }