
/*
 * DIREITOS AUTORAIS RESERVADOS (C) 2007 UFRJ
 * 
 * ESTE PROGRAMA É SOFTWARE LIVRE; VOCÊ PODE REDISTRIBUÍ-LO E/OU MODIFICÁ-LO SOB OS
 * TERMOS DA LICENÇA PÚBLICA GERAL GNU CONFORME PUBLICADA PELA FREE SOFTWARE FOUNDATION;
 * TANTO A VERSÃO 2 DA LICENÇA, COMO (A SEU CRITÉRIO) QUALQUER VERSÃO POSTERIOR.

 * ESTE PROGRAMA É DISTRIBUÍDO NA EXPECTATIVA DE QUE SEJA ÚTIL, PORÉM, SEM NENHUMA GARANTIA;
 * NEM MESMO A GARANTIA IMPLÍCITA DE COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA.
 * CONSULTE A LICENÇA PÚBLICA GERAL DO GNU PARA MAIS DETALHES.
 * 
 * VOCÊ DEVE TER RECEBIDO UMA CÓPIA DA LICENÇA PÚBLICA GERAL DO GNU JUNTO COM ESTE PROGRAMA; 
 * SE NÃO, ACESSE <<HTTP://WWW.GNU.ORG/LICENSES/LICENSES.PT-BR.HTML>>
 */

