function n_home(w) {
var pgm = new Array("n_abfm_associese.asp","n_home_fm.asp","","","n_abfm_diretoria.asp")

if (w < 3) {
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();}
if (w == 3) {
windowqt = window.open("http://mail.abfm.org.br:2095", "Arquivo","toolbar=yes,location=no,status=yes,screenX=1,screenY=1,menubar=yes, resizable=yes,scrollbars=yes");
}

if (w == 4) {
windowqt = window.open("doctos/OrientacoesEmail2.pdf", "Arquivo","toolbar=yes,location=no,status=yes,screenX=1,screenY=1,menubar=yes, resizable=yes,scrollbars=yes");
}

}

function n_abfm(w) {
var pgm = new Array("n_abfm_missao.asp","n_abfm_atividades.asp","n_abfm_coorporativas.asp","n_abfm_historico.asp","n_abfm_diretoria.asp","n_abfm_ex_diretoria.asp","n_abfm_estatuto.asp","n_abfm_cad_inst.asp","n_abfm_anuidade.asp")
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_socios(w) {
var pgm = new Array("n_socios_aniversario.asp","n_socios_atas.asp","","","","n_socios_carteira.asp","n_socios_fale_esp.asp","n_socios_portarias.asp","n_socios_mercado.asp","n_socios_fotos.asp")
if (w == 2) {
windowqt = window.open("n_socios_cadastro.asp" , "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778, resizable=yes,scrollbars=yes");

return;	
	}
if (w == 3) {
windowqt = window.open("n_socios_busca.asp" , "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=620,height=400, resizable=yes,scrollbars=yes");
windowqt.focus();
return;		}
if (w == 4) {
windowqt = window.open("n_socios_debitos.asp" , "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=625, resizable=yes,scrollbars=yes");
windowqt.focus();
return;	
	}	
if (w == 9) {
windowqt = window.open("n_socios_fotos.asp" , "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no, resizable=yes,scrollbars=yes");
windowqt.focus();
return;	
	}	
if (w == 5) {
windowqt = window.open("n_socios_revalida.asp" , "Arquivo","toolbar=yes,location=no,status=no,screenX=1,screenY=1,menubar=no,width=625, resizable=yes,scrollbars=yes");
windowqt.focus();
return;	
	}	
document.getElementById("envio").action = pgm[w];
document.getElementById("envio").submit();

}
function n_prova(w) {
var pgm = new Array("n_prova_titulo.asp","n_prova_regulamento.asp","n_prova_provageral.asp","n_prova_radioterapia.asp","n_prova_radiodiagnostico.asp","n_prova_medicina.asp","n_prova_faq.asp","n_prova_ficha_inscricao.asp")
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_especialista(w) {
var pgm = new Array("n_especialistas.asp")
  document.getElementById("envio").cpo.value = w
  document.getElementById("envio").action = pgm[0];
  document.getElementById("envio").submit();

}
function n_publicacoes(w) {
var pgm = new Array("n_publicacoes_tipo.asp","n_publicacoes_nucleo.asp")
  document.getElementById("envio").cpo.value = ""
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_links(w) {
  document.getElementById("envio").cpo.value = w
  document.getElementById("envio").action = "n_links.asp";
  document.getElementById("envio").submit();

}
function n_eventos(w) {
var pgm = new Array("n_eventos.asp","n_eventos_anteriores.asp")
  document.getElementById("envio").cpo.value = ""
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_contato(w) {
var pgm = new Array("n_contato.asp","n_contato_correio.asp")
  document.getElementById("envio").cpo.value = ""
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_controle(w) {
//var pgm = new Array("n_controle_cad_socios.asp","n_controle_rel_socios.asp","","","n_controle_cad_not.asp","n_controle_cad_abfmnews.asp","n_controle_cad_evt.asp","n_controle_cad_cur.asp","n_controle_cad_lnk.asp","n_controle_cad_enquetes.asp","n_controle_cad_adm.asp")
var pgm = new Array("","n_controle_rel_socios.asp","","","n_controle_cad_not.asp","n_controle_cad_abfmnews.asp","n_controle_cad_evt.asp","n_controle_cad_cur.asp","n_controle_cad_lnk.asp","n_controle_cad_enquetes.asp","n_controle_cad_adm.asp")
  document.getElementById("envio").cpo.value = ""
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();

}
function n_publicacoes_abfmnews(w) {
  document.getElementById("envio").cpo.value = w;
  document.getElementById("envio").action = "n_publicacoes_tipo.asp";
  if (w == 13){ 
  document.getElementById("envio").action = "n_publicacoes_abfmnews.asp";  
  } 	
  document.getElementById("envio").submit();
}  
function n_publicacoes_abfmnews_detalhar(w) { 
windowqt = window.open("n_publicacoes_abfmnews_detalhar.asp?cpo="+w, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778,height=500, resizable=yes,scrollbars=yes");
//windowqt.focus();
}
function n_publicacoes_abfmnews_noticias(w) { 
windowqt = window.open("abfm_news_not.asp?wnot="+w, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=500,height=300, resizable=yes,scrollbars=yes");
//windowqt.focus();
}


// utilizado para submeter paginas do abfmnews
function n_publicacoes_paginar(w,y){ 
  document.getElementById("envio").cpo.value = w;
   document.getElementById("envio").cpo1.value = y;
   document.getElementById("envio").action = "n_publicacoes.asp";
  document.getElementById("envio").submit();
}  

function n_publicacoes_paginar_tipo(w,y){ 
  document.getElementById("envio").cpo.value = w;
   document.getElementById("envio").cpo1.value = y;
   document.getElementById("envio").action = "n_publicacoes_tipo.asp";
  document.getElementById("envio").submit();
}  
function n_enquete(w) {
var pgm = new Array("n_enquete_anteriores.asp")
  document.getElementById("envio").action = pgm[w];
  document.getElementById("envio").submit();
	}

function estado(qtest)
{
var  wqtest = qtest;
if (wqtest == 1) 
	{document.getElementById("Fale_com5").checked = true;return;}

if (wqtest == 2) 
	{document.getElementById("Fale_com6").checked = true;return;}
if (wqtest == 3) 
	{document.getElementById("Fale_com7").checked = true;return;}
if (wqtest == 4) 
	{document.getElementById("Fale_com3").checked = true;return;}
}
function VerificaCampoEhVazio(myfield, NomeCampo) {
	
	if (myfield.length == 0) {
		alert("O campo " + NomeCampo + " é de preenchimento obrigatório. Favor preenchê-lo.");
		return true;	// é vazio
	}
	else
		return false;	// está preenchido
}
function ValidaCampos() {
if 	((document.getElementById("Fale_com1").checked == false) && (document.getElementById("Fale_com2").checked == false) && (document.getElementById("Fale_com3").checked == false) && (document.getElementById("Fale_com4").checked == false) 
     && (document.getElementById("Fale_com5").checked == false)  && (document.getElementById("Fale_com6").checked == false)      && (document.getElementById("Fale_com7").checked == false)          
     && (document.getElementById("Fale_com8").checked == false) && (document.getElementById("Fale_com9").checked == false))    
    {	alert("Informe com a pessoa que deseja enviar o e-mail");
		return false;
    }
else if	((document.getElementById("voce_deseja1").checked == false) && (document.getElementById("voce_deseja2").checked == false)
     && (document.getElementById("voce_deseja3").checked == false) && (document.getElementById("voce_deseja4").checked == false))    
    {	alert("Voce deseja, informe uma das opções");
		return false;
    }	 
else if	((document.getElementById("Associado1").checked == false) && (document.getElementById("Associado2").checked == false))	
    {	alert("Associado, informe uma das opções");
		return false;
    }	 
else if (VerificaCampoEhVazio(document.getElementById("Nome").value, 'Nome')) {
		document.getElementById("Nome").focus();
		return false;
	}
else if(VerificaCampoEhVazio(document.getElementById("email").value, 'Email')) {
		document.getElementById("email").focus();
		return false;}
else if(VerificaCampoEhVazio(document.getElementById("mensagem").value, 'Mensagem')) {
		document.getElementById("mensagem").focus();
		return false;}
else
		document.getElementById("contato1").action = "n_contato_resp.asp";
		document.getElementById("contato1").submit()

return;
}	

function valida_senha() {  
if (document.getElementById("login").login.value.length < 3) { 
	alert("Login deverá ter no mínimo 3 caracteres");return}
if (document.getElementById("login").senha.value.length < 3) { 
	alert("Senha deverá ter no mínimo 3 caracteres");return}
   document.getElementById("login").action = "n_login.asp";
  document.getElementById("login").submit();
return


}
function fale_esp() {  
if (document.getElementById("form1").assunto.value.length < 1) {alert("Selecione o assunto");return false;}
if (document.getElementById("form1").area.value.length < 1) {alert("Selecione a Área");return false;}
if (document.getElementById("form1").pergunta.value.length < 1) {alert("Pergunta informação obrigatória");return false;}
document.getElementById("form1").acao.value = '1';
document.getElementById("form1").action = 'n_socios_fale_esp_envia.asp';
document.getElementById("form1").submit();
}

function formatar(src, mask) {
var i = src.value.length;var saida = mask.substring(0,1);var texto = mask.substring(i)
if (texto.substring(0,1) != saida) {
	src.value += texto.substring(0,1);}
}
function valida_controle_not(){ 
document.getElementById("formnot").action = 'n_controle_cad_not_i.asp';
document.getElementById("formnot").submit();
}

function valida_controle_not_1(){ 
document.getElementById("formnot").action = 'n_controle_cad_not_lista.asp';
document.getElementById("formnot").submit();
}
function cad_not_altera(cod) { 
document.getElementById("envio").cpo.value = cod;
document.getElementById("envio").action = 'n_controle_cad_not_altera.asp';
document.getElementById("envio").submit();
}

function valida_controle_not_2(){ 
document.getElementById("formnot").action = 'n_controle_cad_not_altera_a.asp';
document.getElementById("formnot").submit();
}
function valida_controle_not_3(){ 
document.getElementById("formnot").action = 'n_controle_cad_not_excluir.asp';
document.getElementById("formnot").submit();
}
function valida_controle_not_4(){ 
document.getElementById("formnot").action = 'n_controle_cad_not_excluir_vencidas.asp';
document.getElementById("formnot").submit();
}
function valida_cad_evt_alt(cod) { 
document.getElementById("envio").cpo.value = cod;
document.getElementById("envio").action = 'n_controle_cad_evt_altera.asp';
document.getElementById("envio").submit();
}

function valida_controle_evt3() { 
if (!confirm("Confirma a exclusão do evento?")) {return false;}
document.getElementById("envio").cpo.value = document.getElementById("eventos").id_evento.value ;
document.getElementById("envio").action = 'n_controle_cad_evt_excluir_i.asp';
document.getElementById("envio").submit();
}
function valida_controle_evt(){ 
document.getElementById("eventos").action = 'n_controle_cad_evt_i.asp';
document.getElementById("eventos").submit();
}
function valida_controle_evt_2(cod) { 
if (!confirm("Confirma a exclusão de eventos vencidos?")) {return false;}
document.getElementById("envio").action = 'n_controle_cad_evt_excluir.asp';
document.getElementById("envio").submit();
}
function valida_controle_evt1(){ 
document.getElementById("eventos").action = 'n_controle_cad_evt_altera_a.asp';
document.getElementById("eventos").submit();
}
function valida_controle_cur(){ 
document.getElementById("eventos").action = 'n_controle_cad_cur_i.asp';
document.getElementById("eventos").submit();
}
function valida_cad_cur_alt(cod) { 
document.getElementById("envio").cpo.value = cod;
document.getElementById("envio").action = 'n_controle_cad_cur_altera.asp';
document.getElementById("envio").submit();
}
function valida_controle_cur1(){ 
document.getElementById("cursos").action = 'n_controle_cad_cur_altera_a.asp';
document.getElementById("cursos").submit();
}
function valida_controle_cur3() { 
if (!confirm("Confirma a exclusão do curso?")) {return false;}
document.getElementById("envio").cpo.value = document.getElementById("cursos").id_cur.value ;
document.getElementById("envio").action = 'n_controle_cad_cur_excluir_i.asp';
document.getElementById("envio").submit();
}
function valida_controle_cur_2(cod) { 
if (!confirm("Confirma a exclusão de cursos vencidos?")) {return false;}
document.getElementById("envio").action = 'n_controle_cad_cur_excluir.asp';
document.getElementById("envio").submit();
}
function valida_controle_lnk(){ 
document.getElementById("eventos").action = 'n_controle_cad_lnk_i.asp';
document.getElementById("eventos").submit();
}
function valida_cad_lnk_alt(cod) { 
document.getElementById("envio").cpo.value = cod;
document.getElementById("envio").action = 'n_controle_cad_lnk_altera.asp';
document.getElementById("envio").submit();
}
function valida_controle_lnk_2(){ 
document.getElementById("formnot").action = 'n_controle_cad_lnk_altera_a.asp';
document.getElementById("formnot").submit();
}
function valida_controle_lnk_3(){ 
document.getElementById("formnot").action = 'n_controle_cad_lnk_excluir.asp';
document.getElementById("formnot").submit();
}
function valida_controle_abfmnews(){ 
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_i.asp';
document.getElementById("abfmnews").submit();
}
function valida_cad_abfmnews_alt(cod) { 
document.getElementById("envio").cpo.value = cod;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_alterar.asp';
document.getElementById("envio").submit();
}
function valida_controle_abfmnews1(){ 
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_alterar_a.asp';
document.getElementById("abfmnews").submit();
}
function valida_controle_abfmnews2(){ 
if (!confirm("Confirma a exclusão do ABFMNEWS?")) {return false;}
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_alterar_e.asp';
document.getElementById("abfmnews").submit();
}
function valida_controle_abfmnews3(){ 
document.getElementById("envio").cpo.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_incluir_noticia.asp';
document.getElementById("envio").submit();
}
function valida_controle_abfmnews4(){ 
document.getElementById("envio").cpo.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_ordenar_noticia.asp';
document.getElementById("envio").submit();
}
function valida_controle_abfmnews5(){ 
document.getElementById("envio").cpo.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_gerar.asp';
document.getElementById("envio").submit();
}
function valida_controle_abfmnews6(){ 
document.getElementById("envio").cpo.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_aprovar.asp';
document.getElementById("envio").submit();
}
function valida_controle_abfmnews8(){ 
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_incluir_noticia_i.asp';
document.getElementById("abfmnews").submit();
}
function valida_controle_abfmnews7(){ 
document.getElementById("envio").cpo.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").cpo1.value = "S";
document.getElementById("envio").action = 'n_controle_cad_abfmnews_incluir_noticia.asp';
document.getElementById("envio").submit();
}

function valida_controle_abfmnews9(){ 
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_ordenar_noticia_a.asp';
document.getElementById("abfmnews").submit();
}
function valida_controle_abfmnews10(){ 
document.getElementById("abfmnews").action = 'n_controle_cad_abfmnews_manda.asp';
document.getElementById("abfmnews").submit();
}
function valida_controle_abfmnews11(w){ 
document.getElementById("envio").cpo.value = w;
document.getElementById("envio").cpo1.value = document.getElementById("abfmnews").id_abfmnews.value;
document.getElementById("envio").action = 'n_controle_cad_abfmnews_excluir_noticia.asp';
document.getElementById("envio").submit();
}

// - sistema de enquetes
function envia_resposta()
	{
		document.form.action='n_controle_enquetes_add_r.asp';
		document.form.submit();
	}
// Função de Javascript que troca a action do formulário para o ASP que adicionar uma pergunta e envia esse formulário
function envia_pergunta()
	{
		document.form.action='n_controle_enquetes_add_p.asp';
		document.form.submit();
	}

function valida_controle_rel_socios(w) { 
if (w == 0 ) {
	document.getElementById("relsocios").action = 'n_controle_rel_socios_i.asp';
	document.getElementById("relsocios").submit();}
if (w == 3 ) {
	document.getElementById("relsocios").action = 'n_controle_rel_socios_p.asp';
	document.getElementById("relsocios").submit();	
}
if (w == 1 ) {
	document.getElementById("relsocios").action = 'n_controle_rel_socios_m.asp';
	document.getElementById("relsocios").submit();	
}
if (w == 2) {
windowqt = window.open("n_controle_rel_socios_v.asp", "Arquivo","toolbar=yes,location=no,status=yes,screenX=1,screenY=1,menubar=yes, resizable=yes,scrollbars=yes");
}
if (w == 4 ) {
	document.enviar.action = 'n_controle_rel_socios_t.asp';
	document.enviar.submit();	
}
}

function valida_controle_cad_adm(w) { 
if (w == 1) { 
	var w1 =  0 
	var w2 = 0 
	while (document.cadadm.sel.length > w1) {
	
		if (document.cadadm.sel[w1].checked == true)
		{w2++;}
	   w1++	
	}
	if (w2 == 0) {alert(w2+"-"+w1);return false}	
}

if (w == 1) { 
	document.cadadm.action = 'n_controle_cad_adm_e.asp';
} 
if (w == 2) { 
	document.cadadm.action = 'n_controle_cad_adm_i.asp';
} 
if (w == 3) { 
	document.cadadm.action = 'n_controle_cad_adm_ii.asp';
} 

	document.cadadm.submit();	


}
function valida_controle_cad_socios(w) { 
if (w == 0) { 
	document.cadsocios.action = 'n_controle_cad_socios.asp';
} 

	document.cadsocios.submit();	
}
function valida_controle_cad_sel(w) { 

  document.getElementById("envio").cpo.value = w
  document.getElementById("envio").action = 'n_controle_cad_socios_dp.asp';
  document.getElementById("envio").submit();
}

function crede_envia() { 
  w = document.getElementById("form9").cnpj_basico.value.length+document.getElementById("form9").cnpj_ordem.value.length+document.getElementById("form9").cnpj_digito.value.length ;
  y = document.getElementById("form9").nom_inst.value.length;
  if ((w < 12) && (y < 4)) {alert("Informe o CNPJ ou o nome da instituição com no mínimo 4 digitos");return}
  else {			
	document.getElementById("form9").action = 'n_socios_crede_d.asp';
	document.getElementById("form9").submit();}
}
function envia_crede1(wz) {
		  document.getElementById("envio").action = "n_socios_crede_a.asp?cpo="+wz;
		  document.getElementById("envio").submit();		
	}
function crede_envia_incl(w) { 

// w = 0 incluir , w = 1 alterar
if ((w == 1) || (w == 0)) {
	document.getElementById("form88").action = 'n_socios_crede_i_update.asp';
	if (document.getElementById("form88").crede_nom_inst.value.length < 3) {alert("Informe o Nome da Instituição");return false}
	if (document.getElementById("form88").crede_tel_inst.value.length < 3) {alert("Informe o Telefone da Instituição");return false}
	if (document.getElementById("form88").crede_email.value.length < 3) {alert("Informe o E-mail da Instituição");return false}
	if (emailcheck(document.getElementById("form88").crede_email.value)) {return false}
	if (document.getElementById("form88").crede_nom_cid.value.length < 3) {alert("Informe a cidade da Instituição");return false}
	if (document.getElementById("form88").crede_uf.value.length < 2) {alert("Informe a Unidade da Federação");return false}
	if (w == 1) {document.getElementById("form88").action = 'n_socios_crede_a_update.asp';}	
	document.getElementById("form88").submit()
}
if (w == 2)  { 
	document.getElementById("envio").action = 'n_socios_crede_d1.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").cpo1.value = 2
	document.getElementById("envio").submit()
}
if (w == 13)  { 
	document.getElementById("envio").action = 'n_socios_crede_d1.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").cpo1.value = w
	document.getElementById("envio").submit()
}
if (w == 14)  { 
	document.getElementById("envio").action = 'n_socios_crede_d1.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").cpo1.value = w
	document.getElementById("envio").submit()
}

if (w == 4) { 
	if (verifica_crede_mn() ){
		document.getElementById("form88").action = 'n_socios_crede_mn_i_i.asp';
		document.getElementById("form88").submit()}
}
if (w == 5) { 
	if (verifica_crede_mn() ){
		document.getElementById("form88").action = 'n_socios_crede_mn_a_update.asp';
		document.getElementById("form88").submit()}
}
if (w == 6) { 
	document.getElementById("envio").action = 'n_socios_crede_a.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").cnpj_emp.value
	document.getElementById("envio").submit()}


if (w == 7) { 
	document.getElementById("envio").action = 'n_socios_crede_mn_i_f.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").submit()}

if (w == 8) { 
	if (document.getElementById("form88").crede_rec_hum_nom_f.value.length < 5) {
		alert("Informe o nome do físico");return	
		}
	if (document.getElementById("form88").crede_rec_hum_nro_tit_esp_f.value.length < 3) {
		alert("Informe o número do título da ABFM");return	
		}		
	if (document.getElementById("form88").crede_rec_hum_car_hor_sem_f.value.length < 1) {
		alert("Informe carga horaria");return	
		}				
	if (valor(document.getElementById("form88").crede_rec_hum_car_hor_sem_f.value)) {return}		

	document.getElementById("form88").action = 'n_socios_crede_mn_i_f_i.asp';
	document.getElementById("form88").submit()
}
if (w == 9) { 
	document.getElementById("envio").action = 'n_socios_crede_mn_i_m.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").submit()}

if (w == 10) { 
	document.getElementById("envio").action = 'n_socios_crede_mn_i_o.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").submit()}


if (w == 11) { 
	if (document.getElementById("form88").crede_rec_hum_nom_m.value.length < 5) {
		alert("Informe o nome do médico");return	
		}
	if (document.getElementById("form88").crede_rec_hum_nro_tit_esp_m.value.length < 3) {
		alert("Informe o número do título da ABFM");return	
		}		
	if (document.getElementById("form88").crede_rec_hum_car_hor_sem_m.value.length < 1) {
		alert("Informe carga horaria");return	
		}				
	if (valor(document.getElementById("form88").crede_rec_hum_car_hor_sem_m.value)) {return}		

	document.getElementById("form88").action = 'n_socios_crede_mn_i_m_i.asp';
	document.getElementById("form88").submit()
}

if (w == 12) { 
	if (document.getElementById("form88").crede_rec_hum_nom_o.value.length < 5) {
		alert("Informe o nome do outro profissional");return	
		}
	if (document.getElementById("form88").crede_rec_hum_are_trab_o.value.length < 3) {
		alert("Informe a Area");return	
		}		
	if (document.getElementById("form88").crede_rec_hum_car_hor_sem_o.value.length < 1) {
		alert("Informe carga horaria");return	
		}				
	if (valor(document.getElementById("form88").crede_rec_hum_car_hor_sem_o.value)) {return}		

	document.getElementById("form88").action = 'n_socios_crede_mn_i_o_i.asp';
	document.getElementById("form88").submit()
}
if (w == 15) { 
	if (verifica_crede_rx() ){
		document.getElementById("form88").action = 'n_socios_crede_rx_i_i.asp';
		document.getElementById("form88").submit()}
}
if (w == 16) { 
	if (verifica_crede_rx() ){
		document.getElementById("form88").action = 'n_socios_crede_rx_a_update.asp';
		document.getElementById("form88").submit()}
}
if (w == 17) { 
	if (verifica_crede_rtx() ){
		document.getElementById("form88").action = 'n_socios_crede_rtx_i_i.asp';
		document.getElementById("form88").submit()}
}
if (w == 18) { 
	if (verifica_crede_rtx() ){
		document.getElementById("form88").action = 'n_socios_crede_rtx_a_update.asp';
		document.getElementById("form88").submit()}
}

if (w == 19) { 
	document.getElementById("envio").action = 'n_socios_crede_rtx_i_f.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").submit()}

if (w == 20) { 
	if (document.getElementById("form88").crede_rec_hum_nom_f.value.length < 5) {
		alert("Informe o nome do físico");return	
		}
	if (document.getElementById("form88").crede_rec_hum_nro_tit_esp_f.value.length < 3) {
		alert("Informe o número do título da ABFM");return	
		}		
	if (document.getElementById("form88").crede_rec_hum_car_hor_sem_f.value.length < 1) {
		alert("Informe carga horaria");return	
		}				
	if (valor(document.getElementById("form88").crede_rec_hum_car_hor_sem_f.value)) {return}		

	document.getElementById("form88").action = 'n_socios_crede_rtx_i_f_i.asp';
	document.getElementById("form88").submit()
}
if (w == 21) { 
	if (verifica_crede_rtx() ){
		document.getElementById("form88").action = 'n_socios_crede_rtx_a_update.asp';
		document.getElementById("form88").submit()}
}
if (w == 22) { 
	document.getElementById("envio").action = 'n_socios_crede_rtx_i_m.asp';
	document.getElementById("envio").cpo.value = document.getElementById("form88").crede_id.value
	document.getElementById("envio").submit()}
if (w == 23) { 
	if (document.getElementById("form88").crede_rec_hum_nom_m.value.length < 5) {
		alert("Informe o nome do médico");return	
		}
	if (document.getElementById("form88").crede_rec_hum_nro_tit_esp_m.value.length < 3) {
		alert("Informe o número do título da ABFM");return	
		}		
	if (document.getElementById("form88").crede_rec_hum_car_hor_sem_m.value.length < 1) {
		alert("Informe carga horaria");return	
		}				
	if (valor(document.getElementById("form88").crede_rec_hum_car_hor_sem_m.value)) {return}		

	document.getElementById("form88").action = 'n_socios_crede_rtx_i_m_i.asp';
	document.getElementById("form88").submit()
}
}

function crece_excl_fis(w) { 
	if (!confirm("Confirma de Exclusão")) {return}
	 document.getElementById("envio").action = 'n_socios_crede_mn_i_f_update.asp';
  	document.getElementById("envio").cpo.value = w
	document.getElementById("envio").submit()

}
function crece_excl_med(w) { 
	if (!confirm("Confirma de Exclusão")) {return}
	 document.getElementById("envio").action = 'n_socios_crede_mn_i_m_update.asp';
  	document.getElementById("envio").cpo.value = w
	document.getElementById("envio").submit()

}
function crece_excl_out(w) { 
	if (!confirm("Confirma de Exclusão")) {return}
	 document.getElementById("envio").action = 'n_socios_crede_mn_i_o_update.asp';
  	document.getElementById("envio").cpo.value = w
	document.getElementById("envio").submit()

}

function crece_excl_fis1(w) { 
	if (!confirm("Confirma de Exclusão")) {return}
	 document.getElementById("envio").action = 'n_socios_crede_rtx_i_f_update.asp';
  	document.getElementById("envio").cpo.value = w
	document.getElementById("envio").submit()

}
function crece_excl_med1(w) { 
	if (!confirm("Confirma de Exclusão")) {return}
	 document.getElementById("envio").action = 'n_socios_crede_rtx_i_m_update.asp';
  	document.getElementById("envio").cpo.value = w
	document.getElementById("envio").submit()

}


function checa_conv(w) { 
 if (eval(w).value.length > 0){
	if (document.getElementById('form88').crede_ins_con_mn[1].checked ){ 
	eval(w).focus()	
	eval(w).select()
	alert("Foi informado equipamentos conveniados"); 
	eval(w).value = "";
	return false;}}
}

function verifica_crede_mn() { 

wz = "document.getElementById('form88')."
	if (eval(wz+"crede_nro_apr_ano_mn").value.length < 1) {alert("Número de aprimorandos ano não foi informado");eval(wz+"crede_nro_apr_ano_mn").focus();return false } 
	if (valor(eval(wz+"crede_nro_apr_ano_mn").value)) {eval(wz+"crede_nro_apr_ano_mn").focus();return false  } 
	if ((!eval(wz+"crede_ins_con_mn[0]").checked) && (!eval(wz+"crede_ins_con_mn[1]").checked)) {alert("Favor informar se tem instituição conveniada?");return false } 
	if (eval(wz+"crede_ins_con_mn[0]").checked) { 
		if (eval(wz+"crede_nom_ins_con_mn").value.length < 1) {alert("Favor informar nome da instituição conveniada");eval(wz+"crede_nom_ins_con_mn").focus();return false }
		if (eval(wz+"crede_nom_res_ins_con_mn").value.length < 1) {alert("Favor informar nome do responsável da instituição conveniada");eval(wz+"crede_nom_res_ins_con_mn").focus();return false }
	}
		if (verifica_fisico()) {return false;}
		if (verifica_fisico1()) {return false;}
		if (verifica_medico1()) {return false;}
		if (verifica_outros1()) {return false;}		
		if (verifica_eq_imagens()) {return false;}				
		if (verifica_eq_o()) {return false;}
		return true

}


function verifica_fisico() {  

var y = document.getElementById("form88").f_ind_mn.value 
z = 0
z1 = 0 
while (z < y) { 
		if (eval("document.getElementById('form88').crede_rec_hum_res_pgm_"+z).checked) { 
			z1++
		}
	z++
}
if (z1 > 1) { 
		alert("Favor selecionar apenas um responsável pelo programa")
		return true ;
		} 
if (z1 == 0) { 
		alert("Selecionar o responsável pelo programa")
		return true;
		} 		

}

function verifica_fisico1() {  
var y = document.getElementById("form88").f_ind_mn.value 
z = 0
z1 = 0 
z4 = 0 
while (z < y) { 

	if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length > 0) { z4 = 1 
		if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length < 5) {alert("Nome do Físico deverá ter no mínimo 5 caracteres");z1=1}	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_f_"+z).value.length < 3) {alert("Favor informar o número do título de especialista");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value.length < 1) {alert("Favor informar carga horária");z1=1}		
		if (valor(eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value)) {z1=1;}
	}
	if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length < 1) { 	
			if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_f_"+z).value.length > 0) {alert("Foi informado número do título de especialista sem nome do Físico");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value.length > 0) {alert("Foi informado carga horária sem nome do físico");z1=1}		
	}
	
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 físico");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
}

function verifica_medico1() {  
var y = document.getElementById("form88").m_ind_mn.value 
z = 0
z1 = 0 
z4 = 0 
while (z < y) { 
if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length > 0) { z4 = 1 
		if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length < 5) {alert("Nome do Médico deverá ter no mínimo 5 caracteres");z1=1}	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_m_"+z).value.length < 3) {alert("Favor informar o número   CBR");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value.length < 1) {alert("Favor informar carga horária");z1=1}		
		if (valor(eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value)) {z1=1;}
}
if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length < 1) { 	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_m_"+z).value.length > 0) {alert("Foi informado número  CBR sem nome do Médico");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value.length > 0) {alert("Foi informado carga horária sem nome do médico");z1=1}		
	}
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 médico");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
}

function verifica_outros1() {  
var y = document.getElementById("form88").o_ind_mn.value 
z = 0
z1 = 0 
z4 = 0 
while (z < y) { 

	if (eval("document.getElementById('form88').crede_rec_hum_nom_o_"+z).value.length > 0) { z4 = 1 
		if (eval("document.getElementById('form88').crede_rec_hum_nom_o_"+z).value.length < 5) {alert("Nome Outros profissionais deverá ter no mínimo 5 caracteres");z1=1}	
		if (eval("document.getElementById('form88').crede_rec_hum_are_trab_o_"+z).value.length < 3) {alert("Favor informar área de trabalho");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_o_"+z).value.length < 1) {alert("Favor informar carga horária");z1=1}		
		if (valor(eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_o_"+z).value)) {z1=1;}
	}
	if (eval("document.getElementById('form88').crede_rec_hum_nom_o_"+z).value.length < 1) { 	
			if (eval("document.getElementById('form88').crede_rec_hum_are_trab_o_"+z).value.length > 0) {alert("Foi informado número  área de trabalho sem nome");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_o_"+z).value.length > 0) {alert("Foi informado carga horária sem nome ");z1=1}		
	}
	
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 outros profissional");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
}

function verifica_eq_imagens() { 
var y = 4
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_eq_mn_qtd_p_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_p_"+z).value)) {z1=1;}
			if (document.getElementById("form88").crede_ins_con_mn[0].checked) {
				if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_"+z).value)) {z1=1;}
		}
	}
	if (eval("document.getElementById('form88').crede_eq_mn_qtd_p_"+z).value.length < 1) { 
		if (document.getElementById("form88").crede_ins_con_mn[1].checked) {alert("quantidade de equipamentos de imagem - obrigatório");z1=1;}	
		if (document.getElementById("form88").crede_ins_con_mn[0].checked) {
			if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_"+z).value)) {z1=1;}
		}
		if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_"+z).value)) {z1=1;}
	}
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 equipamento de imagem");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
} 

function verifica_eq_o() { 
var y = 2
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_eq_mn_qtd_p_o_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_p_o_"+z).value)) {z1=1;}
		if (document.getElementById("form88").crede_ins_con_mn[0].checked) {
				if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_o_"+z).value)) {z1=1;}
		}
	}
	if (eval("document.getElementById('form88').crede_eq_mn_qtd_p_o_"+z).value.length < 1) { 
		if (document.getElementById("form88").crede_ins_con_mn[1].checked) {alert("quantidade de equipamentos de medidas e outras - obrigatório");z1=1;}	
		if (document.getElementById("form88").crede_ins_con_mn[0].checked) {
			if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_o_"+z).value)) {z1=1;}
		}
		if (valor(eval("document.getElementById('form88').crede_eq_mn_qtd_c_o_"+z).value)) {z1=1;}
	}
z++
}
	if (z4 == 0 ) {alert("favor informar pelo menos 1 equipamento de medidas e outras");return true}
	if (z1 == 1 ) {return true;}
	if (z1 == 0 ) {return false;}
} 

function verifica_crede_rx() { 
wz = "document.getElementById('form88')."
	if (eval(wz+"crede_nro_apr_ano_rx").value.length < 1) {alert("Número de aprimorandos ano não foi informado");eval(wz+"crede_nro_apr_ano_rx").focus();return false } 
	if (valor(eval(wz+"crede_nro_apr_ano_rx").value)) {eval(wz+"crede_nro_apr_ano_rx").focus();return false  } 
	if ((!eval(wz+"crede_ins_con_rx[0]").checked) && (!eval(wz+"crede_ins_con_rx[1]").checked)) {alert("Favor informar se tem instituição conveniada?");return false } 
	if (eval(wz+"crede_ins_con_rx[0]").checked) { 
		if (eval(wz+"crede_nom_ins_con_rx").value.length < 1) {alert("Favor informar nome da instituição conveniada");eval(wz+"crede_nom_ins_con_rx").focus();return false }
		if (eval(wz+"crede_nom_res_ins_con_rx").value.length < 1) {alert("Favor informar nome do responsável da instituição conveniada");eval(wz+"crede_nom_res_ins_con_rx").focus();return false }
	}
	if (eval(wz+"crede_rec_hum_nom").value.length < 1) {alert ("Favor informar o respons&aacute;vel pelo programa");eval(wz+"crede_rec_hum_nom").focus();return false }
	if (eval(wz+"crede_rec_hum_nro_tit_esp").value.length < 1) {alert ("Favor informar o respons&aacute;vel pelo programa");eval(wz+"crede_rec_hum_nro_tit_esp").focus();return false }

		if (verifica_rx_0()) {return false;}
		if (verifica_rx_1()) {return false;}		
		if (verifica_rx_2()) {return false;}				

		return true

}
function verifica_rx_0() { 
var y = document.getElementById('form88').rx_1.value
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_eq_rx_qtd_p_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_p_"+z).value)) {z1=1;}
		if (document.getElementById("form88").crede_ins_con_rx[0].checked) {
				if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+z).value)) {z1=1;}
		}
	}
	if (eval("document.getElementById('form88').crede_eq_rx_qtd_p_"+z).value.length < 1) { 
		if (document.getElementById("form88").crede_ins_con_rx[1].checked) {alert("quantidade de Equipamentos de Imagem - obrigatório");z1=1;}	
		if (document.getElementById("form88").crede_ins_con_rx[0].checked) {
			if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+z).value)) {z1=1;}
		}
		if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+z).value)) {z1=1;}
	}
