//<![CDATA[
			  
//*********************************************************************************
// gmapCreateMarker()
//
//	Create a marker at the given point whose info window displays the given info.
//		
//	@param "gPoint"  				--- GPoint object for where the Marker will be placed
// @param "gInfoWindowText"   --- String of html text for displaying in marker's infowindow; may be null
//	@param "gIcon" 				--- optional icon to use with marker
//
//	return "gMarker" --- marker object that was created
//*********************************************************************************
function gmapCreateMarker(gPoint,gInfoWindowText,gIcon)
{
	if(gmapCreateMarker.arguments.length == 3)
	{
		if( ( typeof(gPoint) != "object" ) || ( typeof(gInfoWindowText) != "string" ) || ( typeof(gIcon) != "object" ))
		{
			return null;
		}
		else
		{
			// Create a GMarker object instance located at the given GPoint
			if(gIcon == null)
			{
				var gMarker = new GMarker(gPoint);
			}
			else
			{
				var gMarker = new GMarker(gPoint, gIcon);
			}
			
			// Adds infowindow text to display from given gInfoWindowText string and
			// adds an event listener for when user clicks on the marker
			gMarker.infotext = gInfoWindowText;
			GEvent.addListener(gMarker,'click',function() {gMarker.openInfoWindowHtml(gMarker.infotext);} );
			
			return gMarker;
		}
	}
	else { return null; }
}

//*********************************************************************************
// gmapInitiliaze()
//
//	Create a GMap object, add a control for moving and zooming, and 
//	display map on page.
//		
//	 @param "gCenterPoint"  --- GPoint for where map will be centered at
//  @param "gMarkerArray"  --- GMarker array, initial markers to create, may be null
//  @param "gZoomLevel"    --- Zoomlevel for which map will be zoomed down to
//
//	
//*********************************************************************************
function gmapInitiliaze(gCenterPoint,gZoomLevel,gMarkerArray)
{
	if(gmapInitiliaze.arguments.length == 3)
	{
		// Creates a google map and centers it on Select Inn
		if (GBrowserIsCompatible())
		{
			var gmap = new GMap2(document.getElementById("gmap"));
													
			var iw = gmap.getInfoWindow();
											  
			gmap.addControl(new GLargeMapControl());
			gmap.addControl(new GMapTypeControl());
			gmap.setCenter(gCenterPoint, gZoomLevel);
			
			// traverse marker array and add any markers initially to map.
			if(gMarkerArray != null)
			{
				for (var i = 0; i < gMarkerArray.length; i++)
				{
					gmap.addOverlay(gMarkerArray[i]);
				}
			}
			
			return null;
		}
		else
		{	
			// Browser is not compatible
			return null;
		}
	}
	else { return null; }
}
//]]>