function checkMailIndex()
{
	var mail = document.form1.txtEmail.value;
	var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	
    if(typeof(mail) == "string")
	{
		if(er.test(mail)) 
		{ 
			document.form1.action="site_CadMailing.php";
			document.form1.submit();
		} 
		else {
	        alert("E-mail inválido.");
			document.form1.txtEmail.focus();
			return false;
    	}
    }
	else if(typeof(mail) == "object")
	{
        if(er.test(mail.value))
		{ 
           return true; 
        } else {
	        alert("E-mail inválido.");
			document.form1.txtEmail.focus();
			return false;
    	}
    } else {
        alert("E-mail inválido.");
		document.form1.txtEmail.focus();
		return false;
    }
}

<!---------------- SÓ DEIXA DIGITAR NÚMEROS EM ALGUNS CAMPOS ------------------->
function SomenteNumero(e)
{
	var tecla=(window.event)?event.keyCode:e.which;
	
	if((tecla > 47 && tecla < 58)) 
		return true;
	else{
		if (tecla != 8) 
			return false;
		else 
			return true;
		}
}
<!------------------------------------------------------------------------------>
<!---------------- VALIDA O EMAIL DIGITADO ------------------->
function checkMail(mail)
{
	var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	
    if(typeof(mail) == "string")
	{
		if(er.test(mail)) { 
			return true; 
		} else {
	        alert("E-mail inválido.");
			return false;
    	}
    }
	else if(typeof(mail) == "object")
	{
        if(er.test(mail.value))
		{ 
           return true; 
        } else {
	        alert("E-mail inválido.");
			return false;
    	}
    } else {
        alert("E-mail inválido.");
		return false;
    }
}
<!------------------------------------------------------------------------------>

