$(document).ready(function() {
	$('.landing').submit(function() {
		// update user interface
		$('#response').html('<p>Adding email address...</p>');
		
		// Prepare query string and send AJAX request
		$.ajax({
			url: 'includes/store-address.php',
			data: 'ajax=true&email=' + escape($('#email').val()),
			success: function(msg) {
				$('#response').html(msg).fadeIn();
			}
		});
	
		return false;
	});
	
	$("input[type=text]").focus(function() {
		if (this.value == this.defaultValue)
		{
			this.value = "";
			return false;
		}
	});

	$("input[type=text]").blur(function() {
		if (this.value == "")
		{
			this.value = this.defaultValue;
			return false;
		}
	});
});
