$(document).ready(function() {
    
    
    var working = false;
    $('#form_contacto').submit(function() {
              
        if(working){
            return false;
        }
        working = true;
        
        $('#form_contacto .success_message').hide();
        
        $("body").toggleClass('wait');
                  
                  
        $.post($("#form_contacto").attr('action'),
        {
            email : $('#form_contacto  [name=email]').val(),
            nome : $('#form_contacto [name=nome]').val(),
            telefone : $('#form_contacto [name=telefone]').val(),
            mensagem : $('#form_contacto [name=mensagem]').val()
        },

        function(result) {
	    	  
            if (result.error == '') {
	    		  
                $('#form_contacto .success_message').show('slow');
	    		  
            } 
                  
            working = false;
            $("body").toggleClass('wait');
	    	 
        }
        , "json"
	      
        );
	    
        return false;
    }); 
	  
    $('#limpar').click(function(){
              
        $(':input','#form_contacto')
        .not(':button, :submit, :reset, :hidden')
        .val('')
        .removeAttr('checked')
        .removeAttr('selected');
              
    });
          
          
});