jQuery(document).ready(function(){
	
	$('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$("#message").slideUp(750,function() {
		$('#message').hide();
		
 		$('#submit')
		//   if load images doesn't load follow the root document that this javascipt file is in and use that root location to reference the image

			.after('<img src="mateo-johnson/javascript/javascript_ajax_contact_form/assets/ajax-loader.gif" class="loader" />')
			.attr('disabled','disabled');
		
		$.post(action, { 
			name: $('#name').val(),
			company: $('#company').val(),
			email: $('#email').val(),
			url: $('#url').val(),
			type: $('#type').val(),
			scope: $('#scope').val(),
			timeline: $('#timeline').val(),
			budget: $('#budget').val(),			
			comments: $('#comments').val(),
			verify: $('#verify').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
				$('#contactform #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
	
});