var g_google_maps_address_id = "fromaddress"; // The id of the FormBuilder2 Address field
var g_google_maps_address = "550 Main Street W, Knoxville, TN 37902";
var g_google_maps_company_name = "Kennerly, Montgomery & Finley, P.C.";

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 + "</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;

