$(document).ready(function() 
{   
////////////////// The Contact form///////////////////////////
 	$('#submit').click(function () 
 	{
		jQuery(function() {
		 
		// show a simple loading indicator
		var loader = jQuery('<img src="../images/loading.gif" alt="loading..." />')
			//.css({position: "inherit", top: "1em", left: "25em"})
			.appendTo("#loader")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#contact_us").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#okmessage"
					
				});			
			
					$('#okmessage').fadeIn('slow');
					setTimeout(function(){ $("#okmessage").fadeOut('slow') }, 10000);
			}
			
		});
	});

 	});
////////////////// END The Contact form///////////////////////////	
////////////////// The Newsletter form///////////////////////////	
 	$('#newsletter_submit').click(function () 
 	{
	jQuery(function() {
		 
		// show a simple loading indicator
		var loading = jQuery('<img src="../images/loading.gif" alt="loading..." />')
			//.css({position: "inherit", top: "1em", left: "25em"})
			.appendTo("#loading")
			.hide();
		jQuery().ajaxStart(function() {
			loading.show();
		}).ajaxStop(function() {
			loading.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#newsletter").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#messageSent"
					
				});			
			
					$('#messageSent').fadeIn('slow');
					setTimeout(function(){ $("#messageSent").fadeOut('slow') }, 7000);
             
			}
			
		});
	});


 	});	
////////////////// END The Newsletter form///////////////////////////	
});  ///////////Doc Ready  
  
