$(document).ready(function() {
	
	//$('#contact-form').validate();
	//$('h2').hide();
	//setTimeout("$('h2').fadeIn(1000)", 1000);
	
	
	$('#open-up').click(function() {
		$('#mail-form').slideToggle('slow');
		$('html').animate({scrollTop: 0}, 'slow');
		return false;
	});
	
	$('#close').click(function() {
		$('#mail-form').slideUp('slow');
		return false;
	});
	
	$('#send').click(function() {		
		$form = $('form').serialize();
				
		$.ajax({
			type: 'POST',
			url: '/inc/send_mail.php',
			data: $form + '&submit=submit',
			success: function(data) {
				$('#mail-form').slideUp('slow', function() {
					alert('Hey Thanks! We\'ll be in touch.');
				});
			}
		});
		return false;
	});
	
	$('#mail-form input').not('#send').each(function() {
		$(this).focus(function() {
			$(this).attr('value', '');
		},
		function() {
			alert('boner');
		});
	});
	
	$('#mail-form input').not('#send').blur(function() {
		$content = $(this).val();
		$label = $(this).attr('id');
	
		$label = $label.replace('-', ' ');
			
		if ($content == '') {
			$(this).val($label);
		}
	});
	
	$('textarea').focus(function() {
		$(this).html('');
	});
});
