
function initializeMap( area )
{
	var minLat = 80;
	var maxLat = 30;
	var minLong = -50;
	var maxLong = -150;
	
	var centerLatitude = minLat + (maxLat - minLat) / 2  
	var centerLongitude = minLong + (maxLong - minLong) / 2  
//	console.log( maxLong );
//	console.log( minLong );
//	console.log( minLat );
//	console.log( maxLat );
//	console.log( centerLatitude );
//	console.log( centerLongitude );
	var latitude1 = minLat;
	var latitude2 = maxLat;
	var longitude1 = minLong;
	var longitude2 = maxLong;
	
	var index = 0;
	if ( area == 'gosford' ) index = 1;
	if ( area == 'belmont' ) index = 2;
	if ( area == 'casula' ) index = 3;
	
	var locations = new Array( 
		new Array(-32.919025, 151.726556, "Planet Fitness - Lambton NSW", "Energy Australia Stadium", "<hr />District Park<br />New South Wales, Australia<br />(02) 4956-2144"), 
		new Array(-33.423342, 151.320954, "Planet Fitness - West Gosford", "Homemaker Centre", "<hr />17 Alick St. <br />Belmont NSW 2250, Australia<br />(02) 4324-4233"),
		new Array(-33.040669, 151.65876, "Planet Fitness - Belmont", "", "<hr />17 Alick St.<br />Belmont NSW 2280, Australia<br />(02) 4324-4233"),
		new Array(-33.957462, 150.882406, "Planet Fitness - Casula", "Shop 8 Crossroads Homemaker Centre", "<hr />Corner Beech and Camden Valley Way<br />Casula NSW 2217, Australia<br />(02) 4324-4233")
	);	

	var zoom = 14;

	var map = new GMap2(document.getElementById("googleMap"));
		map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10)));	
		map.setCenter(new GLatLng( locations[index][0], locations[index][1]), zoom, G_NORMAL_MAP );
		map.addControl(new GSmallMapControl());
	
			var params = new Object;
			//showAddress( locations[i][0], locations[i][1], locations[i][0] );
			var point = new GLatLng( locations[index][0], locations[index][1] );
			
			params.infoTitle = locations[index][3];
			params.infoAddress = locations[index][2];
			params.infoDesc = locations[index][4];
			//params.icon = new_icon;
				
			var marker = new GMarker(point,params);
				marker.infoTitle = locations[index][3];
				marker.infoAddress = locations[index][2];
				marker.infoDesc = locations[index][4];
			map.addOverlay( marker );
		GEvent.addListener(map, "click", function(marker, point) {
		  if (marker)
			marker.openInfoWindowHtml("<h4 style='padding: 0px;'>"+ marker.infoTitle + "</h4><div style='width: 300px;'>"+ marker.infoDesc +"</div>");
		});
}

