function initialize() {

		// A function to create the marker and set up the event window
		function createMarker(point,name,html) {
			var marker = new GMarker(point,markerOptions);
			GEvent.addListener(marker, "mouseover", function() {
				marker.openInfoWindowHtml(html);
			});
			i++;
			return marker;
		}

		// create the map
		var myLatlng = new google.maps.LatLng(56.8,-4.35);
		var myOptions = {
		  zoom: 7,
		  center: myLatlng,
		  mapTypeId: google.maps.MapTypeId.TERRAIN
		}
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);




        var image = new google.maps.MarkerImage('http://labs.google.com/ridefinder/images/mm_20_red.png',
		  // This marker is 20 pixels wide by 32 pixels tall.
		  new google.maps.Size(12, 20),
		  // The origin for this image is 0,0.
		  new google.maps.Point(5,1),
		  // The anchor for this image is the base of the flagpole at 0,32.
		  new google.maps.Point(6, 20));
		



      // Read the data from example.xml
      var request = GXmlHttp.create();
      request.open('GET', '/includes/xml_reservemap.php', true);
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          var xmlDoc = GXml.parse(request.responseText);
          // 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 reserve = markers[i];
			var myIconLatLng = new google.maps.LatLng(markers[i].getAttribute("lat"), markers[i].getAttribute("lng"));
			var marker = new google.maps.Marker({
				position: myIconLatLng,
				map: map,
				title: markers[i].getAttribute("bname")
			});


			
			/*var openurl = markers[i].getAttribute("openurl");
			//var bname = markers[i].getAttribute("bname");
			var image = markers[i].getAttribute("image");
			
			
			if (openurl != "") 
			{
				var html = '<div style="width:100px;padding:5px;float:left"><a href="#" onclick="window.location=\''+openurl+'\';"><img src="'
				+image+'" style="width:100px;height:100px" /></div></a>';
				html += '<div style="width:200px;padding:5px 0;float:left"><b>'+bname+'</b><p><a href="#" onclick="window.location=\''+openurl+'\';">'
				+bname+': more information &raquo;</a></p></div>';
				
				// create the marker
				//var marker = createMarker(point,bname,html);
				//map.addOverlay(marker);
			} else {
				
				// create the marker when public access is restricted for reserve
				//map.addOverlay(new GMarker(point, markerOptions));
		
				
			}*/
			
           
          }
        }
      }
 
}
  function loadScript() {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
    document.body.appendChild(script);
  }
  
  window.onload = loadScript;

