/* Autor Rodrigo Silveira
 * Data: 30/03/2009
 * Criada a função para validação do email no formulário do Newsletter.	
 */

function validaEmail(nform, msg, msg2)
{
	var txt = document.getElementById(nform).email.value;
	var nome = document.getElementById(nform).name.value;
	if ((txt.length != 0) && (nome.length != 0))
	{
		if(txt.indexOf('.') > -1 && txt.indexOf('@') > -1)
		{
			document.getElementById(nform).submit();		
		}
		else
		{
			alert(msg);
		}
	}
	else
	{
		alert(msg2);
	}
}