z++
}
	if (z4 == 0 ) {alert("favor informar pelo menos 1 Equipamentos de Imagem");return true}
	if (z1 == 1 ) {return true;}
	if (z1 == 0 ) {return false;}
} 
function verifica_rx_1() { 
var y = document.getElementById('form88').rx_2.value
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_eq_rx_qtd_p_o_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_p_o_"+z).value)) {z1=1;}
		if (document.getElementById("form88").crede_ins_con_rx[0].checked) {
				if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+z).value)) {z1=1;}
		}
	}
	if (eval("document.getElementById('form88').crede_eq_rx_qtd_p_o_"+z).value.length < 1) { 
		if (document.getElementById("form88").crede_ins_con_rx[1].checked) {alert("EQUIPAMENTOS DE MEDIDAS E CONTROLE DE QUALIDADE - obrigatório");z1=1;}	
		if (document.getElementById("form88").crede_ins_con_rx[0].checked) {
			if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+z).value)) {z1=1;}
		}
		if (valor(eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+z).value)) {z1=1;}
	}
z++
}
	if (z4 == 0 ) {alert("favor informar pelo menos 1 EQUIPAMENTOS DE MEDIDAS E CONTROLE DE QUALIDADE");return true}
	if (z1 == 1 ) {return true;}
	if (z1 == 0 ) {return false;}
} 
function verifica_rx_2() { 
var y = document.getElementById('form88').rx_3.value
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_pgm_rx_pra_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_pgm_rx_pra_"+z).value)) {z1=1;}
	}
	if (eval("document.getElementById('form88').crede_pgm_rx_teo_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_pgm_rx_teo_"+z).value)) {z1=1;}
	}	

