var $jx = jQuery.noConflict();

$jx(document).ready(function(){
	
	/* Function for adding loading gif for contact window send button */
	$jx("#send").click(function () { 
      $jx('#loading').fadeIn("slow"); 
    });

	/* Functions for ajax sending data of contact form */
	$jx('#ContactForm').ajaxForm(function(data) {
		if (data==1){
			$jx('#loading').fadeOut("fast");
			alert("Thank you for your inquiry - we will get back to you as soon as possible!");
			$jx('#ContactForm').resetForm();
		}
		else if (data==2){
			$jx('#loading').fadeOut("fast");
			alert("Oops! There was an error in sending your message, please try again");
		}
		else if (data==3)
		{
			$jx('#loading').fadeOut("fast");
			alert("You entered an invalid email address, please try again");
		}
		else if (data==4)
		{
			$jx('#loading').fadeOut("fast");
			alert("You must enter your name, please try again");
		}
		else if (data==5)
		{
			$jx('#loading').fadeOut("fast");
			alert("You must enter a message, please try again");
		}
	});
});