// JavaScript Document

//*********************************************
//What is written will be dislayed exactly as typed when displayed on the map
//Type the address of the property below in between the quotes
//var address = ""; 
//*********************************************

var geocoder;
var map;

// On page load, call this function
function load() {
	// Create new map object
	map = new GMap2(document.getElementById("map"));
	if (map) {
 		// Create new geocoding object
		geocoder = new GClientGeocoder();
		// Retrieve location information, pass it to addToMap()
		geocoder.getLocations(address, addToMap);
		getLocations(address);
	}
}

// This function adds the point to the map
function addToMap(response) {
	// Retrieve the object
	place = response.Placemark[0];
	// Retrieve the latitude and longitude
	point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
	// Add map controls
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	// Center the map on this point
	map.setCenter(point, 16);
	// Set initial map type
	map.setMapType(G_HYBRID_MAP);
	// Create a marker
	marker = new GMarker(point);
	// Add the marker to map
	map.addOverlay(marker);
	// Add address information to marker
	marker.openInfoWindowHtml("<br />"+address);
}