/*
File: nav.js
Purpose: Builds the navigation link sets for all pages that call the dyn_menu_gen() function
	ie: <script>dyn_menu_gen('basic');</script> calls the basic navigation set used on the MAIN CONTENT pages
	    <script>dyn_menu_gen('basicL2');</script> calls the basic navigation set used on the YRE pages (left column, bottom)
		<script>dyn_menu_gen('eventsYR');</script> calls the YRE navigation set used on the YRE pages (left column, top)
*/

/* 1) Main Nav array FOR ROOT PAGES - This is the link set that appear on all the main content pages ( About the Trekkers, Newsletter etc.)
-----------------------------------------------------------------------------------------------------------------------------------------*/ 

/* location name (page name ie: aboutUs.html without the .html extension becomes aboutUs)*/
var basic = new Array ("aboutUs", "aboutVsport", "calendar", "events/anacortes", "newsletter", "contact", "islands", "Whidbey2010"); 

/* assign display text ( the text that will display as the link on the page)*/
var basic_text = new Array ("About the Trekkers", "About Volkssporting", "Club Calendar", "Year Round Events", "Monthly Newsletter", "Come Join Us", "Islands Special Event", "Whidbey Walking Festival"); 

/* assign page ( the full page file name ie: aboutUs.html )*/
var basic_url = new Array ("aboutUs.html", "aboutVsport.html", "calendar.html", "events/anacortes.html", "newsletter.html", "contact.html", "islands.html", "Whidbey2010.html");

/* assign style class ( the name of the style used to format the link text, there are two styles,
   "menu" (used to color the yre event link bold-red) and "menuEvent" (used to color the special events bold-blue */
var basic_class = new Array ("menu", "menu", "menu", "menu", "menu", "menu", "menuEvent", "menuEvent");



/* 2) Main Nav array FOR LEVEL TWO PAGES - This is the link set that appears on the LEFT SIDE, BOTTOM 
of the YEAR-ROUND-EVENTS pages ( About the Trekkers, Newsletter etc.) 
-----------------------------------------------------------------------------------------------------------------------------------------*/ 

/* location name */
var basicL2 = new Array ("aboutUs", "aboutVsport", "calendar", "events/anacortes", "newsletter", "contact", "islands", "Whidbey2010"); 

/* assign display text */
var basicL2_text = new Array ("About the Trekkers", "About Volkssporting", "Club Calendar", "Year Round Events", "Monthly Newsletter", "Come Join Us", "Islands Special Event", "Whidbey Walking Festival"); 

/* assign page */
var basicL2_url = new Array ("../aboutUs.html", "../aboutVsport.html", "../calendar.html", "anacortes.html", "../newsletter.html", "../contact.html", "../islands.html", "../Whidbey2010.html");

/* assign style class */
var basicL2_class = new Array ("menu", "menu", "menu", "menu", "menu", "menu", "menuEvent");



/* 3) Events nav array FOR EVENT PAGES - This is the link set that appears on the LEFT SIDE, TOP of the year-round-events ( Anacortes, Arlington, etc.) 
----------------------------------------------------------------------------------------------------------------------------------------- */

/* location name */
var eventsYR = new Array ("anacortes", "arlington", "Bayview", "bellingham", "bellingham2", "camanoisland", "decpass", "ferndale", "ftcasey", "fortebey", "fridayharbor", "laconner", "langley", "mtvernon"); 

/* assign display text */
var eventsYR_text = new Array ("Anacortes", "Arlington", "Bayview", "Bellingham", "Bellingham (Fairhaven)","Camano Island","Deception Pass State Park", "Ferndale", "Fort Casey State Park", "Fort Ebey State Park", "Friday Harbor", "La Conner", "Langley","Mount Vernon"); 

/* assign page */
var eventsYR_url = new Array ("anacortes.html", "arlington.html", "bayview.html", "bellingham.html", "bellingham2.html", "camanoisland.html","decpass.html", "ferndale.html", "ftcasey.html", "fortebey.html", "fridayharbor.html", "laconner.html", "langley.html", "mtvernon.html");

/* assign style class */
var eventsYR_class = new Array ("menu", "menu", "menu", "menu", "menu","menu", "menu", "menu", "menu", "menu", "menu", "menu", "menu", "menu");


/* The code that builds the navigation menu sets (do not edit) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* Resolve the location */ 
var loc=String(this.location);
loc=loc.split("/"); 
loc=loc[loc.length-1].split("."); 
loc=loc[loc.length-2]; 

/* Menu generating function */ 
function dyn_menu_gen(menuName) { 
	var thisMenu=eval(menuName);
	var thisMenuURL=eval(menuName+"_url");
	var thisMenuText=eval(menuName+"_text");
	var thisMenuClass=eval(menuName+"_class");
	document.write('<table border="0" cellpadding="0" cellspacing="0">');
	for(var i=0; i < thisMenu.length; i++) {
		if(loc==thisMenu[i]) { 
  			document.write('<tr><td align="right" style="padding-bottom:7px;"><a href="' + thisMenuURL[i] + '" class="' + thisMenuClass[i] + '"><b class="marker">&raquo;</b> ' + thisMenuText[i] + '</a></td></tr>'); 
 		} 
 		else { 
			document.write('<tr><td align="right" style="padding-bottom:7px;"><a href="' + thisMenuURL[i] + '" class="' + thisMenuClass[i] + '">' + thisMenuText[i] + '</a></td></tr>'); 
 		} 
	}
	document.write('</table>');
} 

function dyn_date() {
	var mydate=new Date();
	var year=mydate.getYear();
	
	if (year < 1000){year+=1900};
	
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	
	if (daym<10){daym="0"+daym};
	
	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	document.write("<div class='dateTime'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</div>");
}

