
function getOutdoorsCategory(unit) {
	var categoryID;	
	if (unit.OutDoorsCategories.length > 2) 
		categoryID = "";	
	else 
		categoryID = unit.OutDoorsCategories[0];
	return categoryID;
}

function getDiningCategory(unit) {
	//$D("DINING" + unit.DiningCategories.length);
	var categoryID;
	if (unit.DiningCategories.length > 3) 
		categoryID = "";	
	else 
		categoryID = unit.DiningCategories[0] - 5;
	return categoryID;		
}

function GetMarkerImage(unit) {		//TODO: check against selected options
	var markerSelected = GetMarkerImageSelected(unit);
	if (markerSelected != "") return markerSelected;
	if (unit.TrolleyStop) return "07_trolley.png";	
	if (unit.Outdoors)  return sprintf("05_outdoors%d.png", getOutdoorsCategory(unit));	
	if (unit.ArtsNCulture) return "01_museums.png";
	if (unit.Hotel) return "02_hotels.png";
	if (unit.Shopping) return "04_shopping.png";
	if (unit.Dining) return sprintf("03_dining%d.png", getDiningCategory(unit));

	return "06_general.png"
}

function GetMarkerImageSelected(unit) {
	if (unit.Outdoors  && unitSetCheckBoxes[OUTDOORS_CHECK].checked)  return sprintf("05_outdoors%d.png", getOutdoorsCategory(unit));
	if (unit.ArtsNCulture  && unitSetCheckBoxes[ARTS_CHECK].checked) return "01_museums.png";
	if (unit.Hotel  && unitSetCheckBoxes[HOTEL_CHECK].checked) return "02_hotels.png";
	if (unit.Shopping  && unitSetCheckBoxes[SHOPPING_CHECK].checked) return "04_shopping.png";
	if (unit.Dining  && unitSetCheckBoxes[DINING_CHECK].checked) return sprintf("03_dining%d.png", getDiningCategory(unit));
	if (unit.Trolley  && unitSetCheckBoxes[TROLLEY_CHECK].checked) return sprintf("07_trolley.png", getDiningCategory(unit));	
	return "";
}