	window.onload = onPageLoad;

      var map;
      var gmarkers = [];
      var htmls = [];
      var to_htmls = [];
      var from_htmls = [];
      var i=0;

      // A function to create the marker and set up the event window
      function createMarker(point,name,html) {
        var marker = new GMarker(point);

        // The info window version with the "to here" form open
        to_htmls[i] = html + '<br>Directions: <b>To The London Smile Clinic</b>' +
           '<br>Enter your postcode:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=20 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="' +
           point.y + ',' + point.x + "(" + name + ")" + '"/></form>';
        // The inactive version of the direction info
        html = html + '<br><b>Driving?</b> <a href="javascript:tohere('+i+')">Click here</a>';
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml('<div style="white-space:nowrap;">'+html+'</div>');
        });
        gmarkers[i] = marker;
        htmls[i] = html;
        i++;
        return marker;
      }

      // functions that open the directions forms
      function tohere(i) {
        gmarkers[i].openInfoWindowHtml('<div style="white-space:nowrap;">'+ to_htmls[i]+'</div>');
      }

      function fromhere(i) {
        gmarkers[i].openInfoWindowHtml('<div style="white-space:nowrap;">'+ from_htmls[i]+'</div>');
      }
	  

function onPageLoad() {
//<![CDATA[
      
	  // Display the map, with some controls and set the initial location 
      var map = new GMap(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.centerAndZoom(new GPoint(-0.142063, 51.522205),2);
    
      // Set up info window
      var point = new GPoint(-0.142063, 51.521205);
      var marker = createMarker(point,'London Smile Clinic','<img src="../images/mapLogo.jpg" width=150 height=18><br>40-44 Clipstone Street<br />London<br />W1W 5DW')
      map.addOverlay(marker);
      }

//]>
