jQuery(document).ready(function(){

	$("#sidenav IMG").hover( 
			function () {
				$('#sidenav IMG').each(function(i) {
					this.src = this.src.replace("-on","-off");
					$(this).removeClass("clicked");
				});
			
				this.src = this.src.replace("-off","-on");
					$(this).addClass("clicked");
							
				} // End of Click -> Function
			); // #nav .nav2 click
		
		
	$('#sidenav IMG').hover( 
		function () { this.src = this.src.replace("-off","-on"); },
		function () { if($(this).attr('class') != "clicked") this.src = this.src.replace("-on","-off"); }
	);
	

	$('#sidenav A').hover(function(){
						
		var $active = $('#center DIV.active');
   		var $next = $(this).attr('href');

		// We don't want to fade anything if we are on the correct panel.	
		if ( $($next).attr('class') != 'active')  {
		
			$active.addClass('last-active');
			
			$($next).css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {
				$active.removeClass('active last-active');
			});
			
			
		}; // If
		
		return false;  // We don't want the page to jump when an item is clicked.
		
	});  // nav a ->click 
	
	// This bit of code is for the top Nav.
	$('.menu IMG').hover( 
		function () { this.src = this.src.replace("-off","-on"); },
		function () { if($(this).attr('class') != "clicked") this.src = this.src.replace("-on","-off"); }
	); 
	
});  //document ready
