// JavaScript Document
//<![CDATA[
    if (GBrowserIsCompatible()) { 

      // A function to create the marker and set up the event window
      // Dont try to unroll this function. It has to be here for the function closure
      // Each instance of the function preserves the contends of a different instance
      // of the "marker" and "html" variables which will be needed later when the event triggers.    
      function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.setCenter(new GLatLng(51.62164,-0.339546),12);
    
      // Set up three markers with info windows 
    
      var point = new GLatLng(51.583357,-0.314151);
      var marker = createMarker(point,'<div style="width:160px"><strong>Kenton</strong><br/>225 Kenton Road<br/>Kenton<br/>Middlesex HA3 0HD<br/>Tel. (020) 8909 1810</div>')
      map.addOverlay(marker);

      var point = new GLatLng(51.573022,-0.294292);
      var marker = createMarker(point,'<div style="width:160px"><strong>Preston Road</strong><br/>282 Preston Road<br/>Wembley<br/>London HA3 0QA<br/>Tel. (020) 8904 8569</div>')
      map.addOverlay(marker);

var point = new GLatLng(51.570915,-0.41174);
      var marker = createMarker(point,'<div style="width:160px"><strong>Ruislip Manor</strong><br/>102 Victoria Road<br/>South Harrow<br/>Middlesex HA4 0AL<br/>Tel. (01895) 625572</div>')
      map.addOverlay(marker);
	  
	  var point = new GLatLng(51.595082,-0.382236);
      var marker = createMarker(point,'<div style="width:160px"><strong>Pinner</strong><br/>13 Love Lane<br/>Pinner<br/>Middlesex HA5<br/>Tel. (020) 8866 4683</div>')
      map.addOverlay(marker);
	  
	  var point = new GLatLng(51.575848,-0.397147);
      var marker = createMarker(point,'<div style="width:160px"><strong>Eastcote Shop and Office</strong><br/>114 Field End Road<br/>Eastcote<br/>Middlesex HA5 1RL<br/>Tel. (020) 8966 9688</div>')
      map.addOverlay(marker);
	  
	    var point = new GLatLng(51.657755,-0.399563);
      var marker = createMarker(point,'<div style="width:160px"><strong>Watford</strong><br/>53 The Parade<br/>Watford<br/>Herts WD17 1LJ<br/>Tel. (01923) 630 669</div>')
      map.addOverlay(marker);
	  
    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://www.econym.demon.co.uk/googlemaps/

    //]]>

