/////////////////////////////////////////////////////
// setActiveNavTab
// Sets which tab in the upper navigation bar should
// be active, based on the url.
/////////////////////////////////////////////////////
function setActiveNavTab(){
	var url = document.location.href;
	var splitURL = [];
		splitUrl = url.split("/");
	// We only care about the last member of the array,
	// which should be the final sub-directory
	var page = splitUrl[splitUrl.length -1];
	// First, set all tabs to inactive
	$("#nav li.active").each(function(){
		$(this).removeClass('active');
	});
	switch(page){
		case "":
		case "home":
			$('#n_home').addClass('green');
			break;
		case "events":
			$('#n_myspot').addClass('green');
			break;
		case "create":
			$('#n_getstarted').addClass('green');
			break;
		case "faq":
			$('#n_support').addClass('green');
			break;
		default:
			break;
	}
}
