$(document).ready(function() {
	//Submit the form if all data has been provided, provide a message at the end with the status of the post.
	$('div#contactus form').submit(function() {
		theForm = this;
		with(document.getElementById($(this).attr('id'))) {
			if(lastName.value != '' && firstName.value != '' && email.value != '' && comments.value != '') {
				$.post($(this).attr('action'), $(this).serialize(), function(data) {
					if(data.indexOf('true') != -1) {
						$.facebox("<p>Thank you for your input.</p><p>If applicable, we will be in touch with you shortly.</p>");
						theForm.reset();
					} else {
						$.facebox("<p>We're sorry, there was a problem with your submission.</p><p>Please try again, if the problem persists please send an email to: info@luzernltd.com.</p>");
					}
				});
			} else $.facebox("<p>All fields need to be filled out before you can submit the form.</p>");
		}
		return false;
	});
	
	//If they click the reset button, well... reset the form
	$("div#contactus form input[name='resetForm']").click(function() {document.getElementById($('div#contactus form').attr('id')).reset();});
});