//Assinatura
function valAssinatura()
{
    var nome        = $m("nome"); 
    var email       = $m("email");
    var endereco    = $m("endereco");
    var numero      = $m("numero");
    var cep         = $m("cep");
    var bairro      = $m("bairro");
    var cidade      = $m("cidade");
    var uf          = $m("uf");
    var dia_n       = $m("dia");
    var mes_n       = $m("mes");
    var ano_n       = $m("ano");
    var rg          = $m("rg");
    var cpf         = $m("cpf");
    var profissao   = $m("profissao");
    //residencial
    var ddd         = $m("ddd");
    var n_telefone  = $m("n_telefone");
    //comercial
    var ddd2        = $m("ddd2");
    var n_telefone2 = $m("n_telefone2");
    //Cobranca
    var endereco2   = $m("endereco2");
    var numero2     = $m("numero2");
    var cep2        = $m("cep2");
    var bairro2     = $m("bairro2");
    var cidade2     = $m("cidade2");
    var uf2         = $m("uf2");
    //Vencimento
    var dia_v       = $m("dia_v");
    var mes_v       = $m("mes_v");
    var ano_v       = $m("ano_v");
    
    var tipo_ass_a  = $m("anual");
    var tipo_ass_s  = $m("semestral");
    
    var forma_b     = $m("boleto");
    var forma_d     = $m("domicilio");
    
    if(removeE(nome.value) <= 0)  
    {
        alert("O campo Nome é obrigatório.");
        nome.value  = "";
        nome.focus();
        return false;
    }
    if(nome.value.length < 2)
    {
        alert("Informe o seu nome");
		nome.focus();
		return false;
    }
    if(removeE(email.value) <= 0)
	{
		alert("O campo E-mail é obrigatório.");
        email.value = "";
		email.focus();
		return false;
	}
	if(!checkMail(email.value))
	{
		alert("O e-mail informado não é válido.");
		email.focus();
		return false;
	}
    if(removeE(endereco.value) <= 0)  
    {
        alert("O campo Endereço é obrigatório.");
        endereco.value  = "";
        endereco.focus();
        return false;
    }
    if(removeE(numero.value) <= 0)  
    {
        alert("O campo Nº é obrigatório.");
        numero.value  = "";
        numero.focus();
        return false;
    }
    if(removeE(cep.value) <= 0)  
    {
        alert("O campo CEP é obrigatório.");
        cep.value  = "";
        cep.focus();
        return false;
    }
    if(cep.value.length < 8)
    {
        alert("CEP deve ter 8 dígitos");
		cep.focus();
		return false;
    }
    if(removeE(bairro.value) <= 0)  
    {
        alert("O campo Bairro é obrigatório.");
        bairro.value  = "";
        bairro.focus();
        return false;
    }
    if(removeE(cidade.value) <= 0)  
    {
        alert("O campo Cidade é obrigatório.");
        cidade.value  = "";
        cidade.focus();
        return false;
    }
    if(uf.value == "")  
    {
        alert("Selecione a UF.");
        uf.value  = "";
        uf.focus();
        return false;
    }
    if(dia_n.value != "" || mes_n.value != "" || ano_n.value != "")  
    {
        if(!chkData(dia_n,mes_n,ano_n," de Nascimento"))
            return false;
    }
    
    if(removeE(cpf.value) <= 0)  
    {
        alert("O campo CPF é obrigatório.");
        cpf.value  = "";
        cpf.focus();
        return false;
    }
    if(!validaCPF(cpf.value))
    {
        return false;
    }
    if(!chkTel(ddd,n_telefone,"do Fone Residencial",""))
    {
        return false;
	}
    if(ddd2.value != "" || n_telefone2.value != "")
    {
        if(!chkTel(ddd2,n_telefone2,"do Fone Comercial",""))
        {
            return false;
    	}
    }
    
    if(endereco2.value != "" || numero2.value != "" || bairro2.value != "" || cidade2.value != "" || uf2.value != "")
    {
        if(removeE(endereco2.value) < 0)  
        {
            alert("O campo Endereço de Cobrança é obrigatório.");
            endereco2.value  = "";
            endereco2.focus();
            return false;
        }
        if(removeE(numero2.value) < 0)  
        {
            alert("O campo Nº de Cobrança é obrigatório.");
            numero2.value  = "";
            numero2.focus();
            return false;
        }
        if(removeE(cep2.value) <= 0)  
        {
            alert("O campo CEP de Cobrança é obrigatório.");
            cep2.value  = "";
            cep2.focus();
            return false;
        }
        if(cep2.value.length < 8)
        {
            alert("CEP de Cobrança deve ter 8 dígitos");
    		cep2.focus();
    		return false;
        }
        if(removeE(bairro2.value) < 0)  
        {
            alert("O campo Bairro de Cobrança é obrigatório.");
            bairro2.value  = "";
            bairro2.focus();
            return false;
        }
        if(removeE(cidade2.value) < 0)  
        {
            alert("O campo Cidade de Cobrança é obrigatório.");
            cidade2.value  = "";
            cidade2.focus();
            return false;
        }
        if(removeE(uf2.value) < 0)  
        {
            alert("Selecione a UF de Cobrança.");
            uf2.value  = "";
            uf2.focus();
            return false;
        }
    }
    if(dia_v.value != "" || mes_v.value != "" || ano_v.value != "")  
    {
        if(!chkData(dia_v,mes_v,ano_v," de Vencimento"))
            return false;
    }
    if(tipo_ass_a.checked == false && tipo_ass_s.checked == false)
    {
        alert("Selecione o Tipo de Assinatura e o tipo de pagamento.");
        return false;
    }
    
    if(forma_b.checked == false && forma_d.checked == false)
    {
        alert("Selecione a Forma de Cobrança.");
        return false;
    }
    
    return true;
}
