// JavaScript Grupo Atlântico

function validaLogin(){
	with (document.formLogin){		
		if(txtLogin.value == ""){
			alert("'Usuário' Inválido. Preencha o campo corretamente.")	
			txtLogin.focus();
			return false
		}	
		if(txtSenha.value == "" ||txtSenha.value.length < 6){
			alert("'Senha' Inválida. Preencha o campo corretamente.")	
			txtSenha.focus();
			return false
		}
	}
	return true
}

function validaCadastro(){
	with(document.form){
		if(txtNome.value == ""){
			alert("Preencha corretamente o campo 'Empresa'.")	
			txtNome.focus();
			return false
		}	
		if(txtCNPJ.value == ""){
			alert("Preencha corretamente o campo 'CNPJ'.")	
			txtCNPJ.focus();
			return false
		}
		if(txtNatureza.value == "#"){
			alert("Selecione corretamente o campo 'Natureza Jurídica'.")	
			txtNatureza.focus();
			return false
		}		
		if(txtContato.value == ""){
			alert("Preencha corretamente o campo 'Contato'.")
			txtContato.focus();
			return false
		}
		if(txtEmail.value.indexOf('@') == "-1"||txtEmail.value.indexOf('.') == "-1"){
			alert("Preencha corretamente o campo 'Email'.")
			txtEmail.focus();
			return false
		}
		if(txtDDD.value == ""){
			alert("Preencha corretamente o campo 'DDD'.")	
			txtDDD.focus();
			return false
		}		
		if(txtTel.value == ""){
			alert("Preencha corretamente o campo 'Telefone'.")	
			txtTel.focus();
			return false
		}		
		if(Contabil.checked == false && Fiscal.checked == false && Trabalhista.checked == false && Legalizacao.checked == false){
			alert("Selecione corretamente uma 'Assessoria Mensal'.")
			return false			
		}else{
			if(Contabil.checked == true){
				if(txtC_pagamentos.value == ""){
					alert("Preencha corretamente a 'Qtde. média de pagamentos/mes'.")
					txtC_pagamentos.focus();
					return false
				}
				if(txtC_bancos.value == ""){
					alert("Preencha corretamente a 'Qtde. de bancos que opera'.")
					txtC_bancos.focus();
					return false
				}
				if(txtC_faturamento.value == ""){
					alert("Preencha corretamente o 'Faturamento/Mes'.")	
					txtC_faturamento.focus();
					return false
				}
			}
			if(Fiscal.checked == true){
				if(txtF_entrada.value == ""){
					alert("Preencha corretamente a 'Qtde. média de NF de entrada/mes'.")
					txtF_entrada.focus();
					return false
				}
				if(txtF_saida.value == ""){
					alert("Preencha corretamente a 'Qtde. média de NF de saída/mes'.")
					txtF_saida.focus();
					return false
				}
				if(txtF_servicos.value == ""){
					alert("Preencha corretamente a 'Qtde. média de NF de serviço/mes'.")	
					txtF_servicos.focus();
					return false
				}
			}
			if(Trabalhista.checked == true){
				if(txtT_funcionarios.value == ""){
					alert("Preencha corretamente a 'Qtde. de funcionários'.")
					txtT_funcionarios.focus();
					return false
				}
				if(txtT_terceiros.value == ""){
					alert("Preencha corretamente a 'Qtde. de terceiros'.")
					txtT_terceiros.focus();
					return false
				}
			}
		}
	}	
	return true
}