
/*****************************************************
*  ElectricStorm's Google Map Script                 *
*  this script uses the Google Maps API to add an    * 
*  interactive map to the cafe location page.        *
*  (this page configures our specific map)           *
/****************************************************/


function initialize() { 

	//check the map_canvas div exists (i.e. that this is the right page):
	if (document.getElementById('map_canvas')) {
		
		//check browser compatibility:
		if (GBrowserIsCompatible()) { 
			
			//making the map
			var centerCoords = new GLatLng(34.037771, -118.437627); //(using fps coords as the center)
			var map = new GMap2(document.getElementById("map_canvas")); //create new map in the map_canvas div	
			map.setCenter(centerCoords, 16); //initialize map by setting lat and long co-ords and zoom
			map.addControl(new GLargeMapControl()); //add full pan/zoom controls
						
			//making the marker
			var fpCoords = new GLatLng(34.037771, -118.437627); 
			var fpMarker = new GMarker(fpCoords); //create a marker object with fps co-ords
			
			GEvent.addListener(fpMarker, "click", function() { //add event listener to activate this function when marker is clicked	
				var htmlToShow = 'Food Perfected<br />2306 Cotner Avenue<br />Los Angeles<br />CA 90064<br /><br />';
				fpMarker.openInfoWindowHtml(htmlToShow); //open info window on marker containing above html
			});
			
			map.addOverlay(fpMarker); //add the marker to the map

		}
		
	}
	
}


// window.onload = initialize; //(initialized in everypage.php)
// window.onunload = GUnload; //free up memory associated with this app


