
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.catBicy) 	return "01bicy.png";	
	if (unit.catWalk)  	return "02walk.png";	
	if (unit.catWate) 	return "03wate.png";
	if (unit.catCamp) 	return "04camp.png";
	if (unit.catNatu)	return "05natu.png";
	if (unit.catFarm) 	return "06farm.png";	
	if (unit.catFish) 	return "07fish.png";
	if (unit.catFest) 	return "08fest.png";
	if (unit.catHeri) 	return "09heri.png";
	if (unit.catEnvi) 	return "10envi.png";
	if (unit.catSomu) 	return "11somu.png";

	return "00gene.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 "";
}