//<![CDATA[

    if (GBrowserIsCompatible()) {
      
      // this variable will collect the html which will eventually be placed in the side_bar
      var side_bar_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 = [];


      // A function to create the marker and set up the event window
      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.push(marker);
        // add a line to the side_bar html
        side_bar_html += '<a href="javascript:myclick(' + (gmarkers.length-1) + ')">' + name + '<\/a><br>';
         return marker;
      }


      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        GEvent.trigger(gmarkers[i], "click");
      }


      // create the map
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(51.50862,-0.13825), 16);

      // add the points    
      var point = new GLatLng(51.50687,-0.13951);
      var marker = createMarker(point,"Boodle's","<strong>Boodle's Main Entrance</strong><br><br>28 St James's Street London SW1A 1HJ<br><br>Tel: 020 7930 7166")
      map.addOverlay(marker);

      var point = new GLatLng(51.50711,-0.13883);
      var marker = createMarker(point,"Ladies Entrance","<strong>Boodle's Ladies Entrance.</strong><br><br>27 St. James's Street London SW1A 1HJ<br><br>The entrance is located directly behind the Club building in the Economist Plaza.")
      map.addOverlay(marker);
                      
                       
      // put the assembled side_bar_html contents into the side_bar div
      document.getElementById("side_bar").innerHTML = side_bar_html;
      
    }

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

    // This Javascript is based on code provided by the
    // Community Church Javascript Team
    // http://www.bisphamchurch.org.uk/   
    // http://econym.org.uk/gmap/

    //]]>

