/*
		INTEGRATIVA - Internet Results	-	http:// www.integrativa.com.br 	: info@integrativa.com.br
		Ryan Ribeiro de Azevedo	-	tecnologia02@integrativa.com.br [Analista de Sistemas]
		Sebrae PB
		29.07.2004	
*/

/*
  Todos os java scripts que validam os formulários estão aqui!!!
*/ 

function valida_login() {

  if (!text_validate('formlogin','login','Usuário')) { 
   		return false;
  }
  
  if (!text_validate('formlogin','senha','Senha')) { 
   		return false;
  }
	return true;
}

function valida_esqueci() {

	if (!checkMail('formesqueci','email', 'E-MAIL')) { 
  		return false; 
  }
  return true;
}

function valida_contadores() {

  if (!text_validate('formcontadores','nome','Nome')) { 
   		return false;
  }
  
  if (!checkMail('formcontadores','email', 'E-MAIL')) { 
  		return false; 
  }
  
  if (!text_validate('formcontadores','mensagem','Currículo')) { 
   		return false;
  }

  if (!text_validate('formcontadores','endereco','Endereço')) { 
   		return false;
  }

  if (!text_validate('formcontadores','bairro','Bairro')) { 
   		return false;
  }

  if (!text_validate('formcontadores','cep','Cep')) { 
   		return false;
  }
  
  if (!text_validate('formcontadores','cidade','Cidade')) { 
   		return false;
  }

  if (!select_validate('formcontadores','estado','Estado')) { 
   		return false;
  }
 

  return true;
}

function valida_evento() {

  if (!text_validate('formeventos','titulo','Título do Evento')) { 
   		return false;
  }
  
  if (!select_validate('formeventos','tipo','Categoria')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','datai','Data de Inicio')){
   		return false;
  }
 
  if (!text_validate('formeventos','datae','Data Final')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','cidade','Cidade')) { 
   		return false;
  }

  if (!select_validate('formeventos','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','local','Local')) { 
   		return false;
  }
   
  if (!text_validate('formeventos','responsavel','Responsável')) { 
   		return false;
  }
  
  if (!checkMail('formeventos','email', 'E-MAIL')) { 
  		return false; 
  }

  if (!text_len_validate('formeventos','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formeventos','fone1','Telefone',7,9)){
   		return false;
  }

  if (!text_validate('formeventos','descricao','Descrição do Evento')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','valor','Valor da Inscrição')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','setor','Areá do Evento')) { 
   		return false;
  }
  
  if (!text_validate('formeventos','informacao','Informação')) { 
   		return false;
  }
  
/*  if (!text_validate('formeventos','site','Site')) { 
   		return false;
  }*/
  return true;
}

function valida_cadastro_pf() {

  if (!text_validate('formcadastropf','login','Login')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','senha','Senha')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','confirma','Confirmação da Senha')) { 
   		return false;
  }
  
  if (!text_equals_validate('formcadastropf','senha','confirma','Senha','Confirmação da senha')){
   		return false;
  }
  
  if (!text_validate('formcadastropf','nome','Nome')) { 
   		return false;
  }
  
  if (!text_len_validate('formcadastropf','cpf','CPF',11,14)) {
  		return false; 
	}
  
  if (!text_validate('formcadastropf','identidade','Identidade')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','endereco','Endereço')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','bairro','Bairro')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','cidade','Cidade')) { 
   		return false;
  }
  
  if (!select_validate('formcadastropf','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropf','cep','Cep')) { 
   		return false;
  }
  
  if (!checkMail('formcadastropf','email','Email')) { 
   		return false;
  }
  
  if (!text_len_validate('formcadastropf','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formcadastropf','fone1','Telefone',7,9)){
   		return false;
  }
  
  return true;
}

function valida_cadastro_pj() {

  if (!text_validate('formcadastropj','login','Login')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','senha','Senha')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','confirma','Confirmação da Senha')) { 
   		return false;
  }
  
  if (!text_equals_validate('formcadastropj','senha','confirma','Senha','Confirmação da senha')){
   		return false;
  }
  
  if (!text_validate('formcadastropj','nome','Razão Social')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','cnpj','CNPJ')) { 
   		return false;
  }
  
   if (!text_validate('formcadastropj','endereco','Endereço')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','bairro','Bairro')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','cidade','Cidade')) { 
   		return false;
  }
  
  if (!select_validate('formcadastropj','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formcadastropj','cep','Cep')) { 
   		return false;
  }
  
  if (!checkMail('formcadastropj','email','Email')) { 
   		return false;
  }
  
  if (!text_len_validate('formcadastropj','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formcadastropj','fone1','Telefone',7,9)){
   		return false;
  }
  
  return true;
}


