    if (GBrowserIsCompatible()) {

      function createMarker(point) {
        map.addOverlay(new GMarker(point));
      }
      
      // ===== Setup The Maps =====
      
      // Display the main map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
     // map.addControl(new GLargeMapControl());
     // map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(-23.192756,150.965195), 3);

      
      // create the crosshair icon, which will indicate where we are on the minimap
      // Lets not bother with a shadow
      var Icon = new GIcon();
      Icon.image = "xhair.png";
      Icon.iconSize = new GSize(21, 21);
      Icon.shadowSize = new GSize(0,0);
      Icon.iconAnchor = new GPoint(11, 11);
      Icon.infoWindowAnchor = new GPoint(11, 11);
      Icon.infoShadowAnchor = new GPoint(11, 11);

  

  /*****************************************/
      // arrays to hold copies of the markers and html used by the side_bar
      // because the function closure trick doesnt work there
      var side_bar_html = "<h2>Find a Yacht</h2><ul>";
      var gmarkers = [];
      var htmls = [];
      var i = 0;


      function createMarker(point,name,html) {
        var marker = new GMarker(point);

        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
        side_bar_html += '<li><a href="javascript:myclick(' + i + ')">' + 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]);
      }


var bounds = new GLatLngBounds();

      // Read in the boat location data
      
      var request = GXmlHttp.create();
      request.open("GET", "data.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 name = parseFloat(markers[i].getAttribute("name"));
            var point = new GLatLng(lat,lng);
            var html1 = markers[i].getAttribute("html1");
            var label = markers[i].getAttribute("label");
            // create the marker
            var marker = createMarker(point,label,html1);
        map.addOverlay(marker);
		bounds.extend(point);
   }
          // put the assembled side_bar_html contents into the side_bar div

          
         
          // ========= Now process the polylines ===========
          var lines = xmlDoc.documentElement.getElementsByTagName("line");
          // read each line
          for (var a = 0; a < lines.length; a++) {
            // get any line attributes
            var colour = lines[a].getAttribute("colour");
            var width  = parseFloat(lines[a].getAttribute("width"));
            // read each point on that line
            var points = lines[a].getElementsByTagName("point");
            var pts = [];
            for (var i = 0; i < points.length; i++) {
               pts[i] = new GLatLng(parseFloat(points[i].getAttribute("lat")),
                                   parseFloat(points[i].getAttribute("lng")));
            }
            map.addOverlay(new GPolyline(pts,colour,width));
          }
          //Resize based on the data

  

	      // ===== determine the zoom level from the bounds =====
var level = map.getBoundsZoomLevel(bounds);
level = level - 1;
map.setZoom(level);
          // ===== determine the centre from the bounds ======
          map.setCenter(bounds.getCenter());
		  
        }
      }
      request.send(null);
      GEvent.addListener(map, 'move', Move);
    }
	

    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }