// Create a directions object and register a map and DIV to hold the 
// resulting computed directions
function gmap() 
{
	// Locate and Center Map 1
	map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(41.551948,-70.631189), 12);
	
	// Create Jonsson Center and Hotel Points
	var point_J = new GLatLng(41.538530, -70.653370);
	var geocoder = new GClientGeocoder();
	
	// Create a base icon for all of our markers that specifies the
	// shadow, icon dimensions, etc.
	var baseIcon = new GIcon();
	baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	baseIcon.iconSize = new GSize(20, 34);
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, 34);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);				
	
	function showAddress(address,icontext) 
	{
	  if (geocoder) 
	  {
		geocoder.getLatLng(address,
		  function(point) 
		  {
			if (!point) 
			{
			  alert(address + " not found");
			} 
			else
			{
			  var icon = new GIcon(baseIcon);
			  icon.image = "http://www.google.com/mapfiles/marker"+icontext+".png";						
			  var marker = new GMarker(point, icon);
			  map.addOverlay(marker);
			}
		  }
		);
	  }
	}				
	
	// Add Points to Maps
	var icon_J = new GIcon(baseIcon);
	icon_J.image = "http://www.google.com/mapfiles/markerA.png";					
	var marker_J = new GMarker(point_J, icon_J);
	map.addOverlay(marker_J);
	showAddress('291 Jones Rd, Falmouth, MA 02540','B');
	showAddress('549 Woods Hole Rd, Woods Hole, MA 02543','C');
	
	// Add small map controls
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());	
}