/* 
	All Source Code Copyright 2010, Vrasa
	http://vrasa.com/
	
	If you like what you see, and want to use
	some of this code please email us here: 
	hello [at] vrasa.com and we can discuss 
	pricing and availability.

	Date: Sat August 14 20:19:07 2010 -0600
*/

jQuery(document).ready(function(){
	
	jQuery('#contactform').submit(function(){
	
		var action = jQuery(this).attr('action');
		
		jQuery("#message_two").slideUp(250,function() {
		jQuery('#message_two').hide();
		
 		jQuery('#submit')
			.attr('disabled','disabled');
		
		jQuery.post(action, { 
			name: jQuery('#name').val(),
			email: jQuery('#email').val(),
			comments: jQuery('#comments').val(),
		},
			function(data){
				document.getElementById('message_two').innerHTML = data;
				jQuery('#message_two').slideDown('med');
				jQuery('#contactform img.loader').fadeOut('med',function(){jQuery(this).remove()});
				jQuery('#contactform #submit').attr('disabled',''); 
				if(data.match('win') != null) jQuery('#contactform').slideUp('med');
				
			}
		);
		
		});
		
		return false; 
	
	});
	
});
