var map;
var geocoder;

function initialize() {
	geocoder = new google.maps.ClientGeocoder();
}

// addAddressToMap() is called when the geocoder returns an
// answer.  It adds a marker to the map with an open info window
// showing the nicely formatted version of the address and the country code.
function addAddressToMap(response) {
	map = new google.maps.Map2(document.getElementById("map_canvas"));
	map.setCenter(new google.maps.LatLng(34, 0), 1);

	var mapControl = new google.maps.MapTypeControl();
	map.addControl(mapControl);
	map.addControl(new google.maps.LargeMapControl());

	map.clearOverlays();

	var adsManager = new google.maps.AdsManager(map, 'ca-pub-7558351143829811', {channel:"2666519529"}); 
	adsManager.enable();

	if (!response || response.Status.code != 200) {
		alert("Desculpe, não foi possível localizar o endereço informado.");
	} else {
		place = response.Placemark[0];
		point = new google.maps.LatLng (place.Point.coordinates[1],
										place.Point.coordinates[0]);
		marker = new google.maps.Marker(point);
		map.addOverlay(marker);
		map.setCenter(new google.maps.LatLng(place.Point.coordinates[1], place.Point.coordinates[0]), 16);
	}
}
