<!--

/********************************************************************************
*                        \     Kohler Credit Union     /
*                         -----------------------------
*
*   File Location        : /site/scripts_gmap.js
*
*   Begin Work           : Tuesday, September 26, 2006
*   Last Work            : 
*   Copyright            : (c) 2006-2007 Kohler Credit Union
*                          All other copyrights to their respectful owners
                           and is noted where necessary.
*   Location             : http://www.kohlercu.com/
*
*   Current Version      : v1.0.0
*
********************************************************************************/



/*						FUNCTION :: Draw New Google Map
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
function GMapDraw(center_lat, center_lng, marker_info, map_zoom, page_location)
{
	// Center map location
	var map = new GMap2(document.getElementById(page_location));							// Create new map instance based upon DIV location
	map.addControl(new GLargeMapControl());										// Add large map controls to the map
	map.setCenter(new GLatLng(center_lat, center_lng), map_zoom);							// Center map view location
	
	// Create marker and info window at location
	for (i = 0; i < marker_info.length; i++)
	{
		var point  = new GLatLng(marker_info[i][0], marker_info[i][1]);						// Where to place a marker
		var marker = GMapCreateMarker(point, marker_info[i]);							// Create the new marker with balloon information
		map.addOverlay(marker);											// Place the marker on the map
	}
}



/*						 FUNCTION :: Create Map Markers
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
function GMapCreateMarker(point, marker_info) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function()
	{
		marker.openInfoWindowHtml('<div style="font-size: 1.0em; font-weight: bold;">' + marker_info[2] + '</div><div style="font-size: .825em;">' + marker_info[3] + '</div>');
	});
	
	return marker;
}







//-->