
/* menu function TOC

	navigationMenu()
	footerNavigationMenu()









*/

function navigationMenu()
{
	// extract page title into string
	var pageTitle = document.title;

	// split string into words
	var parsedTitle = pageTitle.split(' ');

	// extract last word into 'activeTab' variable
	var activeTab = parsedTitle.pop();
 
	// create array of menu tab values
	var menu = ["Index", "AboutUs", "Calendar", "Galleries", "Members", "Scholarships", "Rentals", "Links"];  

	// write start of list
	document.write('<div class="navigation"><ul>');

	// cycle through array of menu tab values
	for (var i = 0; i <= menu.length - 1; i++)
	{
		// assign each menu tab value to a variable
		var tabValue = menu[i]; 

		// convert tabValue string to lowercase
  	var lowercaseTabValue = tabValue.toLowerCase();

		// if the menu tab value equals the 'activeTab' variable value
		if (activeTab == tabValue) 
		{
			// style that menu tab as the active page tab
			document.write('<li><a class="activeTab" href="' + lowercaseTabValue + '\.php">' + tabValue + '</a></li>'); 
		}
		else
		{
			// otherwise, style that tab as an inactive page tab
			document.write('<li><a class="tab" href="' + lowercaseTabValue + '\.php">' + tabValue + '</a></li>'); 
		}	
	}
	// close list and division
	document.write('</ul></div>');
}

function footerNavigationMenu()
{
	 // extract page title into string
	var pageTitle = document.title;

	// split string into words
	var parsedTitle = pageTitle.split(' ');

	// extract last word into 'ultimateWord' variable
	var ultimateWord = parsedTitle.pop();
 
	// extract last word into 'penultimateWord' variable
	var penultimateWord = parsedTitle.pop();

	// concatenate variables to create activeTab variable
	var footerActiveTab = (penultimateWord + " " + ultimateWord);

	// create array of menu tab values
	var footerMenu = ["Use Terms", "Privacy Policy", "Disclosure Information"];  

	 // write start of list
	document.write('<div class="footer"><ul class="footerNavigation">');

	// eliminate space from string
	var noSpaceTabValue = (penultimateWord + ultimateWord);

	// convert string to lowercase
  var footerLowercaseTabValue = noSpaceTabValue.toLowerCase();

	// cycle through array of menu tab values
	for (var i = 0; i <= footerMenu.length - 1; i++)
	{
		// assign each menu tab value to a variable
		var footerTabValue = footerMenu[i]; 

		// if the menu tab value equals the 'activeTab' variable value
		if (footerActiveTab == footerTabValue)  
		{
			// style that menu tab as the active page tab
			document.write('<li><a class="activeTab" href="' + footerLowercaseTabValue + '\.php">' + footerTabValue + '</a></li>'); 
		}
		else
		{  
			// style that tab as an inactive page tab
			document.write('<li><a class="tab" href="' + footerLowercaseTabValue + '\.php">' + footerTabValue + '</a></li>'); 
		}	
	}
	// close list, write copyright info, close divisions
	document.write('</ul><span class="copyright"><p>\&\#169\;\&nbsp\;2010 Riverside Woman\'s Club</p></span></div>');	
}








														

