jQuery(document).ready(function(){
	
	$('#contactformy').submit(function(){
	
$('#thanks').fadeIn("slow");


	
		var action = $(this).attr('action');
		
		$('#submit')
			.before('<img src="images/ajax-loader.gif" width="35" class="loader" />')
			.attr('disabled','disabled');
		
		$.post(action, { 
			firstname: $('#firstname').val(),
			lastname: $('#lastname').val(),
			email: $('#email').val(),
			address: $('#address').val(),
			address2: $('#address2').val(),
      city: $('#city').val(),
			state: $('#state').val(),
			zip: $('#zip').val()

			
		
		},
			function(data){
				$('#contactformy #submit').attr('disabled','');
				$('.response').remove();
				$('#contactformy').before('<span class="response">'+data+'</span>');
				$('.response').slideDown();
				$('#contactformy img.loader').fadeOut(1000,function(){$(this).remove()});
				
				if(data=='<div id="show"><h2>Your message was successfully sent!</h2></div><div id="thanks"><h3>Thank you for entering the ZAPZYT Back to School shopping spree worth $1000. The winner will be announced at <a href="http://www.zapzyt.com">www.zapzyt.com</a> on or around September X, 2009.  Please visit the link below to recieve a $3 rebate for ZAPZYT products.</h3><p><a href="/">Home</a></p></div>') $('#contactformy').fadeOut("slow");

			}
			
		);
		
		return false;
	
	});


});