// JavaScript Document
$(document).ready(function() {
	
	// Hide the status and loading animation
	$("#loading").hide();
	$("#status").hide();
	
	// When the form is submitted
	$("#contactus").submit(function() {
	
	// Get form values
  	var php_name = $("#name").val();
	var php_email = $("#email").val();
	var php_phone = $("#phone").val();
	var php_comment = $("#comment").val();
	var php_filter = $("#filter").val();

	// Show AJAX loading GIF
	$().ajaxSend(function(r,s){  
	$("#loading").show();
	});
	
	// Send to French Backend
	$.post("formtomail-fr.php", { in_name: php_name, in_email: php_email, in_phone: php_phone, in_comment: php_comment, in_filter: php_filter }, function(data) {
	
	// FadeOut the AJAX loading GIF
	$().ajaxStop(function(r,s){  
	$("#loading").fadeOut("fast");  
	});
	
	// Show the status
	$("#status").fadeIn("slow");
  	$("#status").html(data);
	
	});
  	return false;  
	
  // End of contact form submit
  }); 

});