$(document).ready(function() {
	$('.request_info form').submit(submitForm);
});
function submitForm(evt) {
	evt.preventDefault();
	var post_data = $(this).serialize();
	executeAjaxPost('/process.php', post_data, 'json', submitFormSuccess);
}
function submitFormSuccess(responseObject) {
	$('.request_info form').html('Thank you for submitting your information. We will contact you soon to provide the best pricing for your business.');
}
function executeAjaxPost(post_url, post_data, response_type, callback, error_callback, context) {
    $.ajax({
        data: post_data,
        type: 'POST',
        dataType: response_type,
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            if (typeof error_callback == 'function')
                error_callback(XMLHttpRequest, textStatus, errorThrown, context);
            else
                alert('an error occured while processing your request');
        },
        success: function(data) {
            if (typeof callback == 'function')
                callback(data, context);
        },
        url: post_url
    });
}