$(document).ready(function (){
	$("#inquiries").submit(function () {
		send();
		return false;
	});
	$("#reset_button").click(function () {
		clearError();
	})
});

function send()
{
	var data = $("#inquiries").serialize();
	$.ajax({
		url: 'send_inquiries.php',
		type: 'post',
		data: data,
		success: function message(response) {
			if (response == 1) {
				$("#error").html('Information has been sent');
				$("#inquiries")[0].reset();
			}
			else $("#error").html(response);
		}
	})
}

function clearError()
{
	$("#error").html('&nbsp;');
}
