    //<![CDATA[

    if (GBrowserIsCompatible()) {
      
 
      var hotIcon = new GIcon();
        hotIcon.image = "/GPS/xmlnjs/grn-blank.png";
        hotIcon.shadow = "/GPS/xmlnjs/mm_20_shadow.png";
        hotIcon.iconSize = new GSize(50, 50);
        hotIcon.shadowSize = new GSize(22, 20);
        hotIcon.iconAnchor = new GPoint(25, 50);
        hotIcon.infoWindowAnchor = new GPoint(25, 50);
    
      var coldIcon = new GIcon(hotIcon);
        coldIcon.image = "/GPS/xmlnjs/mm_20_red.png";
        coldIcon.iconSize = new GSize(12, 20);
        coldIcon.iconAnchor = new GPoint(6, 20);
        coldIcon.infoWindowAnchor = new GPoint(6, 20);
        coldIcon.shadowSize = new GSize(22, 20);
   
      var side_bar_html = "";

      // There are now two arrays of markers, one for cold icons and one for hot
      var cmarkers = [];
      var hmarkers = [];
      var htmls = [];
      var zooms = [];

      var i = 0;

      // A function to create the marker and set up the event window
      function createMarker(point,name,html,zoom) {
        var marker = new GMarker(point,coldIcon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save two markers for each point, one with each of the possible icons
        //zooms[i] = zoom;
        cmarkers[i] = marker;
        hmarkers[i] = new GMarker(point,hotIcon);
        htmls[i] = html;    
        zooms[i] = zoom;

        // add a line to the side_bar html, with click, mouseover and mouseout event handlers
        side_bar_html += '<a href="javascript:myclick(' + i + ')" onmouseover="mymouseover('+i+')" onmouseout="mymouseout('+i+')">' + name + '</a><br><br>';
        i++;
        return marker;
      }

      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        hmarkers[i].openInfoWindowHtml(htmls[i]);
//        map.setZoom(zooms[i]);
//        map.panTo(marker[i]);
      }
      
      // This function is invoked when the mouse goes over an entry in the side_bar
      // It deletes the cold Icon marker and replaces it with the hot Icon marker      
      function mymouseover(i) {
        map.removeOverlay(cmarkers[i]);
        map.addOverlay(hmarkers[i]);
//        map.panTo(marker[i]);
      }
      // This function is invoked when the mouse leaves an entry in the side_bar
      // It deletes the hot Icon marker and replaces it with the cold Icon marker      
      function mymouseout(i) {
        map.removeOverlay(hmarkers[i]);
        map.addOverlay(cmarkers[i]);
      }

      // create the map
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl(1));
      map.enableDoubleClickZoom();
      map.enableContinuousZoom();
///////////////////////////////////////////////////////////////////////////////////////////////      

//        map.setCenter(new GLatLng(37.87877729208064,-121.2994760235205), 8);
      map.setCenter(new GLatLng(53.904338,-4.350586), 5);
      map.setMapType(G_HYBRID_MAP);
    
      // Read the data from *****.xml
      
      var request = GXmlHttp.create();
      request.open("GET", "/GPS/xmlnjs/uklocal.xml", true);
      
//////////////////////////////////////////////////////////////////////////////////////////////////
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          var xmlDoc = request.responseXML;
          // 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 point = new GLatLng(lat,lng);
            var html = markers[i].getAttribute("html");
            var zoom = markers[i].getAttribute("zoom");
            var label = markers[i].getAttribute("label");
            // create the marker
            var marker = createMarker(point,label,html,zoom);
            map.addOverlay(marker);
          }
          // put the assembled side_bar_html contents into the side_bar div
          document.getElementById("side_bar").innerHTML = side_bar_html;
          
                   // ========= 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));
          }
          // ================================================           

        }
      }
      request.send(null);
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

  
    //]]>
 