///<summary>
///	A Grosvenor generic Map control that removes the need to create specific Map Controls.
///	The constructor takes as input, an HTML Element and the position on the map of the HTML Element.
///	This allows the developer to create the HTML Element (control) and pass it as input.
///</summary>
function GrosvenorMapControl(containerElement, layoutPosition)
{
	this.containerElement = containerElement;
	this.layoutPosition = layoutPosition;
}

GrosvenorMapControl.prototype = new GControl();

///<summary>
///	Called by GMap2 when GMap2.addControl is used.
///	containerElement is added to the map and returned as well.
///</summary>
GrosvenorMapControl.prototype.initialize =
	function(map)
	{
		// Add HTML Element to the Google Map
		map.getContainer().appendChild(this.containerElement);
		
		return this.containerElement;
	};
	
// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
GrosvenorMapControl.prototype.getDefaultPosition =
	function()
	{
		var gcontrolPosition = null;
		
		// If constructor parameter 'layoutPosition'is null, set a default position
		if (this.layoutPosition == null)
		{
			gcontrolPosition = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
		}
		else
		{
			gcontrolPosition = this.layoutPosition;
		}
		
		return gcontrolPosition;
	};

