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.    
	 var side_bar_html = "";
      var gmarkers = [];
      var htmls = [];
      var i = 0;
      // arrays to hold variants of the info window html with get direction forms open
      var to_htmls = [];
      var from_htmls = [];
	
	/*
	function createMarker(point,html, label) { 
        var marker = new GMarker(point, {title:label});
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html, {maxWidth:205});
          map.setCenter(marker.getPoint(), 15);
        });
        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(51.85727,0.072495),9);
	//map.setCenter(new GLatLng(51.85727,0.072495),11);
	  	

      



      // Read the data from example.xml
      var request = GXmlHttp.create();
   request.open("GET", "hosp.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 label = markers[i].getAttribute("label");
         var displaylabel = new ELabel(new GLatLng(lat,lng), markers[i].getAttribute("label"), "gmaplabel", new GSize(0,-35), 80, true);
         // create the marker
         var marker = createMarker(point,label,html);
         map.addOverlay(marker);
         map.addOverlay(displaylabel);
       }
       // put the assembled side_bar_html contents into the side_bar div
       document.getElementById("side_bar").innerHTML = side_bar_html;
     }
   }
   request.send(null);
	
} else {// display a warning if the browser was not compatible
	alert("Sorry, the Google Maps API is not compatible with this browser");
}




