﻿    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.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(54.17117, -2.82589), 10);
    
      // Set up three markers with info windows 
    
       var point = new GLatLng(54.410279906999904,-2.948182225227356);
       var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstar">Low Wood Bay</span></h3><p>Windermere<br />Cumbria<br />England, UK<br />LA23 1LP<br />Reservations: <strong>08458 503 502</strong> (UK only)<br />Tel: <strong>+44 (0)15394 33338</strong><br />Email: <a href="mailto:%6c%6f%77%77%6f%6f%64%62%61%79%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#108;&#111;&#119;&#119;&#111;&#111;&#100;&#98;&#97;&#121;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="lowwood.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);

      var point = new GLatLng(54.420618562417026,-2.9616227746009827);
      var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstarOneRosette">Waterhead</span></h3><p>Ambleside<br />Cumbria<br />England, UK<br />LA22 0ER<br />Reservations: <strong>08458 504 503</strong> (UK only)<br />Tel: <strong>+44 (0)15394 32566</strong><br />Email: <a href="mailto:%77%61%74%65%72%68%65%61%64%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#119;&#97;&#116;&#101;&#114;&#104;&#101;&#97;&#100;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="waterhead.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);

      var point = new GLatLng(54.35066009491293,-2.870202362537384);
      var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstar">The Wild Boar</span></h3><p>Crook Road<br />Windermere<br />Cumbria<br />England, UK<br />LA23 3NF<br />Reservations: <strong>08458 504 604</strong> (UK only)<br />Tel: <strong>+44 (0)15394 45225</strong><br />Email: <a href="mailto:%74%68%65%77%69%6c%64%62%6f%61%72%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#116;&#104;&#101;&#119;&#105;&#108;&#100;&#98;&#111;&#97;&#114;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="wildboar.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);
	  
	  var point = new GLatLng(54.339281164744115,-2.9356402158737183);
	  var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstarTwoRosette">Storrs Hall</span></h3><p>Windermere<br />Cumbria<br />England, UK<br />LA23 3LG<br />Reservations: <strong>08458 507 506</strong> (UK only)<br />Tel: <strong>+44 (0)15394 47111</strong><br />Email: <a href="mailto:%73%74%6f%72%72%73%68%61%6c%6c%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#115;&#116;&#111;&#114;&#114;&#115;&#104;&#97;&#108;&#108;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="storrshall.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);
	  
	  var point = new GLatLng(54.006502998949486,-2.7888885140419006);
	  var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstarOneRosette">Lancaster House</span></h3><p>Green Lane, Ellel<br />Lancaster<br />England, UK<br />LA1 4GJ<br />Reservations: <strong>08458 509 508</strong> (UK only)<br />Tel: <strong>+44 (0)1524 844822</strong><br />Email: <a href="mailto:%6c%61%6e%63%61%73%74%65%72%68%6f%75%73%65%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#108;&#97;&#110;&#99;&#97;&#115;&#116;&#101;&#114;&#104;&#111;&#117;&#115;&#101;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="lancaster.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);

      var point = new GLatLng(54.072087, -2.875167);
      var marker = createMarker(point, '<div style="width:240px"><h3><span class="fourstar">The Midland</span></h3><p>Marine Road West<br />Morecambe<br />Lancashire<br />England, UK<br />LA4 4BU<br />Reservations: <strong>08458 501 240</strong> (UK only)<br />Tel: <strong>+44(0)1524 424000</strong><br />Email: <a href="mailto:%74%68%65%6d%69%64%6c%61%6e%64%40%65%6e%67%6c%69%73%68%6c%61%6b%65%73%2e%63%6f%2e%75%6b">&#116;&#104;&#101;&#109;&#105;&#100;&#108;&#97;&#110;&#100;&#64;&#101;&#110;&#103;&#108;&#105;&#115;&#104;&#108;&#97;&#107;&#101;&#115;&#46;&#99;&#111;&#46;&#117;&#107;</a><br /><a href="midland.aspx">Get more detailed information</a></p></div>')
      map.addOverlay(marker);
      
       //  ======== Add a map overview ==========
      map.addControl(new GOverviewMapControl(new GSize(150,150)));

      //  ======== A function to adjust the positioning of the overview ========
      function positionOverview(x,y) {
        var omap=document.getElementById("map_overview");
        omap.style.left = x+"px";
        omap.style.top = y+"px";
        
        // == restyling ==
        omap.firstChild.style.border = "1px solid gray";

        omap.firstChild.firstChild.style.left="2px";
        omap.firstChild.firstChild.style.top="2px";
        omap.firstChild.firstChild.style.width="140px";
        omap.firstChild.firstChild.style.height="140px";
        }
        //  ======== Cause the overview to be positioned AFTER IE sets its initial position ======== 
//      setTimeout("positionOverview(558,254)",1);
    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
