$(document).ready(function(){
	
	$('#sendemailForm').submit(function() {
		var email = $('input[@name=email]').val();
		if (!email) {
			alert('Please enter an email address');
		} else {
			var emailInput = $('#emailAddress').val();
			$('#sendemail').html($('#loadingImage').clone());
			$.post(
				'email.php',
				{
					email: emailInput,
					spam: 'nup'
				},
				function(data) {
					$('#sendemail').hide();
					$('#sendSuccess').html(data);
				}
			);
		}
		return false;
	});
});