z++
}
	if (z4 == 0 ) {alert("favor informar pelo menos 1 Teóricas e praticas");return true}
	if (z1 == 1 ) {return true;}
	if (z1 == 0 ) {return false;}
} 


function trava_inst() { 
if (document.getElementById("form88").crede_ins_con_mn[0].checked) {
	document.getElementById("form88").crede_nom_ins_con_mn.disabled = "";
	document.getElementById("form88").crede_nom_res_ins_con_mn.disabled = "";	
	document.getElementById("form88").crede_eq_mn_qtd_c_0.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_1.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_2.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_3.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_4.disabled = ""	;
	document.getElementById("form88").crede_eq_mn_qtd_c_o_0.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_o_1.disabled = "";
	document.getElementById("form88").crede_eq_mn_qtd_c_o_2.disabled = "";
	document.getElementById("form88").crede_nom_ins_con_mn.focus()
	}
if (document.getElementById("form88").crede_ins_con_mn[1].checked) {
	document.getElementById("form88").crede_nom_ins_con_mn.value = "";
	document.getElementById("form88").crede_nom_res_ins_con_mn.value = "";
	document.getElementById("form88").crede_nom_ins_con_mn.disabled = "disabled";
	document.getElementById("form88").crede_nom_res_ins_con_mn.disabled = "disabled"	
	document.getElementById("form88").crede_eq_mn_qtd_c_0.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_1.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_2.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_3.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_4.value = "" 		
	document.getElementById("form88").crede_eq_mn_qtd_c_0.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_1.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_2.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_3.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_4.disabled = "disabled"	
	document.getElementById("form88").crede_eq_mn_qtd_c_o_0.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_o_1.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_o_2.value = "" 	
	document.getElementById("form88").crede_eq_mn_qtd_c_o_0.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_o_1.disabled = "disabled"
	document.getElementById("form88").crede_eq_mn_qtd_c_o_2.disabled = "disabled"
}
}
function soma_pra() { 
var w3 = 0 
wi = 0 
w2 = 0 
while (wi <= document.getElementById("form88").rx_3.value) { 
	if (eval("document.getElementById('form88').crede_pgm_rx_pra_"+wi).value.length > 0  ) 
	{
	w3 = eval("document.getElementById('form88').crede_pgm_rx_pra_"+wi).value	
	w2 = eval(w3) + w2 }
	wi++
}
document.getElementById("form88").crede_pgm_rx_pra_t.value = w2
}

