/*******************************************************************************
*		Críticas de formulário										 *
*******************************************************************************/

/*------------------------------------------------------------------------------
*	FUNÇÕES DE ONLOAD
*	CARREGA REGRAS PARA A INICIALIZAÇÃO
-------------------------------------------------------------------------------*/
/*
* @autor: Danielly Cruz
*/
function carregar(){
	document.getElementById("idDescricao").focus();
}


/*----------------------------------------------------------------------------------------
*	FUNÇÕES DE ONLOAD
*	CARREGA REGRAS PARA O ENVIO DO FORMULÁRIO
-----------------------------------------------------------------------------------------*/
/*
* @autor: Danielly Cruz
*/
function validar(){

        radioHabilitado = document.getElementById("idDescricao").disabled;

	descricao = trim(document.getElementById("idDescricao").value);

/*	if (descricao.length < 3){    */
	if ( (descricao.length < 3) && (radioHabilitado==false) ){

           alert('Por favor, digite uma descrição com no mínimo 3 caracteres.');
           return false;
	}

	return true;


/*	var tipoDocumento    = trim(frm.tipoDocumento.value);
	var numeroDocExterno = trim(frm.numeroDocExterno.value);
	var orgaoExterno     = trim(frm.orgaoExterno.value);
	var dataEntrada      = trim(frm.dataEntrada.value);
	var interessado      = trim(frm.interessado.value);
	var file             = trim(document.form2.arquivo.value);

	if (tipoDocumento == "0") {
	   	alert("Informe o tipo do documento.");
   		frm.tipoDocumento.focus();
   		return false;
  	}

	if (numeroDocExterno.length==0) {
	   	alert("Informe o número do documento externo.");
   		frm.numeroDocExterno.focus();
   		return false;
  	}

	if (orgaoExterno == "0") {
	   	//alert("Informe o órgão externo.");
   		frm.orgaoExterno.focus();
   		return false;
  	}

	if (dataEntrada.length==0) {
	   	alert("Data de Entrada Inválida.");
   		frm.dataEntrada.focus();
   		return false;
  	}

	//O ano alterado deve ser comparado com o inicial, campo "anoInicial"
	//por que não podera ser diferente
	if ( frm.anoInicial.value != dataEntrada.substr(6,4) ){
	   	alert("Data de Entrada Inválida.");
   		frm.dataEntrada.focus();
   		return false;
	}

	//Se retornar true é pq a data do despacho for menor que 01/01/1991
	//então será cancelado o envio.
	if ( comparaData(frm.dataEntrada.value, '<', '01/01/1991') ){
	   	alert("Data de Entrada Inválida.");
   		frm.dataEntrada.focus();
   		return false;
	}

	//Se retornar true é pq a data do despacho for maio que a data atual
	//então será cancelado o envio.
	if ( comparaData(frm.dataEntrada.value, '>', frm.dataHoje.value) ) {
	   	alert("Data de Entrada Inválida.");
   		frm.dataEntrada.focus();
   		return false;
	}


	if (interessado.length==0) {
	   	alert("Informe o interessado.");
   		frm.interessado.focus();
   		return false;
  	}

	return true;*/
}


/*----------------------------------------------------------------------------------------
* 	AUXILIAR
-----------------------------------------------------------------------------------------*/
function alterarPessoa(){
	document.getElementById("idForm1").action='/delta/alterarPessoaFisicaInicioAction.do';
	document.getElementById("idForm1").submit();
}


function excluirPessoa(){
	document.getElementById("idForm1").action='/delta/excluirPessoaFisicaAction.do';
	document.getElementById("idForm1").submit();
}


function adicionarDevedores(){
/*

  stringDevedores = document.forms[0].idCodigoDevedor;
  //stringDevedores = document.getElementById("idCodigoDevedor");
  qtdDevedoresConsultar = document.getElementById("idQtdDevedoresConsultar").value;
  if (qtdDevedoresConsultar != 0){
    if (qtdDevedoresConsultar == 1){
            devedor = stringDevedores.value.split("-");
            codigo = devedor[0];
            cpf = devedor[1];
            nome = devedor[2];
            opener.adicionar(codigo, cpf, nome, 'novo');
    }else{
      for (i=0; i< stringDevedores.length; i++){
         if (stringDevedores[i].checked){
            devedor = stringDevedores[i].value.split("-");
            codigo = devedor[0];
            cpf = devedor[1];
            nome = devedor[2];
            opener.adicionar(codigo, cpf, nome, 'novo');
         }
      }
    }
  }
  window.close();*/

}