function valida_contato() {

  if (!text_validate('formcontato','nome','Nome')) { 
   		return false;
  }
  
  if (!checkMail('formcontato','email', 'E-MAIL')) { 
  		return false; 
  }

  if (!text_len_validate('formcontato','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formcontato','telefone1','Telefone',7,9)){
   		return false;
  }

  if (!text_validate('formcontato','cidade','Cidade')) { 
   		return false;
  }

  if (!select_validate('formcontato','estado','Estado')) { 
   		return false;
  }
 
  if (!text_validate('formcontato','mensagem','Mensagem')) { 
   		return false;
  }
  return true;
}


function valida_treinamento() {

  if (!text_validate('formtreinamento','empresa','Empresa')) { 
   		return false;
  }
  
  if (!text_validate('formtreinamento','nome','Nome')) { 
   		return false;
  }
  
  if (!checkMail('formtreinamento','email','Email')) { 
   		return false;
  }
  
  if (!text_len_validate('formtreinamento','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formtreinamento','telefone1','Telefone',7,9)){
   		return false;
  }
  
  if (!text_validate('formtreinamento','cidade','Cidade')) { 
   		return false;
  }

  if (!select_validate('formtreinamento','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formtreinamento','mensagem','Mensagem')) { 
   		return false;
  }
  
  return true;
}

function valida_reserva() {

  if (!text_validate('formreserva','empresa','Empresa')) { 
   		return false;
  }
  
  if (!text_validate('formreserva','nome','Nome')) { 
   		return false;
  }
  
  if (!checkMail('formreserva','email','Email')) { 
   		return false;
  }
  
  if (!text_len_validate('formreserva','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formreserva','telefone1','Telefone',7,9)){
   		return false;
  }
  
  if (!text_validate('formreserva','cidade','Cidade')) { 
   		return false;
  }

  if (!select_validate('formreserva','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formreserva','curso','Curso')) { 
   		return false;
  }
 
  if (!text_validate('formreserva','participantes','Participantes')) { 
   		return false;
  }
 
  if (!text_validate('formreserva','localevento','localevento')) { 
   		return false;
  }
  
  return true;
}

function valida_fornecedores() {

  if (!text_validate('formfornecedores','empresa','Empresa')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','login','Login')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','senha','Senha')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','confirma','Confirmação da Senha')) { 
   		return false;
  }
  
  if (!text_equals_validate('formfornecedores','senha','confirma','Senha','Confirmação da senha')){
   		return false;
  }
  
  if (!text_validate('formfornecedores','responsavel','Responsavel')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','prodserv','Produto ou Serviço')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','endereco','Endereço')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','bairro','Bairro')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','cidade','Cidade')) { 
   		return false;
  }
  
  if (!select_validate('formfornecedores','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formfornecedores','cep','Cep')) { 
   		return false;
  }
  
  if (!text_len_validate('formfornecedores','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formfornecedores','fone1','Telefone',7,9)){
   		return false;
  }
  
  if (!checkMail('formfornecedores','email','Email')) { 
   		return false;
  }
  
  return true;
}






function valida_anuncie() {
  
  if (!text_validate('formanuncie','cnpjcpf','CNPJ OU CPF')) { 
   		return false;
  }

  if (!text_validate('formanuncie','nomerazao','Nome ou Razão Social')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','nomefantasia','Nome Fantasia')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','endereco','Endereço')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','bairro','Bairro')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','cidade','Cidade')) { 
   		return false;
  }
  
  if (!select_validate('formanuncie','estado','Estado')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','cep','Cep')) { 
   		return false;
  }
  
  if (!checkMail('formanuncie','email','Email')) { 
   		return false;
  }
  
  if (!text_len_validate('formanuncie','ddd1','DDD',2,2)){
   		return false;
  }

  if (!text_len_validate('formanuncie','fone1','Telefone',7,9)){
   		return false;
  }
  
  if (!text_validate('formanuncie','nome1','Nome')) { 
   		return false;
  }
  
   if (!text_validate('formanuncie','cargo1','Cargo')) { 
   		return false;
  }
  
  if (!checkMail('formanuncie','email1','Email')) { 
   		return false;
  }
  
  if (!select_validate('formanuncie','area','Area')) { 
   		return false;
  }
  
  if (!select_validate('formanuncie','setor','Setor')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','principais','Principais Produtos')) { 
   		return false;
  }
  
  if (!text_validate('formanuncie','descricao','Descrição do Anúncio')) {  
   		return false;
  }
  
  return true;  
}

function enviar_upload() {
	if(upload.document.formupload.foto.value=="") {
		enviarfinal();
	}
	else {
		if (navigator.appName == "Netscape") { document.upload.formupload.submit(); }
		else { upload.document.forms["formupload"].submit(); }
	}
}

function enviarfinal() {
	  if (navigator.appName == "Netscape") top.document.formcontadores.submit();
	  else top.document.forms["formcontadores"].submit(); 
}