function soma_teo() { 
var w3 = 0 
wi = 0 
w2 = 0 
while (wi <= document.getElementById("form88").rx_3.value) { 

	if (eval("document.getElementById('form88').crede_pgm_rx_teo_"+wi).value.length > 0  ) 
	{
	w3 = eval("document.getElementById('form88').crede_pgm_rx_teo_"+wi).value	
	w2 = eval(w3) + w2 
	}
	
	wi++
}

document.getElementById("form88").crede_pgm_rx_teo_t.value = w2
}

function trava_inst_rx() { 
if (document.getElementById("form88").crede_ins_con_rx[0].checked) {
	document.getElementById("form88").crede_nom_ins_con_rx.disabled = "";
	document.getElementById("form88").crede_nom_res_ins_con_rx.disabled = "";	
	wi = 0 
	while (wi <= document.getElementById("form88").rx_1.value ) {
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+wi).disabled = ""
	wi++
	}
wi = 0 
	while (wi <= document.getElementById("form88").rx_2.value ) {
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+wi).disabled = ""
	wi++
	}	
	document.getElementById("form88").crede_nom_ins_con_rx.focus()
	}
if (document.getElementById("form88").crede_ins_con_rx[1].checked) {
	document.getElementById("form88").crede_nom_ins_con_rx.value = "";
	document.getElementById("form88").crede_nom_res_ins_con_rx.value = "";
	document.getElementById("form88").crede_nom_ins_con_rx.disabled = "disabled";
	document.getElementById("form88").crede_nom_res_ins_con_rx.disabled = "disabled"	
	wi = 0 
	while (wi <= document.getElementById("form88").rx_1.value ) {
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+wi).disabled = "disabled"
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_"+wi).value = ""	
	wi++
	}
	wi = 0 
	while (wi <= document.getElementById("form88").rx_2.value) {
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+wi).disabled = "disabled"
		eval("document.getElementById('form88').crede_eq_rx_qtd_c_o_"+wi).value = ""	
	wi++
	}
	
}
}
function trava_inst_rtx() { 
if (document.getElementById("form88").crede_ins_con_rtx[0].checked) {
	document.getElementById("form88").crede_nom_ins_con_rtx.disabled = "";
	document.getElementById("form88").crede_nom_res_ins_con_rtx.disabled = "";	
	wi = 0 
	while (wi < document.getElementById("form88").rtx_1.value ) {
		eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+wi).disabled = ""
	wi++
	}
	document.getElementById("form88").crede_nom_ins_con_rtx.focus()
	}
