// Animation for the main navigation with secondary links
// @param(linkID) the CSS unique ID of the main navigation heading UL element
function MakeNavigation (linkID){
	
	// Sets the speed for the roll effect
	var slideToggleSpeed = 250;
	
	// When @param(linkID) hovered
	$(linkID).hover(
		// Roll down actions
		function () {
			// Add the background image of the @param(linkID) element
			$(linkID).find('li:first').addClass('topnavhoverbg');
			// Remove the white CSS class for the A element of the @param(linkID) element
			$(linkID).find('a').removeClass('mainnavlink');
			// Add the red CSS class for the A element of the @param(linkID) element
			$(linkID).find('a').addClass('secondnavlink');
			// Expend the second level navigation UL
			$(linkID).find('ul:first').stop(true, true).slideToggle(slideToggleSpeed, function() {});			 
		},
		// Roll up actions
		function () {
			// Collapse the second level navigation UL
			$(linkID).find('ul:first').stop(true, true).slideToggle(0, function() {
				// Remove the background image of the @param(linkID) element															  
				$(linkID).find('li:first').removeClass('topnavhoverbg');
				// Remove the red CSS class for the A element of the @param(linkID) element
				$(linkID).find('a').removeClass('secondnavlink');
				// Add the white CSS class for the A element of the @param(linkID) element
				$(linkID).find('a').addClass('mainnavlink');
			});
		}
	);
};

// Animation for the main navigation without secondary links
// @param(linkID) the CSS unique ID of the main navigation heading UL element
function MakeNavigationNoSecondary (linkID){
	$(linkID).hover(
	  function () {
		// Add the background image of the @param(linkID) element
		$(linkID).find('li:first').addClass('topnavhovernolinkbg');
		// Remove the white CSS class for the A element of the @param(linkID) element
		$(linkID).find('a').removeClass('mainnavlink');
		// Add the red CSS class for the A element of the @param(linkID) element
		$(linkID).find('a').addClass('secondnavlink');
	  }, 
	  function () {
		// Remove the background image of the @param(linkID) element															  
		$(linkID).find('li:first').removeClass('topnavhovernolinkbg');
		// Remove the red CSS class for the A element of the @param(linkID) element
		$(linkID).find('a').removeClass('secondnavlink');
		// Add the white CSS class for the A element of the @param(linkID) element
		$(linkID).find('a').addClass('mainnavlink');
	  }
	);
};
