/**
 * Bicycle Club of Philadelphia
 * nav.js - Navigation JavaScript functions
 *
 * by Tom Scott of DarkCity Designs. Commissioned by Jeff Bakely of the BCP
 */

/*
 * hideAll() - Hides all nav submenus, invoked after someone stops browsing the menu.
 *			   Useful in case something fucks up and 2 nav submenus are shown.
 */
function hideAll() {
	// store all nav elements in an array
	var nav = new Array();
	nav[0] = document.getElementById("nav_rides");
	nav[1] = document.getElementById("nav_members");
	nav[2] = document.getElementById("nav_join");
	nav[3] = document.getElementById("nav_more");
	nav[4] = document.getElementById("nav_events");
	
	// go through each element in the array and make it hidden
	for (var x=0; x<=4; x++) 
		nav[x].style.visibility="hidden";
}

/*
 * showNav() - Shows the specified nav submenu.
 *		section - The section (nav_*) id of the submenu.
 */
function showNav(section) {
	// hide any other nav elements currently visible
	hideAll();

	// show the current nav element and it's respective title
	var sect=document.getElementById("nav_"+section);
	sect.style.visibility="visible";
	
}