// Navigation Menu JS
// Dependencies: prototype.js and scriptaculous.js

// Do after window fully loaded.
Event.observe(window, 'load', function() {
  Event.observe('btn_commercial', 'mouseover', function() {
	showNavItem('commercialContainer');
  });
  Event.observe('btn_military', 'mouseover', function() {
	showNavItem('militaryContainer');
  });
  Event.observe('btn_company', 'mouseover', function() {
	showNavItem('companyContainer');
  });
  Event.observe('btn_careers', 'mouseover', function() {
	showNavItem('careersContainer');
  });
  Event.observe('btn_suppliers', 'mouseover', function() {
	showNavItem('suppliersContainer');
  });
  Event.observe('btn_support', 'mouseover', function() {
	showNavItem('supportContainer');
  });
  Event.observe('btn_training', 'mouseover', function() {
	showNavItem('trainingContainer');
  });
  Event.observe('btn_contact', 'mouseover', function() {
	showNavItem('contactContainer');
  });
});

// Hides all nav items
hideAllSubmenus = function() {
	// Get items
	var menuContainer = $('cont_navWrapper').childElements();
	
	// Hide them
	menuContainer.each(function(item, index) {
		hideElement(item);
	});
}
// Hides all nav items
hideAllFooterSubmenus = function() {
	// Get items
	var menuContainer = $('cont_footerSubNav').childElements();
	
	// Hide them
	menuContainer.each(function(item, index) {
		hideElement(item);
	});
}
// Show a single submenu
showNavItem = function(elemID) {
	// First hide all
	hideAllSubmenus();
	// Then show single subnav
	showElement(elemID,'fade');
}