/* FUN��O PARA DESABILITAR OS CAMPOS DE DOCUMENTOS QUANDO A PESSOA MARCAR A OPCAO 'SEM DOCUMENTOS' */
function disableFatherMother(nCheck,nRadio,nText2,nRadio2,nRadio3,nRadio4,nText3,
		nRadio5,nRadio6,nRadio7,nText4,nSelect,nText5,nSelect2,nRadio8,nRadio9,
		nRadio10,nText6,nText7,nSelect3,nText8,nRadio11,nRadio12,nRadio13,
		nText9,nText10,nRadio14,nRadio15,nRadio16,nText11,nRadio17,nRadio18,
		nRadio19,nSelect4,nText12,nText13,nText14,nText15,nText16,nRadio20,
		nRadio21,nRadio22,nText17,nRadio23,nRadio24,nData1,nData2,nData3)
{
	if (document.getElementById(nCheck).checked == true)
	{
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = true;
		document.getElementById(nText4).value = '';
		document.getElementById(nText4).disabled = true;
		document.getElementById(nText5).value = '';
		document.getElementById(nText5).disabled = true;
		document.getElementById(nText6).value = '';
		document.getElementById(nText6).disabled = true;
		document.getElementById(nText7).value = '';
		document.getElementById(nText7).disabled = true;
		document.getElementById(nText8).value = '';
		document.getElementById(nText8).disabled = true;
		document.getElementById(nText9).value = '';
		document.getElementById(nText9).disabled = true;
		document.getElementById(nText10).value = '';
		document.getElementById(nText10).disabled = true;
		document.getElementById(nText11).value = '';
		document.getElementById(nText11).disabled = true;
		document.getElementById(nText12).value = '';
		document.getElementById(nText12).disabled = true;
		document.getElementById(nText13).value = '';
		document.getElementById(nText13).disabled = true;
		document.getElementById(nText14).value = '';
		document.getElementById(nText14).disabled = true;
		document.getElementById(nText15).value = '';
		document.getElementById(nText15).disabled = true;
		document.getElementById(nText16).value = '';
		document.getElementById(nText16).disabled = true;
		document.getElementById(nText17).value = '';
		document.getElementById(nText17).disabled = true;
		
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = true;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect2).disabled = true;
		document.getElementById(nSelect3).value = '';
		document.getElementById(nSelect3).disabled = true;		
		
		document.getElementById(nData1).style.display = 'none';
		document.getElementById(nData2).style.display = 'none';
		document.getElementById(nData3).style.display = 'none';
		
		cleanAndDisableAllBoxes(nRadio);
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
		cleanAndDisableAllBoxes(nRadio4);
		cleanAndDisableAllBoxes(nRadio5);
		cleanAndDisableAllBoxes(nRadio6);
		cleanAndDisableAllBoxes(nRadio7);
		cleanAndDisableAllBoxes(nRadio8);
		cleanAndDisableAllBoxes(nRadio9);
		cleanAndDisableAllBoxes(nRadio10);
		cleanAndDisableAllBoxes(nRadio11);
		cleanAndDisableAllBoxes(nRadio12);
		cleanAndDisableAllBoxes(nRadio13);
		cleanAndDisableAllBoxes(nRadio14);
		cleanAndDisableAllBoxes(nRadio15);
		cleanAndDisableAllBoxes(nRadio16);
		cleanAndDisableAllBoxes(nRadio17);
		cleanAndDisableAllBoxes(nRadio18);
		cleanAndDisableAllBoxes(nRadio19);
		cleanAndDisableAllBoxes(nRadio20);
		cleanAndDisableAllBoxes(nRadio21);
		cleanAndDisableAllBoxes(nRadio22);
		cleanAndDisableAllBoxes(nRadio23);
		cleanAndDisableAllBoxes(nRadio24);
	}
	else
	{
		document.getElementById(nText2).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText3).disabled = false;
		document.getElementById(nText3).value = '';
		document.getElementById(nText4).disabled = false;
		document.getElementById(nText4).value = '';
		document.getElementById(nText5).disabled = false;
		document.getElementById(nText5).value = '';
		document.getElementById(nText6).disabled = false;
		document.getElementById(nText6).value = '';
		document.getElementById(nText7).disabled = false;
		document.getElementById(nText7).value = '';
		document.getElementById(nText8).disabled = false;
		document.getElementById(nText8).value = '';
		document.getElementById(nText9).disabled = false;
		document.getElementById(nText9).value = '';
		document.getElementById(nText10).disabled = false;
		document.getElementById(nText10).value = '';
		document.getElementById(nText11).disabled = false;
		document.getElementById(nText11).value = '';
		document.getElementById(nText12).disabled = false;
		document.getElementById(nText12).value = '';
		document.getElementById(nText13).disabled = false;
		document.getElementById(nText13).value = '';
		document.getElementById(nText14).disabled = false;
		document.getElementById(nText14).value = '';
		document.getElementById(nText15).disabled = false;
		document.getElementById(nText15).value = '';
		document.getElementById(nText16).disabled = false;
		document.getElementById(nText16).value = '';
		document.getElementById(nText17).disabled = false;
		document.getElementById(nText17).value = '';
		
		document.getElementById(nSelect).disabled = false;
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect2).disabled = false;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect3).disabled = false;
		document.getElementById(nSelect3).value = '';
		//document.getElementById(nSelect4).disabled = false;
		//document.getElementById(nSelect4).value = '';
		
		document.getElementById(nData1).style.display = 'inline';
		document.getElementById(nData2).style.display = 'inline';
		document.getElementById(nData3).style.display = 'inline';

		enableAllSetValue(nRadio,'');
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
		enableAllSetValue(nRadio4,'');
		enableAllSetValue(nRadio5,'');
		enableAllSetValue(nRadio6,'');
		enableAllSetValue(nRadio7,'');
		enableAllSetValue(nRadio8,'');
		enableAllSetValue(nRadio9,'');
		enableAllSetValue(nRadio10,'');
		enableAllSetValue(nRadio11,'');
		enableAllSetValue(nRadio12,'');
		enableAllSetValue(nRadio13,'');
		enableAllSetValue(nRadio14,'');
		enableAllSetValue(nRadio15,'');
		enableAllSetValue(nRadio16,'');
		enableAllSetValue(nRadio17,'');
		enableAllSetValue(nRadio18,'');
		enableAllSetValue(nRadio19,'');
		enableAllSetValue(nRadio20,'');
		enableAllSetValue(nRadio21,'');
		enableAllSetValue(nRadio22,'');
		enableAllSetValue(nRadio23,'');
		enableAllSetValue(nRadio24,'');
	}
}
/* --------------------END----------------- */

