/* -- Set Active Nav -- */

	function activeNav() {
	
		if($('body').hasClass('home')) { $('li#home').addClass('active'); }
		if($('body').hasClass('menu')) { $('li#menu').addClass('active'); }
		if($('body').hasClass('team')) { $('li#team').addClass('active'); }
		if($('body').hasClass('dine')) { $('li#dine').addClass('active'); }
		if($('body').hasClass('find-us')) { $('li#findus').addClass('active'); }
	
	}
	
/* -- Hide The Content -- */

	function closer() {
		$('button#closer').click(function() {
			$('.content').fadeOut('slow', function() {
				var linkValue = $('ul.nav li.active a').html();
				var linkHref = $('ul.nav li.active a').attr('href');
				$('ul.nav li.active').html('<button id="opener">'+linkValue+'</button>');
				
				$('button#opener').click(function() {
					$('.content').fadeIn('slow', function() {
						$('ul.nav li.active').html('<a href="'+linkHref+'">'+linkValue+'</a>');
						
					});
				});
				
			});
		});
	}
	
/* -- Clear Form Fields on Focus -- */
	
	function clearit() {
		jQuery.fn.cleardefault = function() {
			return this.focus(function() {
				if( this.value == this.defaultValue ) {
					this.value = "";
				}
			}).blur(function() {
				if( !this.value.length ) {
					this.value = this.defaultValue;
				}
			});
		};
		jQuery(".clearit input, .clearit textarea").cleardefault();
	}
	




/* -- FIRE AWAY! -- */
$(document).ready(function() {
	activeNav();
	closer();
	clearit();		
});
