﻿// LuxNavigation.js

var g_iLuxNavigationMenuTimerID = Number(0);

// Called when the user triggers a menu
function LuxNavigationMenuOver( strMenuName ) {

	// Clear the timeout, if any
	clearTimeout( g_iLuxNavigationMenuTimerID );	g_iLuxNavigationMenuTimerID = 0;
	
	// Toggle the display of the appropriate menus
	document.getElementById( 'LuxMenuArtistResidency' ).style.display = ( strMenuName == "ArtistResidency" ? 'block' : 'none' );
	document.getElementById( 'LuxMenuEducation' ).style.display = ( strMenuName == "Education" ? 'block' : 'none' );
	document.getElementById( 'LuxMenuInformation' ).style.display = ( strMenuName == "Information" ? 'block' : 'none' );
	document.getElementById( 'LuxMenuSupport' ).style.display = ( strMenuName == "Support" ? 'block' : 'none' );
	if(document.getElementById('LuxMenuArtistResidency').style.display == 'block'){
		document.getElementById('LuxArtistProfilePortraitTileCaption').style.display = 'none';
	}
}

// Called when the user rolls off the menu button
function LuxNavigationMenuOut( strMenuName ) {

	// Clear the timeout, if any
	clearTimeout( g_iLuxNavigationMenuTimerID );

	// Set a new timer
	g_iLuxNavigationMenuTimerID = setTimeout( 'LuxNavigationHideMenus();', 1000 );
}

// Hides all of the menus
function LuxNavigationHideMenus( ) {
	document.getElementById( 'LuxMenuArtistResidency' ).style.display = 'none';
	document.getElementById( 'LuxMenuEducation' ).style.display = 'none';
	document.getElementById( 'LuxMenuInformation' ).style.display = 'none';
	document.getElementById( 'LuxMenuSupport' ).style.display = 'none';
	document.getElementById('LuxArtistProfilePortraitTileCaption').style.display = 'block';
}

// Called when the user hovers over a menu item
function LuxNavigationMenuItemOver( ) {
	// Clear the timeout, if any
	clearTimeout( g_iLuxNavigationMenuTimerID );
}

// Called when the user leaves a menu item
function LuxNavigationMenuItemOut( ) {
	// Clear the timeout, if any
	clearTimeout( g_iLuxNavigationMenuTimerID );
	
	// Set a new timer
	g_iLuxNavigationMenuTimerID = setTimeout( 'LuxNavigationHideMenus();', 1000 );

}

