jQuery(function($) {
    // First create a div to host the map
    if ($('.vcard') ) {
		
		var themap = $('<div id="googlemap"></div>').css({'width': '230px','height': '230px'}).insertBefore('.vcard')

		// Now initialise the map
		var mapstraction = new Mapstraction('googlemap','google');
	
	
		// Geocode each hcard and add a marker
		$('.vcard').each(function() {
			var hcard = $(this);
		
			var latitude = hcard.find('.geo .latitude').text();
			var longitude = hcard.find('.geo .longitude').text();
			
			//  Centre on each marker in the map
			mapstraction.setCenterAndZoom(
			new LatLonPoint(latitude, longitude), 14 // Zoom level appropriate set to 6
			);
		
			var marker = new Marker(new LatLonPoint(latitude, longitude));
			marker.setIcon('/images/mapicon.gif');

			mapstraction.addMarker(marker);
		});
	};
});	
