function inicia(){
      var pagina='contato_enviar.php'
	  var my = new Ajax.Updater(
		    {success: 'retorno'},	// div de retorno
        		pagina,
		    {
			    method: 'post',
				parameters: $('form_contato').serialize(),
				encoding: 'ISO-8859-1',
				onFailure: retiraCarr,
			    onCreate: mostraCarr,
			    onComplete: retiraCarr,
			    evalScripts: true
	  });
}
function mostraCarr() {
    car = document.createElement('div');
	car.id = 'carregando';
	car.innerHTML = '';
    // car.innerHTML = 'Enviando email...';
    document.body.appendChild(car);
}

function retiraCarr() {
    if ($('carregando'))
	document.body.removeChild($('carregando'));
	$('contato').reset(); // comando para deixar todos os campos do formulário em branco
}

// VALIDAÇÕES ------------------------------------------------------------------------------------------------------------------------------//
function ValidarFormulario()                                                                                                                //
{                                                                                                                                           //
    if (document.getElementById("nome").value == ""){                                                                                       //
        alert("Informe o seu nome!");                                                                                                       //
        document.getElementById("nome").focus();                                                                                            //
        return false;                                                                                                                       //
    }                                                                                                                                       //
                                                                                                                                            //
    if (document.getElementById("email").value == ""){                                                                                      //
        alert("Informe o e-mail!");                                                                                                         //
        document.getElementById("email").focus();                                                                                           //
        return false;                                                                                                                       //
    }                                                                                                                                       //
                                                                                                                                            //
    if (document.getElementById("mensagem").value == ""){                                                                                   //
        alert("Informe a mensagem!");                                                                                                       //
        document.getElementById("mensagem").focus();                                                                                        //
        return false;                                                                                                                       //
    }                                                                                                                                       //
                                                                                                                                            //
    inicia();                                                                                                                               //
    return true;                                                                                                                            //
}                                                                                                                                           //
//<input type="button" value="Enviar" onclick="ValidarFormulario();" />                                                                     //
//------------------------------------------------------------------------------------------------------------------------------------------//
