
//left navigation menu
//These are called from MenuOperations.java where the dynamic menus are created
//styles for the left nav menu are also defined in .css file
function navBar( tableCellRef, hoverFlag, navStyle, selectedMenuItem  ) { 
		
	if ( hoverFlag ) { 
		switch ( navStyle ) {  
			case 1:
				//during hover level 1
				tableCellRef.style.backgroundColor = '#878684';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
				break;			
				//}	
			case 2:	
				//during hover level 2	
				tableCellRef.style.backgroundColor = '#ffffff';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#878684';
				break;			
				//}								
			case 3:		
				//during hover level 3
				tableCellRef.style.backgroundColor = '#ffffff';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#7EA190';
				break;
			default:
				if ( document.getElementsByTagName ) {	
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#7ea190';
				}
		}
//used if menu item(s) is/are currently selected		
	} else {
		if( selectedMenuItem )
		{
			//after hover off 
			switch ( navStyle ) {
				case 1:			
					//after hover off level 1
					tableCellRef.style.backgroundColor = '#878684';
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
					break;			
				case 2:
					//after hover off level 2
					tableCellRef.style.backgroundColor = '#ffffff';
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#878684';
					break;
				case 3:
					//after hover off level 3
					tableCellRef.style.backgroundColor = '#7EA190';
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
					break;
				default:
					//???
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#878684';
					}
				}
				
		} else { 
		//after hover off 
		switch ( navStyle ) {
			case 1:
				//after hover off level 1
				tableCellRef.style.backgroundColor = '#7EA190';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
				break;			
				//}				
			case 2:	
				//after hover off level 2				
				tableCellRef.style.backgroundColor = '#B9B9B9';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
				break;
				//}	
			case 3:
				//after hover off level 3
				tableCellRef.style.backgroundColor = 'ffffff';
				tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#878684';
				break;
			default:	
				//???
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#878684';
				}
			}
		}
	}	
}

function navBarClick( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	goTo( url );
}

function navBarClickExternal( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	//loadExternal( url );	// including this line makes two windows appear if clicking on the actual text link; unsure how to keep this from happening.  Leaving it out only lets the link work if one clicks on the actual text, but seems to be the better choice
}

function navBarClickNewWindow( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	load( url );
}

function goTo( url ) {
	window.location.href = url;
}