function verificaCadastro(){
	
	function alertaCampo(nomeCampo, textoAlerta){
	
		//document.getElementById(nomeCampo).style.backgroundColor = "#FFFF99";
		document.getElementById("alertaCadastroTOP").style.display = "block";		
		document.getElementById("alertaCadastroTOP").innerHTML = textoAlerta;
		document.getElementById("alertaCadastroBOTTOM").style.display = "block";		
		document.getElementById("alertaCadastroBOTTOM").innerHTML = textoAlerta;
		document.getElementById(nomeCampo).focus();
	
	}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


	function check_date(date) {
   var err = 0
   string = date
   var valid = "0123456789/"
   var ok = "yes";
   var temp;
   for (var i=0; i< string.length; i++) {
     temp = "" + string.substring(i, i+1);
     if (valid.indexOf(temp) == "-1") err = 1;
   }
   if (string.length != 10) err=1
   b = string.substring(3, 5)		// month
   c = string.substring(2, 3)		// '/'
   d = string.substring(0, 2)		// day 
   e = string.substring(5, 6)		// '/'
   f = string.substring(6, 10)	// year
   if (b<1 || b>12) err = 1
   if (c != '/') err = 1
   if (d<1 || d>31) err = 1
   if (e != '/') err = 1
   if (f<1850 || f>2050) err = 1
   if (b==4 || b==6 || b==9 || b==11){
     if (d==31) err=1
   }
   if (b==2){
     var g=parseInt(f/4)
     if (isNaN(g)) {
         err=1 
     }
     if (d>29) err=1
     if (d==29 && ((f/4)!=parseInt(f/4))) err=1
   }
   if (err==1) {
   	//alert("Data invÃ¡lida");
    return false;
   }
  	else {
   	//alert("Data correta");
    return true;
   }
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	if(document.getElementById("login").value == ""){
	
		alertaCampo('login', 'Campo LOGIN estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha").value == ""){
	
		alertaCampo('senha', 'Campo SENHA estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha2").value == ""){
	
		alertaCampo('senha2', 'Campo REPETE SENHA estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha").value != document.getElementById("senha2").value){
	
		alertaCampo('senha', 'Campo SENHA e REPETE SENHA tem que ser iguais');
		return false;
	
	}else if(document.getElementById("nome").value == ""){
	
		alertaCampo('nome', 'Campo NOME estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("endereco").value == ""){
	
		alertaCampo('endereco', 'Campo ENDEREÃ‡O vazio');
		return false;
	
	}else if(document.getElementById("bairro").value == ""){
	
		alertaCampo('bairro', 'Campo BAIRRO estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("cidade").value == ""){
	
		alertaCampo('cidade', 'Campo CIDADE estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("estado").value == ""){
	
		alertaCampo('estado', 'Campo ESTADO estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("nascimento").value == ""){
	
		alertaCampo('nascimento', 'Campo DATA DE NASCIMENTO estÃ¡ vazio');
		return false;
	
	}else if(check_date(document.getElementById("nascimento").value) == false){
		
		alertaCampo('nascimento', 'DATA DE NASCIMENTO invÃ¡lido. Ex: 99/99/9999');
		return false;
	
	}else if(document.getElementById("ddd").value == ""){
	
		alertaCampo('ddd', 'Campo TELEFONE estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("tel").value == ""){
	
		alertaCampo('tel', 'Campo TELEFONE estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("email").value == ""){
	
		alertaCampo('email', 'Campo E-MAIL estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("interesse").value == ""){
	
		alertaCampo('interesse', 'Campo Ã?RA DE INTERESSE estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("ferram").value == ""){
	
		alertaCampo('ferram', 'Campo CONHECE ALGUMA FERRAMENTA ECALC estÃ¡ vazio');
		return false;
	
	}

}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function verificaCadastroEmpresa(){
	
	function alertaCampo(nomeCampo, textoAlerta){
	
		//document.getElementById(nomeCampo).style.backgroundColor = "#FFFF99";
		document.getElementById("alertaCadastroTOP").style.display = "block";		
		document.getElementById("alertaCadastroTOP").innerHTML = textoAlerta;
		document.getElementById("alertaCadastroBOTTOM").style.display = "block";		
		document.getElementById("alertaCadastroBOTTOM").innerHTML = textoAlerta;
		document.getElementById(nomeCampo).focus();
	
	}
	
	if(document.getElementById("login").value == ""){
	
		alertaCampo('login', 'Campo LOGIN estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha").value == ""){
	
		alertaCampo('senha', 'Campo SENHA estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha2").value == ""){
	
		alertaCampo('senha2', 'Campo REPETE SENHA estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("senha").value != document.getElementById("senha2").value){
	
		alertaCampo('senha', 'Campo SENHA e REPETE SENHA tem que ser iguais');
		return false;
	
	}else if(document.getElementById("nome").value == ""){
	
		alertaCampo('nome', 'Campo NOME estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("razaoSocial").value == ""){
	
		alertaCampo('razaoSocial', 'Campo RAZ&Atilde;O SOCIAL vazio');
		return false;
	
	}else if(document.getElementById("cnpj").value == ""){
	
		alertaCampo('cnpj', 'Campo CNPJ estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("nomeUsuario").value == ""){
	
		alertaCampo('nomeUsuario', 'Campo NOME DO USU&Aacute;RIO estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("cargoUsuario").value == ""){
	
		alertaCampo('cargoUsuario', 'Campo CARGO DO USU&Aacute;RIO estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("cidade").value == ""){
	
		alertaCampo('cidade', 'Campo CIDADE estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("estado").value == ""){
	
		alertaCampo('estado', 'Campo ESTADO estÃ¡ vazio');
		return false;
	
	}else if(document.getElementById("email").value == ""){
	
		alertaCampo('email', 'Campo E-MAIL estÃ¡ vazio');
		return false;
	
	}

}