function check()
{
    if(document.cadastro.nome.value == ""){
      alert("Nome do(a) aluno(a) Inválido!");
      document.cadastro.nome.focus();
      return false;
    }
    else if(document.cadastro.matric.value == ""){
      alert("Nº da Matrícula Inválido");
      document.cadastro.matric.focus();
      return false;
    }
    else if (document.cadastro.turma.value == "")
	{
		alert ("Código da Turma Inválido!");
        document.cadastro.turma.focus();
        return false;
	}
    if(document.cadastro.email.value.indexOf('@')==-1 || document.cadastro.email.value.length < 4 || document.cadastro.email.value.indexOf('.')==-1 )
	{
		alert('Formato de e-mail inválido!');
		document.cadastro.email.focus();
		return false;
	}
    else if (document.cadastro.senha.value == "")
	{
		alert ("Senha Inválida - Deve ser de 4 a 8 caracteres!");
		return false;
	}
    else if (document.cadastro.senha.value.length<4)
	{
		alert ("Senha Inválida - Deve ser de 4 a 8 caracteres!");
		return false;
	}
    else if(document.cadastro.senha.value != document.cadastro.cad_conf.value)
    {
	    alert("O campo confirmar deve ser igual ao campo senha!");
		return false;
	}

    else
	{
		return true;
	}
}

function check1()
{
    if(document.cadastro.nome.value == ""){
      alert("Nome do(a) aluno(a) Inválido!");
      document.cadastro.nome.focus();
      return false;
    }
    else if (document.cadastro.turma.value == "")
	{
		alert ("Código da Turma Inválido!");
        document.cadastro.turma.focus();
        return false;
	}
    if(document.cadastro.email.value.indexOf('@')==-1 || document.cadastro.email.value.length < 4 || document.cadastro.email.value.indexOf('.')==-1 )
	{
		alert('Formato de e-mail inválido!');
		document.cadastro.email.focus();
		return false;
	}
    else if (document.cadastro.conf_senha.value == "")
	{
		alert ("Senha Inválida!");
        document.cadastro.conf_senha.focus();
        return false;
	}
    else if (document.cadastro.nova_senha.value == "")
	{
		alert ("Nova Senha Inválida - Deve ser de 4 a 8 caracteres!");
        document.cadastro.nova_senha.focus();
        return false;
	}
    else if (document.cadastro.nova_senha.value.length<4)
	{
		alert ("Nova Senha Inválida - Deve ser de 4 a 8 caracteres!");
        document.cadastro.nova_senha.focus();
        return false;
	}
    else if(document.cadastro.nova_senha.value != document.cadastro.confirma.value)
    {
	    alert("O campo Confirme deve ser igual ao campo Nova Senha!");
        document.cadastro.confirma.focus();
        return false;
	}
    else
	{
		return true;
	}
}

function check2()
{
    if(document.cadastro.nome.value == ""){
      alert("Nome do(a) aluno(a) Inválido!");
      document.cadastro.nome.focus();
      return false;
    }
    else if(document.cadastro.matricula.value == ""){
      alert("Nº da Matrícula Inválido");
      document.cadastro.matricula.focus();
      return false;
    }
    else
	{
		return true;
	}
}

function checkm()
{
    if(document.cadastro.email.value.indexOf('@')==-1 || document.cadastro.email.value.length < 4 || document.cadastro.email.value.indexOf('.')==-1 )
	{
		alert('Formato de e-mail inválido!');
		document.cadastro.email.focus();
		return false;
	}
    else
	{
		return true;
	}
}


