
function verificaDados(){
	
	var razaosocial = document.formContato.razaosocial.value;
	var cnpj        = document.formContato.cnpj.value;
	var endereco    = document.formContato.endereco.value;
	var cidade      = document.formContato.cidade.value;
	var ramo        = document.formContato.ramo.value;
	var nfunc       = document.formContato.nfunc.value;
	var area        = document.formContato.area.value;
	var contatos    = document.formContato.contatos.value;
	var tellfone    = document.formContato.tellfone.value;
	var mail        = document.formContato.mail.value;
	
	  
	  if(razaosocial == "" || 
		 cnpj == "" ||
		 endereco == "" || 
		 cidade == "" || 
		 ramo == "" || 
		 nfunc == "" || 
		 area == "" ||
		 contatos == "" || 
		 tellfone == "" || 
		 mail == ""){
		  document.getElementById("cp_warning").innerHTML = 'Existem campos n&atilde;o preenchidos. Para continuar &eacute; necess&aacute;rio preench&ecirc;-los.';
		  parent.location = '#empty'
		  return false;
	  }else{
		  document.getElementById("cp_warning").innerHTML = "";
		  
	  }
	  
	  return true;
	  
  }
  
/* function documentosLegais(form){

var ok = false;
var form = document.getElementsByName("doclegal");

for (i = 0; i < form.length; i++){
    if (form[i].checked) {
        ok = true;
    }
}
if (!ok) {
    document.getElementById("cp_doclegal").innerHTML = '&nbsp;* Assinale uma op&ccedil;&atilde;o';
	parent.location = '#doclegal'
    return false;
    }else{
		document.getElementById("cp_doclegal").innerHTML = "";	
		return true;	
	}

}*/

function campoOutro(){
	
		if(document.formContato.outros.checked){
			
			if(document.getElementById("outros_abre").value == ""){
				document.getElementById("cp_outros").innerHTML = '&nbsp;* Se a op&ccedil;&atilde;o OUTROS estiver selecionada, o campo deve ser preenchido';
				parent.location = '#agambientais'
			}else{
				return true;	
			}
			return false;
		}else{
			document.getElementById("cp_outros").innerHTML = '';
			return true;
		}
			
			document.getElementById("cp_outros").innerHTML = '&nbsp;* Se a op&ccedil;&atilde;o OUTROS estiver selecionada, o campo deve ser preenchido';
			parent.location = '#agambientais'
		
}

function campoAnother(){
	
		if(document.formContato.anothers.checked){
			
			if(document.getElementById("open").value == ""){
				document.getElementById("cp_anothers").innerHTML = '&nbsp;* Se a op&ccedil;&atilde;o OUTROS estiver selecionada, o campo deve ser preenchido';
				parent.location = '#treinamentos'
			}else{
				return true;	
			}
			return false;
		}else{
			document.getElementById("cp_anothers").innerHTML = '';
			return true;
		}
			
			document.getElementById("cp_anothers").innerHTML = '&nbsp;* Se a op&ccedil;&atilde;o OUTROS estiver selecionada, o campo deve ser preenchido';
			parent.location = '#treinamentos'
		
}
  
  
function verificaCampos(){
	if((verificaDados(document.getElementById("formContato")) && 
		campoOutro(document.getElementById("formContato")) && 
		campoAnother(document.getElementById("formContato")))){
			
		document.getElementById("formContato").action = "App_Code/enviar-prop.php";
		document.getElementById("formContato").submit();
		
	}else{
		
		
	}
}

