$(function() {
	$(".googleMap").each( function() {
		var address = $(this).text();
		
		if( !address ) {
			return;
		}
		
		geocoder = new google.maps.Geocoder();

		var myOptions = {
			zoom: 14,
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			mapTypeControl: false,
			navigationControlOptions: {
				style: google.maps.NavigationControlStyle.SMALL
			}
		};
		
		map = new google.maps.Map($(this)[0], myOptions);
		
		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, 
					title: address,
					position: results[0].geometry.location
				});
			}
		});
	});
});
