function contactForm(name, email, message) {

	var email_check = checkEmail(email);
	
	if(name == "") {
		
		jAlert('Looks like you left your name blank, we won\'t know what to call you!', 'Oops', function(r) {
			
			$("input[name='contactName']").focus();
		
		});
		
		return false;
	
	} else if(email_check == false) {
		
		jAlert('Looks like your email address isn\'t properly formatted.', 'Oops', function(r) {
			
			$("input[name='contactEmail']").focus();
		
		});
		
		return false;
		
	} else if(message == "") {
	
		jAlert('Looks like you didn\'t include a message to us.', 'Oops', function(r) {
			
			$("textarea[name='contactMessage']").focus();
		
		});
		
		return false;	
	
	} else {
	
		$.post("_ajax/actions.inc.php", { action:"contactForm", name:name, email:email, message:message }, function(data) {
			
			var message = "Thanks! We'll be in touch.";
			
			if(data != 1) {
				
				message = "Uh-oh, looks like the hamsters weren't running fast enough and we missed that.";
			
			}
			
			$("#contactRight").html("<p style='padding-bottom:15px;font-weight:bold;color:#000'>"+message+"</b></p>");
			
		});
		
		return false;
	
	}
	
	return false;

}



function checkEmail(email) {

	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (!filter.test(email)) {
	
		return false;
	
	} else {
	
		return true;
	
	}
	
}