/* CASO A PESSOA MARCAR QUE NAO TEM ALGUM DOCUMENTO, ESTAS FUNCOES DESABILITAR�O OS MESMOS */
function disableCamposDocs(nRadio,nText,nRadio2,nRadio3) {
	
	if(nRadio == 'N') {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
	}
	else {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
	}	
}

function disableRG(nRadio,nText,nSelect,nText2,nSelect2,nRadio2,nRadio3) {
	
	if(nRadio == 'N'){
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = true;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect2).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
	}
	else {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = false;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect2).disabled = false;
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
	}	
}

function disableCarteira(nRadio,nText,nText2,nSelect,nText3,nRadio2,nRadio3) {
	
	if(nRadio == 'N'){
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = true;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
	}
	else {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = false;
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = false;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = false;
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
	}
}

function disableEleitor(nRadio,nText,nText2,nText3,nRadio2,nRadio3) {
	
	if(nRadio == 'N'){
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
	}
	else {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = false;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = false;
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
	}
}

function disableCertidao(nRadio,nSelect,nText,nText2,nText3,nText4,nText5,nRadio2,nRadio3) {
	
	if(nRadio == 'N'){
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = true;
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = true;
		document.getElementById(nText4).value = '';
		document.getElementById(nText4).disabled = true;
		document.getElementById(nText5).value = '';
		document.getElementById(nText5).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio3);
	}
	else {
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = false;
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = false;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = false;
		document.getElementById(nText4).value = '';
		document.getElementById(nText4).disabled = false;
		document.getElementById(nText5).value = '';
		document.getElementById(nText5).disabled = false;
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
	}
}

function disableEscola(nRadio,nRadio0,nSelect,nText,nText2,nText3,nRadio2,nRadio3,nRadio4,nRadio5,nRadio6,nRadio7,nRadio8,nSelect1,nSelect2) {
	
		
		if(nRadio == 1){
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = true;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = true;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = true;
		cleanAndDisableAllBoxes(nRadio2);
		cleanAndDisableAllBoxes(nRadio0);
		cleanAndDisableAllBoxes(nRadio3);
		cleanAndDisableAllBoxes(nRadio4);
		cleanAndDisableAllBoxes(nRadio5);
		cleanAndDisableAllBoxes(nRadio6);
		cleanAndDisableAllBoxes(nRadio7);
		cleanAndDisableAllBoxes(nRadio8);
		cleanAndDisableAllBoxes(nSelect);
		document.getElementById(nRadio0).disabled = true;
		document.getElementById(nSelect1).disabled = true;
		document.getElementById(nSelect2).disabled = true;
	}
	else {
		document.getElementById(nText).value = '';
		document.getElementById(nText).disabled = false;
		document.getElementById(nText2).value = '';
		document.getElementById(nText2).disabled = false;
		document.getElementById(nText3).value = '';
		document.getElementById(nText3).disabled = false;
		enableAllSetValue(nRadio0,'');
		enableAllSetValue(nRadio2,'');
		enableAllSetValue(nRadio3,'');
		enableAllSetValue(nRadio4,'');
		enableAllSetValue(nRadio5,'');
		enableAllSetValue(nRadio6,'');
		enableAllSetValue(nRadio7,'');
		enableAllSetValue(nRadio8,'');
		document.getElementById(nRadio0).disabled = false;
		document.getElementById(nSelect1).disabled = false;
		document.getElementById(nSelect2).disabled = false;
	}
}
function checkEstrangeiro (nRadio, nSelect, nSelect2) {
	if(nRadio == "2" || nRadio == "3") {
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = true;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect2).disabled = true;
	}
	else {
		document.getElementById(nSelect).value = '';
		document.getElementById(nSelect).disabled = false;
		document.getElementById(nSelect2).value = '';
		document.getElementById(nSelect2).disabled = false;
	}
}