$(function() {
		
	$('#logo')
		.hover(
			function() {
				$(this).stop().animate({opacity: .7});
			},
			function() {
				$(this).stop().animate({opacity: 1});
			}
		
		)
				
	var floatHeader = $('#float-header-wrap');
	var contactButton = $('#contact-btn');
	var searchButton = $('#search-btn');
	var searchBar = $('#search-bar');
	
	contactButton
		.addClass('slider-btn')
		.click(
			function() {
				if (contactButton.hasClass('off')) {
					contactButton.addClass('on').removeClass('off');
					floatHeader.animate({top:0}, 1000);		
					return false;				
				} else {
					contactButton.removeClass('on').addClass('off');
					floatHeader.animate({top: "-316px"}, 1000);
					return false;
				}

			}
		);			
		
	$('#close-btn')
		.click(function() {
				floatHeader.animate({top: "-316px"}, 1000);
				contactButton.addClass('off').removeClass('on');
				return false;	
			}
		);
		
	$('#submit')
		.animate({opacity: .65}, 0)
		.hover(
			function() {
				$(this).stop().animate({opacity: 1}, 500)
			},
			function() {
				$(this).stop().animate({opacity: .65}, 500)
			}
		)
		
	$('label.hover')
		.hover(
			function() {
				$('#submit').stop().animate({opacity: .85}, 500)
			},
			function() {
				$('#submit').stop().animate({opacity: .65}, 500)
			}
		);
		
	searchButton
		.click(
			function() {
				if (searchButton.hasClass('off')) {
					searchBar.slideDown();
					searchButton.addClass('on').removeClass('off');
					return false;				
				} else {
					searchBar.slideUp();
					searchButton.addClass('off').removeClass('on');
					return false;
				}
			}
		);
		
	$('#search-submit')
		.animate({opacity: .75}, 0)
		.hover(
			function() {
				$(this).stop().animate({opacity: 1}, 500)
			},
			function() {
				$(this).stop().animate({opacity: .75}, 500)
			}
		);
	
	$('#hide-search')
		.click(
			function() {
				searchBar.slideUp();
				searchButton.addClass('off').removeClass('on');
				return false;
			}
		)
		
});
