(function() {
	
	$(document).ready(function() {
		$('#error').hide();
		$('#contact-form').submit( function() {
			$('#error').hide();
			var error = "";
			var str = $('#contact-form input[name="fname"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a first name.<br />";
			}
			str = $('#contact-form input[name="lname"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a last name.<br />";
			}
			str = $('#contact-form input[name="company"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a company name.<br />";
			}
			str = $('#contact-form input[name="email"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include an email address.<br />";
			}
			str = $('#contact-form input[name="add1"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include an mailing address.<br />";
			}
			str = $('#contact-form input[name="city"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a city.<br />";
			}
			str = $('#contact-form input[name="zip"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a zip code.<br />";
			}
			str = $('#contact-form input[name="phone"]').attr("value");
			if( $.trim(str) == "" ) {
				error += "Please include a phone number.<br />";
			}
			
			if( error ) {
				$('#error').html(error).show();
				return false;
			}
			
			return true;
		});
	});

})();