// -------------------------------------------------------------------------------
// Called From: all of the pages that use the standard subnavigation
// Purpose: The page starts with two functions: LW_showSubNav and LW_hideSubNav.  Each 
//			function takes in the object name of the menu. 
//			Depending on the function called and the browser being used, 
//			the visibility state of the dropdown menu is altered using the 
//			appropriate DOM.
//
//			The page then preloads all of the images that will be used in the  
//			horizontal navigation bar.
//
//          The page then loads all of the subnavigation text into each dropdown menu.  
//			Each array consists of the array name, the location of the dropdown menu 
//			(pixels from the left), and the width of the menu.  This is followed by 
//			a varying number of text links and the address (URL) of each link.
//
//			The function LW_setUpMenus then creates the dropdown menu using the information  
//			from the arrays.  This function takes 5 parameters: the background color of 
//          the menu, the rollover background color of the menu, the text color of 
//          the menu, the rollover text color, and the color of the line separating 
//          each link in the menu.   
// --------------------------------------------------------------------------------

function LW_displaySelects( selectVisibility ) {
	for ( var i = 0; i < document.forms.length; i++ ) {
		for ( var j = 0; j < document.forms[i].elements.length; j++ ) {
			if ( document.forms[i].elements[j].type.indexOf( "select" ) != -1 ) {
				document.forms[i].elements[j].style.visibility = selectVisibility;
			}
		}
	}
}

function LW_showSubNav(LW_subnav){
			
			var LW_nav;
			var LW_complete;
			
			if(document.getElementById){
				LW_complete = "document.getElementById('" + LW_subnav + "Menu')";
			}
			else if(document.all){
				LW_complete = "document.all['" + LW_subnav + "Menu']";
			}
			
			LW_nav = eval(LW_complete);
				
			if (LW_nav){
				LW_nav.style.visibility = 'visible';	
			}
			
			LW_displaySelects( 'hidden' );
}

function LW_hideSubNav(LW_subnav){
		
			var LW_nav;
			var LW_complete;
			
			if(document.getElementById){
				LW_complete = "document.getElementById('" + LW_subnav + "Menu')";
			}
			else if(document.all){
				LW_complete = "document.all['" + LW_subnav + "Menu']";
			}
			
			LW_nav = eval(LW_complete);
				
			if (LW_nav){
				LW_nav.style.visibility = 'hidden';	
			}
			
			LW_displaySelects( 'visible' );
}

//<!-- Adds a suffix onto the image name so that the program calls the on state of the image -->
function LW_imgOn(iname) {
	if (document.images) {
		document[iname].src = eval(iname + "on.src");
	}
}

//<!-- Adds a suffix onto the image name so that the program calls the off state of the image -->
function LW_imgOff(iname) {
	if (document.images) {
		document[iname].src = eval(iname + "off.src");
	}
}

var LW_arMenu = new Array();


	LW_arMenu[0] = new Array(
			"LW_music",
			440,		// Pixel offset from right edge.
			110,	// Width of menu.
			"As Winds Dance", 	"aswindsdance.html",
			"Ascend", 	"ascend.html",			
			"Each Time You...", 		"eachtimeyou.html",
			"Echoes", 	"echoes.html",			
			"In Heaven's Air", 	"heavensair.html",
			"Keltic Variations", 	"kelticvariations.html",
			"Novo Lenio", 	"novolenio.html",
			"Perthshire Majesty", 	"perthshiremajesty.html",
			"Rivers", 	"rivers.html",			
			"Their Blossoms Down", 	"theirblossomsdown.html",
			"The Quest", 	"thequest.html",
			"Voices of the Sky", 	"voicesofthesky.html"			
			);


	LW_arMenu[1] = new Array(
			"LW_about",
			330,		// Pixel offset from right edge.
			110,	// Width of menu.			
			"Blessings", 	"blessings.html",
			"Diamond Fanfare", 	"diamondfanfare.html",			
			"Exultate", 	"exultate.html",			
			"In Flight", 	"inflight.html",
			"Olympiada", 	"olympiada.html",
			"Ride", 	"ride.html",
			"Sevens", 	"sevens.html"
			);

	LW_arMenu[2] = new Array(
			"LW_works",
			220,	// Pixel offset from right edge.
			110,	// Width of menu.
			"Upcoming Events", 		"upcoming.html",
			"Photos", 		"photos.html"
			);

	LW_arMenu[3] = new Array(
			"LW_films",
			110,	// Pixel offset from right edge.
			110,	// Width of menu.
			"Text",	"bio.html",
			"Awards", 	"awards.html"
			);

	LW_arMenu[4] = new Array(
			"LW_media",
			0,	// Pixel offset from right edge.
			110,	// Width of menu.
			"Contact","contact.html",
			"Ordering","ordering.html",			
			"Home Page","index.html"
			);			
			
			
			
		

function LW_setUpMenus(LW_backcolor, LW_overcolor, LW_textcolor, LW_overtextcolor, LW_linecolor){
	if ((document.all) || (document.getElementById)){

	var LW_subnav = "";
			
			for (j = 0; j < LW_arMenu.length; j++){
				LW_subnav += "<div id=\"" + LW_arMenu[j][0] + "Menu\" style=\"z-index:999;position: absolute; top: 85; right: " + LW_arMenu[j][1] + "; width: " + LW_arMenu[j][2] + ";  visibility: hidden\" onmouseover=\"LW_showSubNav('" + LW_arMenu[j][0] + "');\" onmouseout=\"LW_hideSubNav('" + LW_arMenu[j][0] + "');\">";
					LW_subnav += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + LW_arMenu[j][2] + "\">";
						
				for (i=3; i < LW_arMenu[j].length-1; i=i+2){
					LW_subnav += "<tr>";
					LW_subnav += "<td width=\"160\" height=\"30\" bgcolor=\"" + LW_backcolor + "\" onClick=\"document.location.href='" + LW_arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + LW_overcolor + "';this.style.color='" + LW_overtextcolor+ "';\" onmouseout=\"this.bgColor='" + LW_backcolor + "';this.style.color='" + LW_textcolor + "'\" style=\"color: " + LW_textcolor + "; font-family: arial,sans-serif; font-size: 10px;\"><div style=\"padding-left:12px;\">" + LW_arMenu[j][i] + "</a></div></td>";
					LW_subnav += "</tr>";
					LW_subnav += "<tr>";
					LW_subnav += "<td bgcolor=\"" + LW_linecolor + "\" height=\"1\"></td>";
					LW_subnav += "</tr>";
				}
					
				LW_subnav += "</table>";
				LW_subnav += "</div>";
			}

		document.write(LW_subnav);
	}
}


