$(document).ready(function(){
		var iconCarregando = $('<img src="images/loading1.gif" class="icon" /> <span class="destaque">Carregando. Por favor aguarde...</span>');
	$('#form_dois').submit(function(e) {
	e.preventDefault();
	var serializeDados = $('#form_dois').serialize();
	
	$.ajax({
			url: 'index.php?link=envia', 
			dataType: 'html',
			type: 'POST',
			data: serializeDados,
			beforeSend: function(){
			$('#insere_aqui').html(iconCarregando);
			},
			complete: function() {
			$(iconCarregando).remove();
			},
			success: function(data, textStatus) {
			$('#insere_aqui').html('<p>Email Enviado com Sucesso</p>').show('slow');
			},
			error: function(xhr,er) {
				$('#mensagem_erro').html('<p class="destaque">Error ' + xhr.status + ' - ' + xhr.statusText + '<br />Tipo de erro: ' + er +'</p>')
			}		
		});
	});	
});

