			var gmarkers = [];
      var htmls = [];
      var to_htmls = [];
      var from_htmls = [];
      var i=0;

      // A function to create the marker and set up the event window
      function createMarker(point,name,html) {
        var marker = new GMarker(point);

        // The info window version with the "to here" form open
        to_htmls[i] = html + '<br>Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' +
           '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=48 name="saddr" id="saddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() +
                  // "(" + name + ")" +
           '"/>';
					 
        // The info window version with the "from here" form open
        from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' +
           '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=48 name="daddr" id="daddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() +
                  // "(" + name + ")" +
           '"/>';
        // The inactive version of the direction info
        html = html + '<br>Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';

        GEvent.addListener(marker, "click", function() {
				html = '<div style="width:225px;height:100px">' + html + '</div>';
				marker.openInfoWindowHtml(html);
        });
        gmarkers[i] = marker;
        htmls[i] = html;
        i++;
        return marker;
      }

      // functions that open the directions forms
      function tohere(i) {
        gmarkers[i].openInfoWindowHtml(to_htmls[i]);
      }
      function fromhere(i) {
        gmarkers[i].openInfoWindowHtml(from_htmls[i]);
      }

      // Display the map, with some controls and set the initial location
      function load() {
      if (GBrowserIsCompatible()) {

	  var map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallZoomControl ());
      map.addControl(new GMapTypeControl());			

      map.setCenter(new GLatLng(27.919398,-82.78350), 10);
//			map.setMapType(G_HYBRID_MAP); 
      // Set up markers with info windows 

			var point = new GLatLng(27.851998,-82.84450);
      var marker = createMarker(point,'Bay and Beach Club','Bay and Beach Club<br>19508 Gulf Blvd, Suite 103<br>Indian Shores, FL 33785')
      map.addOverlay(marker);
			
			point = new GLatLng(27.851898,-82.84515);
      marker = createMarker(point,'Bay and Beach Club','Bay and Beach Club<br>19508 Gulf Blvd, Suite 103<br>Indian Shores, FL 33785')
      map.addOverlay(marker);

			point = new GLatLng(27.791377,-82.789545);
      marker = createMarker(point,'Commodore Beach Club','Commodore Beach Club<br />13536 Gulf Blvd.<br />Madeira Beach, FL 33708')
      map.addOverlay(marker);

			point = new GLatLng(27.714000,-82.738360);
      marker = createMarker(point,'Hideaway Sands Resort','Hideaway Sands Resort<br>3804 Gulf Blvd.<br>St. Pete Beach, FL 33706')
      map.addOverlay(marker);

			point = new GLatLng(27.774194,-82.775399);
      marker = createMarker(point,'Jamaican on the Gulf','Jamaican on the Gulf<br>11660 Gulf Blvd.<br />Treasure Island, FL 33706')
      map.addOverlay(marker); 
			
			point = new GLatLng(27.817753,-82.823558);
      marker = createMarker(point,'Redington Ambassador','Redington Ambassador<br>16900 Gulf Blvd.<br />North Redington Beach, FL 33708')
      map.addOverlay(marker); 
			
			point = new GLatLng(28.080300,-82.778250);
      marker = createMarker(point,'Sutherland Crossing','Sutherland Crossing<br>962 Sea View Circle<br />Crystal Beach, FL 34681')
      map.addOverlay(marker);


	  }
}

