function apagarCampos()
{
    document.labdoutor_cadastro.reset();
}

function verificarPreenchimento()
{
    if(document.labdoutor_cadastro.txtNascDia.value.length > 0)
    {
        if(document.labdoutor_cadastro.txtNascMes.value.length > 0)
        {
            if(document.labdoutor_cadastro.txtNascAno.value.length > 0)
            {
                if(document.labdoutor_cadastro.nome.value.length > 0)
                {
                    if(document.labdoutor_cadastro.email.value.length > 0)
                    {
                        if(verificarEmail(document.labdoutor_cadastro.email.value))
                        {
                            if(document.labdoutor_cadastro.numero_conselho.value.length > 0)
                            {
                                if(document.labdoutor_cadastro.numero_conselho.value != "informe o n°")
                                {
                                    if(document.labdoutor_cadastro.fone.value.length > 0)
                                    {
                                        if(document.labdoutor_cadastro.fone.value != "(xx)xxxx-xxxx")
                                        {
                                            document.labdoutor_cadastro.submit();
                                        }
                                        else
                                        {
                                            alert("Obrigatório o preenchimento do Telefone.");
                                            document.labdoutor_cadastro.fone.focus();
                                        }
                                    }
                                    else
                                    {
                                        alert("Obrigatório o preenchimento do Telefone.");
                                            document.labdoutor_cadastro.fone.focus();
                                    }
                                }
                                else
                                {
                                    alert("Obrigatório o preenchimento do Número do Conselho.");
                                    document.labdoutor_cadastro.numero_conselho.focus();
                                }
                            }
                            else
                            {
                                alert("Obrigatório o preenchimento do Número do Conselho.");
                                document.labdoutor_cadastro.numero_conselho.focus();
                            }
                        }
                        else
                        {
                            alert("Preencha corretamente o E-mail.");
                            document.labdoutor_cadastro.email.focus();
                        }
                    }
                    else
                    {
                        alert("Obrigatório o preenchimento do E-mail.");
                        document.labdoutor_cadastro.email.focus();
                    }
                }
                else
                {
                    alert("Obrigatório o preenchimento do Nome.");
                    document.labdoutor_cadastro.nome.focus();
                }
            }
            else
            {
                alert("Obrigatório o preenchimento da Data de Nascimento.");
                document.labdoutor_cadastro.txtNascAno.focus();
            }
        }
        else
        {
            alert("Obrigatório o preenchimento da Data de Nascimento.");
            document.labdoutor_cadastro.txtNascMes.focus();
        }
    }
    else
    {
        alert("Obrigatório o preenchimento da Data de Nascimento.");
        document.labdoutor_cadastro.txtNascDia.focus();
    }
}

function verificarNumero(event)
{
    var intCodigo = event.keyCode  ? event.keyCode  :
                    event.charCode ? event.charCode :
                    event.which    ? event.which    : void 0;
    
    if(((intCodigo >= 48) && (intCodigo <= 57)) || (intCodigo == 8) || (intCodigo == 9) || (intCodigo == 37) || (intCodigo == 39) || (intCodigo == 46))
        return true;
    else
        return false;
}