	var iconOne = new GIcon(); 
    iconOne.image = 'images/fire-maltese.png';
    iconOne.shadow = 'images/fire-maltese-shadow.png';
    iconOne.iconSize = new GSize(20, 20);
    iconOne.shadowSize = new GSize(1,1);
    iconOne.iconAnchor = new GPoint(6, 20);
    iconOne.infoWindowAnchor = new GPoint(5, 1);

    var iconTwo = new GIcon(); 
    iconTwo.image = 'images/ems-star.png';
    iconTwo.shadow = 'images/fire-maltese-shadow.png';
    iconTwo.iconSize = new GSize(20, 20);
    iconTwo.shadowSize = new GSize(1,1);
    iconTwo.iconAnchor = new GPoint(6, 20);
    iconTwo.infoWindowAnchor = new GPoint(5, 1);
	
	var iconThree = new GIcon(); 
    iconThree.image = 'images/hospital-cross.png';
    iconThree.shadow = 'images/fire-maltese-shadow.png';
    iconThree.iconSize = new GSize(20, 20);
    iconThree.shadowSize = new GSize(1,1);
    iconThree.iconAnchor = new GPoint(6, 20);
    iconThree.infoWindowAnchor = new GPoint(5, 1);

    var customIcons = [];
    customIcons["1"] = iconOne;
    customIcons["2"] = iconTwo;
	customIcons["3"] = iconThree;

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(35.783842, -78.643570), 10);

        GDownloadUrl("phpsqlajax_genxml2.php", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
			var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
			var phone = markers[i].getAttribute("phone");
			var url = markers[i].getAttribute("url");
			var city = markers[i].getAttribute("city");			
            var type = markers[i].getAttribute("type");
			var type_id = markers[i].getAttribute("type_id");
            
            var marker = createMarker(name, address, point, phone, url, city, type, type_id);
            map.addOverlay(marker);
          }
        });
      }
    }

    function createMarker(name, address, point, phone, url, city, type, type_id) {
      var marker = new GMarker(point, customIcons[type_id]);
      var html = "<b>" + name + "</b> <br/>" + address + ", " + city + "<br/>" + phone + "<br/><a href=\"" + url + "\" target=\"_blank\">" + url + "</a>";
      GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }