function showTab(tab, sectionname) {
	var section = document.getElementById(sectionname);
	var tablist = tab.parentNode.parentNode.childNodes;
	var tabkids = section.parentNode.childNodes;

	for (var i=0; i<tablist.length; i++) {
		if (tablist[i].nodeName == "LI") {
			tablist[i].style.backgroundColor = tablist[i].parentNode.style.backgroundColor;
		}
	}

	for (var i=0; i<tabkids.length; i++) {
		if (tabkids[i].className == "tabcontent") {
			tabkids[i].style.display = "none";
		}
	}

	tab.parentNode.style.backgroundColor = "#9cc";
	section.style.display = "block";
	return false;
}

function showToggle(sectionname) {
	var section = document.getElementById(sectionname);

	if (section.style.display == "block") {
		section.style.display = "none";
	} else {
		section.style.display = "block";
	}
	return false;
}

function showHide(showsct, hidesct) {
	document.getElementById(showsct).style.display = "block";
	document.getElementById(hidesct).style.display = "none";
	return false;
}

function showEventForm() {
	var tab = document.getElementById('tabEventsLabel');
	showHide('eventsearch','sctSearchRestaurants');
	return showTab(tab, 'tabEvents');
}

function showRestaurantForm() {
	var tab = document.getElementById('tabRestaurantsLabel');
	showHide('sctSearchRestaurants','eventsearch');
	return showTab(tab, 'tabRestaurants');
}

function sortItems(list_id, item_class, sort_by_class) {
	// Sort flight/hotel/itinerary items by given column
}
