var lastColoredCtrl = null;
function ColorCell(entryid)
{
	if (lastColoredCtrl != null)
	{
		lastColoredCtrl.style.backgroundColor = '';
	}

	var ctrl = document.getElementById('EntryCell' + entryid);
	if (ctrl != null)
	{
		//ctrl.style.backgroundColor = '#ECECEC';
		//selectedarrow
		lastColoredCtrl = ctrl;
	}
	
}

function createMarker(point, icon, entryid, html)
{	
  var marker = new GMarker(point, icon);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    ColorCell(entryid);
  });
  return marker;
}

function createMarkerTabbed(point, icon, entryid, html1, html2)
{	

	// Our info window content
	var infoTabs;
	if (html2 != '')
	{
		infoTabs = [
			new GInfoWindowTab("General", html1),
			new GInfoWindowTab("Description", html2)
		];
	}
	else
	{
		infoTabs = [
			new GInfoWindowTab("General", html1)
		];
	}

	// Place a marker in the center of the map and open the info window
	// automatically
	var marker = new GMarker(point, icon);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowTabsHtml(infoTabs);
		ColorCell(entryid);
	});

  return marker;
}

function createIcon()
{
	//Create our "tiny" marker icon
	var icon = new GIcon();
	icon.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png";
	icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	icon.iconSize = new GSize(12, 20);
	icon.shadowSize = new GSize(22, 20);
	icon.iconAnchor = new GPoint(6, 20);
	icon.infoWindowAnchor = new GPoint(5, 1);
	return icon;
}

