/**
 * @author Amahagane
 */

 $(function(){

	//Do what we need to when form is submitted.
	$('#submit').click(function(){

	//Setup any needed variables.
	var input_name = $('#name').val(),
		input_email = $('#email').val(),
		input_service = $('#service').val(),
		input_message = $('#message').val(),
		response_text = $('#response');
		//Hide any previous response text
		response_text.hide();

		//Change response text to 'loading...'
		response_text.html('Sending...').show();

		//Make AJAX request
		$.post('contact-form.php', {name: input_name, email: input_email, service: input_service, message: input_message}, function(data){
			response_text.html(data);
		});

		//Cancel default action
		return false;
	});

});

