$(function() {
	
	$('#submit').click(function() {
	$('#contact').append('<img src="../images/loader.gif" alt="Currently Loading" id="loading" />');
	
		var name = $('#name').val();
		var email = $('#email').val();
		var organisation = $('#organisation').val();
		var place = $('#place').val();
		var comments = $('#comments').val();
		
		$.ajax({
			url: '../submit_to_db.php',
			type: 'POST',
			data: 'name=' + name + '&email=' + email + '&organisation=' + organisation + '&place=' + place + '&comments=' + comments,
			
			success: function(result) {
				$('#response').remove();
				$('#contact').append('<p id="response">' + result + '</p>');
				$('#loading').fadeOut(500, function() {
				$(this).remove();
				});
						
			}

			
		});
		
		return false;
	
	});
	
});
