/********************************************************************/
/* This file highlights the nav and footer nav when hovered over.	*/
/* By Tanner Naeher, Coyote6 GraphX, coyote6graphx.com.				*/
/********************************************************************/

// Variables.
nav_hover = '#9B4F19';
nav = '#000000';
footer_nav_hover = '#F7ECBE';
footer_nav = '#000000';

// Start once the document is ready.
$(document).ready(function(){

	// Highlight the footer home when the nav home is hovered over.
	$('#nav_home').hover(function(){
		$('#footer_home').css("text-decoration", "underline");
		$('#footer_home').css("color", footer_nav_hover);
		$('#nav_home').css("color", nav_hover);
		$('#nav_home').css("text-decoration", "underline");
	}, function(){
		$('#footer_home').css("text-decoration", "none");
		$('#footer_home').css("color", footer_nav);
		$('#nav_home').css("color", nav);
		$('#nav_home').css("text-decoration", "none");
	});

	// Nav.
	$('.nav_js').hover(
		function(){
			// Change the attributes of this element.
			$(this).css("text-decoration", "underline");
			$(this).css("color", nav_hover);
			// Get the elements id.
			var id = $(this).attr('id');
			// Drop the nav beginning.
			id = id.substr(4);
			// Add the footer back to the beginning.
			id = '#footer_' + id;
			// Change the attributes of the nav's element.
			$(id).css("color", footer_nav_hover);
			$(id).css("text-decoration", "underline");
		},
		function(){
			// Change the attributes of this element.
			$(this).css("text-decoration", "none");
			$(this).css("color", nav);
			// Get the elements id.
			var id = $(this).attr('id');
			// Drop the nav beginning.
			id = id.substr(4);
			// Add the footer back to the beginning.
			id = '#footer_' + id;
			// Change the attributes of the nav's element.
			$(id).css("color", footer_nav);
			$(id).css("text-decoration", "none");
		}
 	);
	
	// Footer Nav.
	$('.footer_nav_js').hover(
		function(){
			// Change the attributes of this element.
			$(this).css("text-decoration", "underline");
			$(this).css("color", footer_nav_hover);
			// Get the elements id.
			var id = $(this).attr('id');
			// Drop the footer beginning.
			id = id.substr(7);
			// Add the nav back to the beginning.
			id = '#nav_' + id;
			// Change the attributes of the nav's element.
			$(id).css("color", nav_hover);
			$(id).css("text-decoration", "underline");
		},
		function(){
			// Change the attributes of this element.
			$(this).css("text-decoration", "none");
			$(this).css("color", footer_nav);
			// Get the elements id.
			var id = $(this).attr('id');
			// Drop the footer beginning.
			id = id.substr(7);
			// Add the nav back to the beginning.
			id = '#nav_' + id;
			// Change the attributes of the nav's element.
			$(id).css("color", nav);
			$(id).css("text-decoration", "none");
		}
 	);
	
});