// Javascript document

//
// Name:		google_map.js
// Author:		John Cummings
// Date:		12/17/08
//
// Description:
// 	The file contains the loadMap() function, used by studio.html
// 	to load the google map found on that page.
//
// Functions:
//	loadMap()
//
// File interdependencies:
// 	studio.html
//

//
// loadMap()
//
// Arguments:
// 	(none)
//
// Description:
//	This function loads the google map found on the studio.html page.
//
// 	It is called only once, as a result of the "onload" attribute
// 	of the "<body>" element in our document.
//
//	Refer to the google maps API for more examples and information.
//
// Global references:
//	(none)
//
// Results:
//	Global variables possibly set:
//		(none)
//
//	Returns:
//		undefined
//
function loadMap() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("studio_map"));
		var latlng = new GLatLng(44.340041,-70.069267);
		var zoom = 15;
		var marker = new GMarker(latlng);
		var poptag = "<b>A Lakeside Studio Pottery</b> <br/>" +
		  "12 Cedar Point Road <br/>" +
		  "Wayne, ME <br/> <br/>" +
		  "&ensp&ensp" +
		  "<a target='_blank' href='http://maps.google.com/maps?f=q&hl=en&geocode=&q=12+Cedar+Point+Rd,Wayne+ME+04284&sll=44.340041,-70.069267&sspn=42.174768,87.451172&ie=UTF8&z=16&g=12+Cedar+Point+Rd,Wayne+ME+04284&iwloc=addr'>Large Map</a>";

		map.setCenter(latlng, zoom);
		map.addOverlay(marker);
		map.addControl(new GSmallMapControl());
		map.addControl(new GScaleControl());
		marker.openInfoWindowHtml(poptag);
		GEvent.addListener(marker, "click",
			function() {
				map.openInfoWindowHtml(latlng, poptag);
			}
		);
	}
}

