function handler_contact_form() {
	$.ajax({
		url: '/includes/handler_contact_form.php',
		data: $('#contact_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				alert( 'Your message was sent successfuly.' );
				window.location.href = window.location.pathname;

			}
			else alert( 'There was a problem sending your message.  Check that all the fields are filled out correctly and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem sending your message.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}

function handler_impression_form() {
	$.ajax({
		url: '/includes/handler_impression_form.php',
		data: $('#impression_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				alert( 'Your message was sent successfuly.' );
				window.location.href = window.location.pathname;

			}
			else alert( 'There was a problem sending your message.  Check that all the fields are filled out correctly and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem sending your message.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}

function handler_dlt_form() {

	$.ajax({
		url: '/includes/handler_dlt_form.php',
		data: $('#dlt_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				window.location.href = '/small_groups/lt196z4eab76.php';
			}
			else alert( 'The password did not match the database.  Check your entry and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem logging in.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}

function handler_baptism_form() {

	$.ajax({
		url: '/includes/handler_baptism_form.php',
		data: $('#baptism_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				alert( 'Your message was sent successfuly.' );
				window.location.href = window.location.pathname;
			}
			else alert( 'There was a problem sending your registration.  Check that all the fields are filled out correctly and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem sending your registration.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}

function handler_sg_form() {

	$.ajax({
		url: '/includes/handler_sg_form.php',
		data: $('#sg_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				alert( 'Your message was sent successfuly.' );
				window.location.href = window.location.pathname;
			}
			else alert( 'There was a problem sending your request.  Check that all the fields are filled out correctly and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem sending your request.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}

function handler_deacon_form() {
	$.ajax({
		url: '/includes/handler_deacon_form.php',
		data: $('#deacon_form').serialize(),
		type: 'post',
		cache: false,
		dataType: 'text',
		success: function (data) {
			if( data == 'success' ) {	
				alert( 'Your request was sent successfuly.' );
				window.location.href = window.location.pathname;

			}
			else alert( 'There was a problem sending your request.  Check that all the fields are filled out correctly and please try again.' );			
		},
		error: function (data) {
			alert( 'There was a problem sending your message.  Check that all the fields are filled out correctly and please try again' );
		}
	});
}
