var map;
var geocoder;

// reference:
// http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/
// http://www.svennerberg.com/2009/07/google-maps-api-3-markers/

$(document).ready(function(){
	map = new google.maps.Map(document.getElementById("map_canvas"), {
		center : new google.maps.LatLng(39.2975769043, -94.7166519165),
		zoom: 4,
		mapTypeId : google.maps.MapTypeId.ROADMAP,
		mapTypeControl : false,
		navigationControl: true,
		navigationControlOptions: google.maps.NavigationControlStyle.ZOOM_PAN
	});
	
	geocoder = new google.maps.Geocoder();
});

function createMarker(address, html) {
	geocoder.geocode({ 'address': address }, function(results, status) {
		if(status == google.maps.GeocoderStatus.OK) {
			map.setCenter(results[0].geometry.location);
			var marker = new google.maps.Marker({
				map: map,
				position: results[0].geometry.location,
				clickable: true
			});
			var infowindow = new google.maps.InfoWindow({
				content: html
			});
			google.maps.event.addListener(marker, 'click', function() {
				infowindow.open(map, marker);
			});
		}
	});
}

$(window).unload( function () { GUnload(); });