if (document.getElementById("form88").crede_ins_con_rtx[1].checked) {
	document.getElementById("form88").crede_nom_ins_con_rtx.value = "";
	document.getElementById("form88").crede_nom_res_ins_con_rtx.value = "";
	document.getElementById("form88").crede_nom_ins_con_rtx.disabled = "disabled";
	document.getElementById("form88").crede_nom_res_ins_con_rtx.disabled = "disabled"	
	wi = 0 
	while (wi < document.getElementById("form88").rtx_1.value ) {
		eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+wi).disabled = "disabled"
		eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+wi).value = ""	
	wi++
	}
}
}
function verifica_crede_rtx() { 
wz = "document.getElementById('form88')."
	if (eval(wz+"crede_nro_apr_ano_rtx").value.length < 1) {alert("Número de aprimorandos ano não foi informado");eval(wz+"crede_nro_apr_ano_rtx").focus();return false } 
	if (valor(eval(wz+"crede_nro_apr_ano_rtx").value)) {eval(wz+"crede_nro_apr_ano_rtx").focus();return false  } 	
	if (eval(wz+"crede_nro_apr_ano_pac_rtx").value.length < 1) {alert("Quantidade de pacientes novos por ano por aprimorando");eval(wz+"crede_nro_apr_ano_pac_rtx").focus();return false } 	
	if (valor(eval(wz+"crede_nro_apr_ano_pac_rtx").value)) {eval(wz+"crede_nro_apr_ano_pac_rtx").focus();return false  } 
	if ((!eval(wz+"crede_ins_con_rtx[0]").checked) && (!eval(wz+"crede_ins_con_rtx[1]").checked)) {alert("Favor informar se tem instituição conveniada?");return false } 
	if (eval(wz+"crede_ins_con_rtx[0]").checked) { 
		if (eval(wz+"crede_nom_ins_con_rtx").value.length < 1) {alert("Favor informar nome da instituição conveniada");eval(wz+"crede_nom_ins_con_rtx").focus();return false }
		if (eval(wz+"crede_nom_res_ins_con_rtx").value.length < 1) {alert("Favor informar nome do responsável da instituição conveniada");eval(wz+"crede_nom_res_ins_con_rtx").focus();return false }
	}
		if (verifica_fisico2()) {return false;}
		if (verifica_fisico3()) {return false;}		
		if (verifica_medico3()) {return false;}				
		if (verifica_eq_rtx()) {return false;}
		

		return true

}

