var g_google_maps_address_id = "fromaddress"; // The id of the FormBuilder2 Address field
var g_google_maps_address = "+35° 25' 56.94\", -83° 49' 16.49\"";
//var g_google_maps_address_display = g_google_maps_address;
var g_google_maps_address_display = "50 Fontana Road. Fontana Dam, North Carolina 28733";
var g_google_maps_company_name = "Fontana Village";
//var g_google_maps_directions_destination_address = g_google_maps_address;
//var g_google_maps_directions_destination_address = "35.436595,-83.778262";
var g_google_maps_directions_destination_address = "35.432483,-83.821247";
//+35° 25' 56.94", -83° 49' 16.49"

function getLocations_callback(zoom_level, response)
{
	// Retrieve the object
	var place = response.Placemark[0];
	
	// Retrieve the latitude and longitude
	var point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
	
	// Center the map on this point
	this.setCenter(point, zoom_level);
	
	// Create a marker
	var marker = createMarkerWithWindow(point, "<h2 style='background-image: none'>" + g_google_maps_company_name + "</h2><p>" + g_google_maps_address_display + "</p>");
	
	// Add the marker to map
	this.addOverlay(marker);
	
	// Start with the info window open
	marker.openInfoWindowHtml(marker.window_html);
}

function show_one_location(map_in)
{
	var zoom_level = 12;
	
	// Initialize the map, centered on Knoxville, TN
	map_in.setCenter(new GLatLng(35.868673,-84.207716), zoom_level);
	
	// Add a zoom/pan control
	map_in.addControl(new GLargeMapControl());

	// Start a geocode request for the address
	g_geocoder = new GClientGeocoder();
	g_geocoder.getLocations(g_google_maps_address, getLocations_callback.bind(map_in, zoom_level));
}

g_mapHandler = show_one_location;
