
function FormContato(){
	
	if ( $("nome").value == "" )
	{
		alert("Informe o seu Nome.");
		$("nome").focus();
		return;
	}
	if ( $("email").value == "" )
	{
		alert("Informe o seu E-mail.");
		$("email").focus();
		return;
	}
	if ( $("tel").value == "" )
	{
		alert("Escreva seu Telefone.");
		$("tel").focus();
		return;
	}
		if ( $("msg").value == "" )
	{
		alert("Escreva sua Mensagem.");
		$("msg").focus();
		return;
	}
	
	var params;
	params = "nome=" + $("nome").value;
	params += "&email=" + $("email").value;
	params += "&telefone=" + $("tel").value;
	params += "&assunto=" + $("assunto").value;
	params += "&mensagem=" + $("msg").value;
		$("div_enviando").style.display = "block";	
	var ajax = new AJAX();
	ajax.url = "sendcontato.php";	
	ajax.metodo = "POST";
	ajax.params = params;
	ajax.retorno = function() {	
		$("FormContato").reset();	
		$('div_alert').style.display = 'block';
		$("div_enviando").style.display = "none";	
		setTimeout(FechaMensagem,3000);	// segundos
	}
	ajax.conectar();
	
}
// Função para desaparecer a DIV ALERT /\
function FechaMensagem() {
	//$('div_alert').style.display = 'none';
	new Effect.Fade('div_alert');
}

/* Metodo GET
function FormContato(){
	
	if ( $("nome").value == "" )
	{
		alert("Informe o seu Nome.");
		$("nome").focus();
		return;
	}
	if ( $("email").value == "" )
	{
		alert("Informe o seu E-mail.");
		$("email").focus();
		return;
	}
	if ( $("tel").value == "" )
	{
		alert("Escreva seu Telefone.");
		$("tel").focus();
		return;
	}
		if ( $("msg").value == "" )
	{
		alert("Escreva sua Mensagem.");
		$("msg").focus();
		return;
	}
	
	var pagina = "sendcontato.php";
	pagina += "?nome=" + $("nome").value;
	pagina += "&email=" + $("email").value;
	pagina += "&telefone=" + $("tel").value;
	pagina += "&mensagem=" + $("msg").value;
	
	window.open(pagina,'Contato','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=10,height=10');
}
*/
function FecharEnviando() {
	$('div_alert').style.display = 'none';
}