function verifica_fisico2() {  

var y = document.getElementById("form88").f_ind_rtx.value 
z = 0
z1 = 0 
while (z < y) { 
		if (eval("document.getElementById('form88').crede_rec_hum_res_pgm_"+z).checked) { 
			z1++
		}
	z++
}
if (z1 > 1) { 
		alert("Favor selecionar apenas um responsável pelo programa")
		return true ;
		} 
if (z1 == 0) { 
		alert("Selecionar o responsável pelo programa")
		return true;
		} 		

}

function verifica_fisico3() {  
var y = document.getElementById("form88").f_ind_rtx.value 
z = 0
z1 = 0 
z4 = 0 
while (z < y) { 

	if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length > 0) { z4 = 1 
		if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length < 5) {alert("Nome do Físico deverá ter no mínimo 5 caracteres");z1=1}	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_f_"+z).value.length < 3) {alert("Favor informar o número do título de especialista");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value.length < 1) {alert("Favor informar carga horária");z1=1}		
		if (valor(eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value)) {z1=1;}
	}
	if (eval("document.getElementById('form88').crede_rec_hum_nom_f_"+z).value.length < 1) { 	
			if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_f_"+z).value.length > 0) {alert("Foi informado número do título de especialista sem nome do Físico");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_f_"+z).value.length > 0) {alert("Foi informado carga horária sem nome do físico");z1=1}		
	}
	
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 físico");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
}
function verifica_medico3() {  
var y = document.getElementById("form88").m_ind_rtx.value 
z = 0
z1 = 0 
z4 = 0 
while (z < y) { 
if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length > 0) { z4 = 1 
		if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length < 5) {alert("Nome do Médico deverá ter no mínimo 5 caracteres");z1=1}	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_m_"+z).value.length < 3) {alert("Favor informar o número   CBR");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value.length < 1) {alert("Favor informar carga horária");z1=1}		
		if (valor(eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value)) {z1=1;}
}
if (eval("document.getElementById('form88').crede_rec_hum_nom_m_"+z).value.length < 1) { 	
		if (eval("document.getElementById('form88').crede_rec_hum_nro_tit_esp_m_"+z).value.length > 0) {alert("Foi informado número  CBR sem nome do Médico");z1=1}
		if (eval("document.getElementById('form88').crede_rec_hum_car_hor_sem_m_"+z).value.length > 0) {alert("Foi informado carga horária sem nome do médico");z1=1}		
	}
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 médico");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
}
function verifica_eq_rtx() { 
var y = 2
z = 0
z1 = 0 
z4 = 0 
while (z <= y) { 
	if (eval("document.getElementById('form88').crede_eq_rtx_qtd_p_"+z).value.length > 0) {z4 = 1; 
		if (valor(eval("document.getElementById('form88').crede_eq_rtx_qtd_p_"+z).value)) {z1=1;}
			if (document.getElementById("form88").crede_ins_con_rtx[0].checked) {
				if (valor(eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+z).value)) {z1=1;}
		}
	}
	if (eval("document.getElementById('form88').crede_eq_rtx_qtd_p_"+z).value.length < 1) { 
		if (document.getElementById("form88").crede_ins_con_rtx[1].checked) {alert("quantidade de equipamentos de imagem - obrigatório");z1=1;}	
		if (document.getElementById("form88").crede_ins_con_rtx[0].checked) {
			if (valor(eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+z).value)) {z1=1;}
		}
		if (valor(eval("document.getElementById('form88').crede_eq_rtx_qtd_c_"+z).value)) {z1=1;}
	}
