$(document).ready(function() {
		
		
		
		
	// Submit form event handler
	$('#contactForm').submit(function() {
		$('#contactResult').hide();
		$('#contactLoading').show();
		
		$.post("sendMail.php", 
				{ from: $('#from').val(), name: $('#name').val(), phone: $('#phone').val(), message: $('#message').val() }, 
				function(response){
					
					// format of response will be 0*Message if Message is to be displayed
					// or 1*Page if user should be redirected to Page
					
					piece = response.split("*");
					$('#contactResult').html(piece[1]);
					$('#contactLoading').hide();
					$('#contactResult').show();
								
		});	// post response
		
		return false;
	});// end submit form handler
});	// end document ready


function finishAjax(messageID, loadingID, response)
{
	$('#'+loadingID).hide();
	$('#'+messageID).html(unescape(response));
	$('#'+messageID).show();
}
