   
    if (GBrowserIsCompatible()) {
      var gmarkers = [];
      var gicons = [];

     function myAlert(){
	  GDownloadUrl(domWrapper+"xSSP_new.cfm", function(data) {
             maxContentDiv.innerHTML = data;
		 });
	  }
	  
	function TextualZoomControl() {
    }
    TextualZoomControl.prototype = new GControl();

    // Creates a one DIV for each of the buttons and places them in a container
    // DIV which is returned as our control element. We add the control to
    // to the map container and return the element for the map class to
    // position properly.
    TextualZoomControl.prototype.initialize = function(map) {
      var container = document.createElement("div");

      var zoomInDiv = document.createElement("div");
      this.setButtonStyle_(zoomInDiv);
      container.appendChild(zoomInDiv);
      zoomInDiv.appendChild(document.createTextNode("Zoom In"));
      GEvent.addDomListener(zoomInDiv, "click", function() {
        map.zoomIn();
      });
	  
	  var zoomOutDiv = document.createElement("div");
      this.setButtonStyle_(zoomOutDiv);
      container.appendChild(zoomOutDiv);
      zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));
      GEvent.addDomListener(zoomOutDiv, "click", function() {
        map.zoomOut();
      });
	  
	  var resetMap = document.createElement("div");
      this.setButtonStyle_(resetMap);
      container.appendChild(resetMap);
      resetMap.appendChild(document.createTextNode("Reset Map"));
      GEvent.addDomListener(resetMap, "click", function() {
        resetMyMap();
      });

      map.getContainer().appendChild(container);
      return container;
    }

    // By default, the control will appear in the top left corner of the
    // map with 7 pixels of padding.
    TextualZoomControl.prototype.getDefaultPosition = function() {
      return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
    }

    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyle_ = function(button) {
      button.style.textDecoration = "underline";
      button.style.color = "#FFF";
      button.style.backgroundColor = "black";
      button.style.font = "small Arial";
      button.style.border = "1px solid black";
      button.style.padding = "2px";
      button.style.marginBottom = "3px";
      button.style.textAlign = "center";
      button.style.width = "6em";
      button.style.cursor = "pointer";
    }

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.441944, -122.141944), 13);
        map.addControl(new TextualZoomControl());
      }
    }

     var twobedicon = new GIcon()  
  	 twobedicon.image = domWrapper+"img/gmapIcons/marker_2.png"  
	 twobedicon.size = new GSize(20,34)
	 twobedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 twobedicon.shadowSize = new GSize(39,34)
	 twobedicon.iconAnchor = new GPoint(10,34)  
	 twobedicon.infoWindowAnchor = new GPoint(10,0)
	 
	 var threebedicon = new GIcon()  
  	 threebedicon.image = domWrapper+"img/gmapIcons/marker_3.png"  
	 threebedicon.size = new GSize(20,34)
	 threebedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 threebedicon.shadowSize = new GSize(39,34)
	 threebedicon.iconAnchor = new GPoint(10,34)  
	 threebedicon.infoWindowAnchor = new GPoint(10,0)

	  
	 var fourbedicon = new GIcon()  
  	 fourbedicon.image = domWrapper+"img/gmapIcons/marker_4.png"  
	 fourbedicon.size = new GSize(20,34)
	 fourbedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 fourbedicon.shadowSize = new GSize(39,34)
	 fourbedicon.iconAnchor = new GPoint(10,34)  
	 fourbedicon.infoWindowAnchor = new GPoint(10,0)
	 
	 var fivebedicon = new GIcon()  
  	 fivebedicon.image = domWrapper+"img/gmapIcons/marker_5.png"  
	 fivebedicon.size = new GSize(20,34)
	 fivebedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 fivebedicon.shadowSize = new GSize(39,34)
	 fivebedicon.iconAnchor = new GPoint(10,34)  
	 fivebedicon.infoWindowAnchor = new GPoint(10,0)
	 
	 var sixbedicon = new GIcon()  
  	 sixbedicon.image = domWrapper+"img/gmapIcons/marker_6.png"  
	 sixbedicon.size = new GSize(20,34)
	 sixbedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 sixbedicon.shadowSize = new GSize(39,34)
	 sixbedicon.iconAnchor = new GPoint(10,34)  
	 sixbedicon.infoWindowAnchor = new GPoint(10,0)
	 
	 var sevenbedicon = new GIcon()  
  	 sevenbedicon.image = domWrapper+"img/gmapIcons/marker_7.png"  
	 sevenbedicon.size = new GSize(20,34)
	 sevenbedicon.shadow = domWrapper+"img/gmapIcons/marker_shadow.png"
	 sevenbedicon.shadowSize = new GSize(39,34)
	 sevenbedicon.iconAnchor = new GPoint(10,34)  
	 sevenbedicon.infoWindowAnchor = new GPoint(10,0)
 
	 
	  gicons["bed2"] = new GIcon(twobedicon);
	  gicons["bed3"] = new GIcon(threebedicon);
      gicons["bed4"] = new GIcon(fourbedicon);
      gicons["bed5"] = new GIcon(fivebedicon);
	  gicons["bed6"] = new GIcon(sixbedicon);
	  gicons["bed7"] = new GIcon(sevenbedicon);
      
      // A function to create the marker and set up the event window
      function createMarker(point,name,html,category) {		  
      var marker = new GMarker(point,gicons[category]);
        // === Store the category and name info as a marker properties ===
        marker.mycategory = category;                                 
        marker.myname = name;
		var myhtml = xHTML(name);
        GEvent.addListener(marker, "click", function() {
		map.savePosition();
		marker.openInfoWindowHtml(myhtml);
		lastMarker = marker;
		getInfoContent(name);
		});
		gmarkers.push(marker);
        return marker;
      }
	  
	  // Resort Amenitie Default Markers
	  var custIcon = new GIcon(G_DEFAULT_ICON);
      custIcon.iconSize = new GSize(32, 37);
      custIcon.iconAnchor = new GPoint(16, 37);
	  custIcon.shadowSize = new GSize(0, 0);
	  custIcon.imageMap = [29,0,30,1,31,2,31,3,31,4,31,5,31,6,31,7,31,8,31,9,31,10,31,11,31,12,31,13,31,14,31,15,31,16,31,17,31,18,31,19,31,20,31,21,31,22,31,23,31,24,31,25,31,26,31,27,31,28,31,29,30,30,29,31,23,32,22,33,21,34,20,35,19,36,12,36,11,35,10,34,9,33,8,32,2,31,1,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,1,1,2,0];
	  var myIcons = [];
      myIcons['pool'] = new GIcon(custIcon, domWrapper+'img/icons/gmap/pool.png');
      myIcons['playground'] = new GIcon(custIcon, domWrapper+'img/icons/gmap/playground.png');

      // A function to create the resort markers
      function createResortMarkers(myLat,myLang,name,note) {		  
        var xlat = myLat;
		var xlang = myLang;
		var point = new GLatLng(xlat,xlang);
		var marker = new GMarker(point, { icon: myIcons[name]});
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(note);
		});
		return marker;
		
      }
	  
	  // == shows all markers of a particular category, and ensures the checkbox is checked ==
      function show(category) {
        for (var i=0; i<gmarkers.length; i++) {
          if (gmarkers[i].mycategory == category) {
            gmarkers[i].show();
			
          }
		  
        }
        // == check the checkbox ==
        document.getElementById(category+'box').checked = true;
      }

      // == hides all markers of a particular category, and ensures the checkbox is cleared ==
      function hide(category) {
        for (var i=0; i<gmarkers.length; i++) {
          if (gmarkers[i].mycategory == category) {
            gmarkers[i].hide();
          }
        }
        // == clear the checkbox ==
        document.getElementById(category+'box').checked = false;
        // == close the info window, in case its open on a marker that we just hid
        map.closeInfoWindow();
      }
	  
	    

      // == a checkbox has been clicked ==
      function boxclick(box,category) {
        if (box.checked) {
          show(category);
		  resetTheMap();
		  map.closeInfoWindow();
		  } else {
          hide(category);
        }
        // == rebuild the side bar
        makeSidebar();
		zoomFit();
      }

      // create the map
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new TextualZoomControl());
	  // map.enableScrollWheelZoom(); 
	  //map.addControl(new GLargeMapControl3D());
      //map.addControl(new GMapTypeControl());
	  map.removeMapType(G_HYBRID_MAP);
	  map.removeMapType(G_SATELLITE_MAP);
	  //map.addControl(new GOverviewMapControl());
	  var myLayer = new GLayer("www.globalresorthomes.com");
      map.addOverlay(myLayer); 
	  map.setCenter(new GLatLng(resortLat,resortLong), resortZoom);
	  // Detect bubble clost. Reset last point.
	  GEvent.addListener(map.getInfoWindow(), 'closeclick', function()
      {xPoint();});
	  	 
	 // Read the Amenities
      GDownloadUrl(domWrapper+"gmapAmenitiesSpew.cfm?resort="+wResort, function(doc) {
        var xmlDoc = GXml.parse(doc);
        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 type = markers[i].getAttribute("type");
		  var note = markers[i].getAttribute("note");
          // create the marker
          var marker = createResortMarkers(lat,lng,type,"<div style='float:left; margin:4px;'><b>"+ note + "</b></div>");
		  map.addOverlay(marker);
		  }});  
	  
      // Read the data
      GDownloadUrl(domWrapper+"gmapSpew.cfm?resort="+wResort, function(doc) {
        var xmlDoc = GXml.parse(doc);
        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 address = markers[i].getAttribute("address");
          var name = markers[i].getAttribute("name");
		  var phone = markers[i].getAttribute("phone");
          var html = "";
		  var phone = markers[i].getAttribute("phone");
          var category = markers[i].getAttribute("category");
          // create the marker
          var marker = createMarker(point,name,html,category);
          map.addOverlay(marker);
		  }
			            
        // == show or hide the categories initially ==
        show("bed2");
        show("bed3");
		show("bed4");
        show("bed5");
		show("bed6");
		show("bed7");
       
       
      });
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    
    //]]>
	 

