function valida_profissional(){var tipoPessoa=$('tipoPessoa').value;var txtNome=$('txtNome').value;var cpfCnpj=$('cpfCnpj').value;var txtEndereco=$('txtEndereco').value;var txtNro=$('txtNro').value;var txtCidade=$('txtCidade').value;var txtEstado=$('txtEstado').value;var txtCep1=$('txtCep1').value;var txtCep2=$('txtCep2').value;var txtDdd1=$('txtDdd1').value;var txtFone1=$('txtFone1').value;var guiaEmail=$('guiaEmail').value;var txtCategoria=$('txtCategoria').value;var txtDescricao=$('txtDescricao').value;var txtChaves=$('txtChaves').value;var guiaLogin=$('guiaLogin').value;var guiaSenha=$('guiaSenha').value;var txtConfirma=$('txtConfirma').value;if(tipoPessoa==""){alert('Por favor, preencha o campo: Pessoa!');$('tipoPessoa').focus();return false}if(txtNome==""){alert('Por favor, preencha o campo: Nome!');$('txtNome').focus();return false}if(cpfCnpj==""){alert('Por favor, preencha o campo: CPF/CNPJ!');$('cpfCnpj').focus();return false}if(txtEndereco==""){alert('Por favor, preencha o campo: Endereço!');$('txtEndereco').focus();return false}if(txtNro==""){alert('Por favor, preencha o campo: Número!');$('txtNro').focus();return false}if(txtCidade==""){alert('Por favor, preencha o campo: Cidade!');$('txtCidade').focus();return false}if(txtEstado==""){alert('Por favor, preencha o campo: Estado!');$('txtEstado').focus();return false}if(txtCep1==""){alert('Por favor, preencha corretamente o campo: CEP!');$('txtCep1').focus();return false}else{if(txtCep2==""){alert('Por favor, preencha corretamente o campo: CEP!');$('txtCep2').focus();return false}}if(txtDdd1==""){alert('Por favor, preencha campo: Telefone 1!');$('txtDdd1').focus();return false}else{if(txtFone1==""){alert('Por favor, preencha o campo: Telefone 1!');$('txtFone1').focus();return false}}if(guiaEmail==""){alert('Por favor, preencha o campo: E-mail!');$('guiaEmail').focus();return false}else{if(!valida_email(guiaEmail)){return false}}if(txtCategoria==""){alert('Por favor, preencha o campo: Categoria!');$('txtCategoria').focus();return false}if(txtCategoria==""){alert('Por favor, preencha o campo: Categoria!');$('txtCategoria').focus();return false}if(txtDescricao==""){alert('Por favor, preencha o campo: Descrição!');$('txtDescricao').focus();return false}if(txtChaves==""){alert('Por favor, preencha o campo: Palavras-chave!');$('txtChaves').focus();return false}if(guiaLogin==""){alert('Por favor, preencha o campo: Login!');$('guiaLogin').focus();return false}if(guiaSenha==""){alert('Por favor, preencha o campo: Senha!');$('guiaSenha').focus();return false}else if((guiaSenha.length<6)||(guiaSenha!=txtConfirma)){alert('Senha menor que o permitido, (6 digitos) ou elas não correspondem!');$('guiaSenha').focus();return false}return true}function valida_gratis(){var tipoPessoa=$('tipoPessoa').value;var txtNome=$('txtNome').value;var cpfCnpj=$('cpfCnpj').value;var txtEndereco=$('txtEndereco').value;var txtNro=$('txtNro').value;var txtCidade=$('txtCidade').value;var txtEstado=$('txtEstado').value;var txtCep1=$('txtCep1').value;var txtCep2=$('txtCep2').value;var txtDdd1=$('txtDdd1').value;var txtFone1=$('txtFone1').value;var guiaEmail=$('guiaEmail').value;var txtCategoria=$('txtCategoria').value;var guiaLogin=$('guiaLogin').value;var guiaSenha=$('guiaSenha').value;var txtConfirma=$('txtConfirma').value;if(tipoPessoa==""){alert('Por favor, preencha o campo: Pessoa!');$('tipoPessoa').focus();return false}if(txtNome==""){alert('Por favor, preencha o campo: Nome!');$('txtNome').focus();return false}if(cpfCnpj==""){alert('Por favor, preencha o campo: CPF/CNPJ!');$('cpfCnpj').focus();return false}if(txtEndereco==""){alert('Por favor, preencha o campo: Endereço!');$('txtEndereco').focus();return false}if(txtNro==""){alert('Por favor, preencha o campo: Número!');$('txtNro').focus();return false}if(txtCidade==""){alert('Por favor, preencha o campo: Cidade!');$('txtCidade').focus();return false}if(txtEstado==""){alert('Por favor, preencha o campo: Estado!');$('txtEstado').focus();return false}if(txtCep1==""){alert('Por favor, preencha corretamente o campo: CEP!');$('txtCep1').focus();return false}else{if(txtCep2==""){alert('Por favor, preencha corretamente o campo: CEP!');$('txtCep2').focus();return false}}if(txtDdd1==""){alert('Por favor, preencha campo: Telefone 1!');$('txtDdd1').focus();return false}else{if(txtFone1==""){alert('Por favor, preencha o campo: Telefone 1!');$('txtFone1').focus();return false}}if(guiaEmail==""){alert('Por favor, preencha o campo: E-mail!');$('guiaEmail').focus();return false}else{if(!valida_email(guiaEmail)){return false}}if(txtCategoria==""){alert('Por favor, preencha o campo: Categoria!');$('txtCategoria').focus();return false}if(txtCategoria==""){alert('Por favor, preencha o campo: Categoria!');$('txtCategoria').focus();return false}if(guiaLogin==""){alert('Por favor, preencha o campo: Login!');$('guiaLogin').focus();return false}if(guiaSenha==""){alert('Por favor, preencha o campo: Senha!');$('guiaSenha').focus();return false}else if((guiaSenha.length<6)||(guiaSenha!=txtConfirma)){alert('Senha menor que o permitido, (6 digitos) ou elas não correspondem!');$('guiaSenha').focus();return false}return true}function caracteres(campo,car,nro){var intCaracteres=nro-$(campo).value.length;if(intCaracteres>0){$(car).value=intCaracteres;return true}else{$(car).value=0;$(campo).value=$(campo).value.substr(0,nro);return false}}function verificar_nome(nome){var oXMLHttp=new ajax();oXMLHttp.open("GET","ajax/guia.php?opt=verificar_nome&nome="+$(nome).value,true);oXMLHttp.onreadystatechange=function(){if(oXMLHttp.readyState==4){if(oXMLHttp.status==200){if(oXMLHttp.responseText){alert('Este Nome/Razão Social já foi cadastrado');$(nome).value="";$(nome).focus()}}}};oXMLHttp.send(null);return false}function verificar_cpf_cnpj(nome){var oXMLHttp=new ajax();oXMLHttp.open("GET","ajax/guia.php?opt=verificar_cpf_cnpj&nome="+$(nome).value,true);oXMLHttp.onreadystatechange=function(){if(oXMLHttp.readyState==4){if(oXMLHttp.status==200){if(oXMLHttp.responseText){alert('Este CPF/CNPJ já foi cadastrado');$(nome).value="";$(nome).focus()}}}};oXMLHttp.send(null);return false}function verificar_email(nome){var oXMLHttp=new ajax();oXMLHttp.open("GET","ajax/guia.php?opt=verificar_email&nome="+$(nome).value,true);oXMLHttp.onreadystatechange=function(){if(oXMLHttp.readyState==4){if(oXMLHttp.status==200){if(oXMLHttp.responseText){alert('Este E-mail já foi cadastrado');$(nome).value="";$(nome).focus()}}}};oXMLHttp.send(null);return false}function verificar_login(nome){var oXMLHttp=new ajax();oXMLHttp.open("GET","ajax/guia.php?opt=verificar_login&nome="+$(nome).value,true);oXMLHttp.onreadystatechange=function(){if(oXMLHttp.readyState==4){if(oXMLHttp.status==200){if(oXMLHttp.responseText){alert('Este Login de acesso já foi cadastrado');$(nome).value="";$(nome).focus()}}}};oXMLHttp.send(null);return false}