z++
}
if (z4 == 0 ) {alert("favor informar pelo menos 1 equipamento");return true}
if (z1 == 1 ) {return true;}
if (z1 == 0 ) {return false;}
} 
function checa_conv_rtx(w) { 
 if (eval(w).value.length > 0){
	if (document.getElementById('form88').crede_ins_con_rtx[1].checked ){ 
	eval(w).focus()	
	eval(w).select()
	alert("Foi informado equipamentos conveniados"); 
	eval(w).value = "";
	return false;}}
}
function emailcheck (emailStr) 
{
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

if (emailStr.length==0)
	return false;
	
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert("Endereço de Email Incorreto");
	return true;
}
if (alpha1(emailStr)) {
	alert("Informe apenas um endereço de email");
	return true;
}
return false;
}
function alpha1(wvalor) {
	var valid = "@";
	var ok = 0;
	var temp;
	for (var i=0; i<wvalor.length; i++) {
	temp = "" + wvalor.substring(i, i+1);
	if (valid.indexOf(temp) != "-1") ok++;}
	if (ok > 1 ) {
	return true;}
  return false;   
}
function valor(wvalor) {
var valid = "0123456789"
var ok = "yes";
var temp;
var i=0
for ( i=0;i < wvalor.length;i++) {
	temp = "" + wvalor.substring(i, i+1);
if (valid.indexOf(temp) == "-1") {ok = "no"};

}
if (ok == "no") {
	alert("Apenas números são aceitos neste campo!!! "+ wvalor);
	
	return true ; 
   }
else
  return false;   
}

