// JavaScript Document

$(function() {
	$('#contact_button').click(function() {
		$('#black_out').fadeIn();
		$('#light_box').fadeIn();
		$.ajax({
			type: "POST",
			url: template_dir+"/contact_form.php",
			dataType: 'html',
			success: function(html) {
				$('#light_box').html(html);
			},
			error: function(e) {
				alert(e.msg);
			}
		});
		//$('#light_box').load(template_dir + '/contact_form.php');		
	});
	
	$('#black_out').click(function() {
		$('#black_out').fadeOut();
		$('#light_box').fadeOut();
	});
	
	$('#sticky').hide();
	$.waypoints.settings.scrollThrottle = 30;
	$('#wrapper').waypoint(function(event, direction) {
		if(direction==="down") {
			$('#sticky').fadeIn();
		} else {
			$('#sticky').fadeOut();
		}
	}, {
		offset: '-30'
	})
	
	$('#mce-EMAIL, #mce-FNAME, #mce-LNAME').focus(function() {
		$(this).val("");
	});
	
	$('#mce-EMAIL').blur(function() {
		if($(this).val()==="") {
			$(this).val("enter your email here *");
		}
	});
	
	$('#mce-FNAME').blur(function() {
		if($(this).val()==="") {
			$(this).val("enter your first name here");
		}
	});
	
	$('#mce-LNAME').blur(function() {
		if($(this).val()==="") {
			$(this).val("enter your last name here");
		}
	});
});
