//------------------------------------------------------------------
// função para direcionar menu
//------------------------------------------------------------------
function menu1(w) { 
if (w == 0)  {
  document.getElementById("form1").action = "index.asp";
  document.getElementById("form1").submit();
}
if (w == 1)  {
  document.getElementById("form1").action = "programa.asp";
  document.getElementById("form1").submit();
}
if (w == 2)  {
  document.getElementById("form1").action = "congresso.asp";
  document.getElementById("form1").submit();
}
if (w == 3)  {
  document.getElementById("form1").action = "datas.asp";
  document.getElementById("form1").submit();
}

if (w == 4)  {
  document.getElementById("form1").action = "trabalhos.asp";
  document.getElementById("form1").submit();
}
if (w == 5)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "inscricao.asp";
 document.getElementById("form1").submit()
}
if (w == 6)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "tesouraria.asp";
 document.getElementById("form1").submit()
}
if (w == 7)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "encerrar.asp";
 document.getElementById("form1").submit()
}
if (w == 8)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "meusdados.asp";
 document.getElementById("form1").submit()
}
if (w == 9)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "selecionadores.asp";
 document.getElementById("form1").submit()
}
if (w == 10)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "coordenadores.asp";
 document.getElementById("form1").submit()
}
if (w == 11)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "revisores.asp";
 document.getElementById("form1").submit()
}
if (w == 12)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "master.asp";
 document.getElementById("form1").submit()
}
if (w == 13)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "inscritos.asp";
 document.getElementById("form1").submit()
}
if (w == 14)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "fale.asp";
 document.getElementById("form1").submit()
}
if (w == 15)  {
// alert("INSCRIÇÕES A PARTIR DO DIA 04/05/2009"); return;
  document.getElementById("form1").action = "instituicao.asp";
 document.getElementById("form1").submit()
}

}

function sub_comite(w) {  
if (w == 1)  {
  document.getElementById("form2").action = "comite.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "precos.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "LOCAL.asp";
  document.getElementById("form2").submit()
}


if (w == 4)  {
  document.getElementById("form2").action = "EXPOSICAO.asp";
  document.getElementById("form2").submit()
}

if (w == 5)  {
  document.getElementById("form2").action = "PARCERIAS.asp";
  document.getElementById("form2").submit()
}

if (w == 6)  {
  document.getElementById("form2").action = "palestrantes.asp";
  document.getElementById("form2").submit()
}
if (w == 7)  {
  document.getElementById("form2").action = "realizacao.asp";
  document.getElementById("form2").submit()
}
if (w == 8)  {
  document.getElementById("form2").action = "hospedagem.asp";
  document.getElementById("form2").submit()
}
if (w == 9)  {
  document.getElementById("form2").action = "publico.asp";
  document.getElementById("form2").submit()
}

}

function sub_tesouraria(w) {  
if (w == 1)  {
  document.getElementById("form2").action = "tesouraria.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "alterar.asp";
  document.getElementById("form2").submit()
}

if (w == 3)  {
  document.getElementById("form2").action = "pesquisar.asp";
  document.getElementById("form2").submit()
}

if (w == 4)  {
  document.getElementById("form2").action = "baixar_boleto1.asp";
  document.getElementById("form2").submit()
}
if (w == 5)  {
  document.getElementById("form2").action = "posicao_financeira.asp";
  document.getElementById("form2").submit()
}
if (w == 6)  {
  document.getElementById("form2").action = "inscritos.asp";
  document.getElementById("form2").submit()
}
}

function sub_meusdados(w) {  
if (w == 2)  {
  document.getElementById("form2").action = "submeter.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "meusdados.asp";
  document.getElementById("form2").submit()
}

}
function sub_inscricao(w) {  
if (w == 0)  {
  document.getElementById("form2").action = "inscritos.asp";
  document.getElementById("form2").submit()
}
}
function sub_trabalhos(w) {  
if (w == 1)  {
  document.getElementById("form2").action = "trabalhos.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "prazos.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "revisao.asp";
  document.getElementById("form2").submit()
}
if (w == 4)  {
  document.getElementById("form2").action = "descontos.asp";
  document.getElementById("form2").submit()
}
}

function sub_programa(w) {  
if (w == 1)  {
  document.getElementById("form2").action = "minicursos.asp";
  document.getElementById("form2").submit()
}
if (w == 4)  {
  document.getElementById("form2").action = "temas.asp";
  document.getElementById("form2").submit()
}

}
function sub_selecionadores(w){
if (w == 1)  {
  document.getElementById("form2").action = "selecionadores.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "selecionadores_enviar.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "meusdados.asp";
  document.getElementById("form2").submit()
}

}
function sub_coordenadores(w){
if (w == 1)  {
  document.getElementById("form2").action = "coordenadores.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "alterar.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "pendencia_coordenador.asp";
  document.getElementById("form2").submit()
}
if (w == 4)  {
  document.getElementById("form2").action = "pendencia_revisores.asp";
  document.getElementById("form2").submit()
}
if (w == 5)  {
  document.getElementById("form2").action = "APROVADOS.asp";
  document.getElementById("form2").submit()
}
if (w == 6)  {
  document.getElementById("form2").action = "RECUSADOS.asp";
  document.getElementById("form2").submit()
}
if (w == 7)  {
  document.getElementById("form2").action = "pendencia_autores.asp";
  document.getElementById("form2").submit()
}
if (w == 8)  {
  document.getElementById("form2").action = "pesquisa_coordenador.asp";
  document.getElementById("form2").submit()
}
if (w == 9)  {
  document.getElementById("form2").action = "posicao_trabalhos.asp";
  document.getElementById("form2").submit()
}
if (w == 10)  {
  document.getElementById("form2").action = "submeter.asp";
  document.getElementById("form2").submit()
}
if (w == 11)  {
  document.getElementById("form2").action = "meusdados.asp";
  document.getElementById("form2").submit()
}
}
function sub_revisores(w){
if (w == 1)  {
  document.getElementById("form2").action = "revisores.asp";
  document.getElementById("form2").submit()
}
if (w == 2)  {
  document.getElementById("form2").action = "meusdados.asp";
  document.getElementById("form2").submit()
}
if (w == 3)  {
  document.getElementById("form2").action = "submeter.asp";
  document.getElementById("form2").submit()
}
}
function validar_part(w) {
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "validar.asp";
  	document.getElementById("form2").submit()
}
function checa_login() {
//return;
if (document.getElementById("form1").login.value.length < 4) {alert("Informe o login, deverá ter no mínimo 3 letras");document.getElementById("form1").login.focus();return}
if (document.getElementById("form1").senha.value.length < 4) {alert("Informe a senha, deverá ter no mínimo 3 caracteres");document.getElementById("form1").senha.focus();return}
document.getElementById("form1").action = "valida_senha.asp";
document.getElementById("form1").submit();
}

/*************************************************************************************
 ValidaCaracterInvalido(): Valida se caracter digitado é inválido

 Parâmetros: - 

 Retorno: - True se o caracter é valido,e
			False se o caracter for inválido.
 *************************************************************************************/
function ValidaCaracterInvalido(campo) {
	var obj = eval(campo);
	//if ((event.keyCode == 46) || (event.keyCode == 39)) {
	if (event.keyCode == 39) {
		alert("Caracter inválido");
		obj.value = '';
		return false;
	}
	else
		return true;
}
function valida_cadastro() {   
if (document.getElementById("form3").nom_par.value == "") {document.getElementById("form3").nom_par.focus();alert("Favor informar o nome para inscrição");return}
if (document.getElementById("form3").nom_par.value.length < 4) {document.getElementById("form3").nom_par.focus();alert("Favor informar o nome para inscrição");return}
if (alpha(document.getElementById("form3").nom_par.value)) {document.getElementById("form3").nom_par.focus();return}
if (alpha(document.getElementById("form3").nom_ins.value)) {document.getElementById("form3").nom_ins.focus();return}
if (alpha(document.getElementById("form3").car_fun.value)) {document.getElementById("form3").car_fun.focus();return}
if (alpha(document.getElementById("form3").des_prf.value)) {document.getElementById("form3").des_prf.focus();return}
if (document.getElementById("form3").nom_crh.value == "") {document.getElementById("form3").nom_crh.focus();alert("Favor informar o nome para CRACHÁ");return}
if (document.getElementById("form3").nom_crh.value.length < 4) {document.getElementById("form3").nom_crh.focus();alert("Nome para o Crachá deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_crh.value)) {document.getElementById("form3").nom_crh.focus();return}
if (document.getElementById("form3").nom_cid.value == "") {document.getElementById("form3").nom_cid.focus();alert("Favor informar a Cidade");return}
if (document.getElementById("form3").nom_cid.value.length < 4) {document.getElementById("form3").nom_cid.focus();alert("Cidade deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_cid.value)) {document.getElementById("form3").nom_cid.focus();return}
if (document.getElementById("form3").uf.value == "") {alert("Favor informar o Estado");return}
if (document.getElementById("form3").nom_pai.value == "") {alert("Favor informar o País");return}
if (document.getElementById("form3").nom_pai.value.length < 3) {document.getElementById("form3").nom_pai.focus();alert("País deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_pai.value)) {document.getElementById("form3").nom_pai.focus();return}
if (document.getElementById("form3").num_tel.value.length < 4) {document.getElementById("form3").num_tel.focus();alert("Favor informar o telefone para contato");return}
if (document.getElementById("form3").email.value.length < 4) {document.getElementById("form3").email.focus();alert("Favor informar o e-mail para contato");return}
if (emailcheck(document.getElementById("form3").email.value)) {document.getElementById("form3").email.focus();return}
document.getElementById("form3").action = "inscricao_update.asp"
document.getElementById("form3").submit()
}
function valida_cadastro1() {   
if (alpha(document.getElementById("form3").nom_ins.value)) {document.getElementById("form3").nom_ins.focus();return}
if (alpha(document.getElementById("form3").car_fun.value)) {document.getElementById("form3").car_fun.focus();return}
if (alpha(document.getElementById("form3").des_prf.value)) {document.getElementById("form3").des_prf.focus();return}
if (document.getElementById("form3").nom_cid.value == "") {document.getElementById("form3").nom_cid.focus();alert("Favor informar a Cidade");return}
if (document.getElementById("form3").nom_cid.value.length < 4) {document.getElementById("form3").nom_cid.focus();alert("Cidade deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_cid.value)) {document.getElementById("form3").nom_cid.focus();return}
if (document.getElementById("form3").uf.value == "") {alert("Favor informar o Estado");return}
if (document.getElementById("form3").nom_pai.value == "") {alert("Favor informar o País");return}
if (document.getElementById("form3").nom_pai.value.length < 3) {document.getElementById("form3").nom_pai.focus();alert("País deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_pai.value)) {document.getElementById("form3").nom_pai.focus();return}
if (document.getElementById("form3").num_tel.value.length < 4) {document.getElementById("form3").num_tel.focus();alert("Favor informar o telefone para contato");return}
if (document.getElementById("form3").email.value.length < 4) {document.getElementById("form3").email.focus();alert("Favor informar o e-mail para contato");return}
if (emailcheck(document.getElementById("form3").email.value)) {document.getElementById("form3").email.focus();return}
document.getElementById("form3").action = "alterar_update.asp"
document.getElementById("form3").submit()
}
function valida_cadastrox() {   
if (document.getElementById("form3").nom_par.value == "") {document.getElementById("form3").nom_par.focus();alert("Favor informar o nome para inscrição");return}
if (document.getElementById("form3").nom_par.value.length < 4) {document.getElementById("form3").nom_par.focus();alert("Favor informar o nome para inscrição");return}
if (alpha(document.getElementById("form3").nom_par.value)) {document.getElementById("form3").nom_par.focus();return}
if (document.getElementById("form3").nom_crh.value == "") {document.getElementById("form3").nom_crh.focus();alert("Favor informar o nome para CRACHÁ");return}
if (document.getElementById("form3").nom_crh.value.length < 4) {document.getElementById("form3").nom_crh.focus();alert("Nome para o Crachá deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_crh.value)) {document.getElementById("form3").nom_crh.focus();return}
if (document.getElementById("form3").nom_cid.value == "") {document.getElementById("form3").nom_cid.focus();alert("Favor informar a Cidade");return}
if (document.getElementById("form3").nom_cid.value.length < 4) {document.getElementById("form3").nom_cid.focus();alert("Cidade deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_cid.value)) {document.getElementById("form3").nom_cid.focus();return}
if (document.getElementById("form3").uf.value == "") {alert("Favor informar o Estado");return}
if (document.getElementById("form3").nom_pai.value == "") {alert("Favor informar o País");return}
if (document.getElementById("form3").nom_pai.value.length < 3) {document.getElementById("form3").nom_pai.focus();alert("País deverá conter no mínimo 4 caracteres");return}
if (alpha(document.getElementById("form3").nom_pai.value)) {document.getElementById("form3").nom_pai.focus();return}
if (document.getElementById("form3").email.value.length < 4) {document.getElementById("form3").email.focus();alert("Favor informar o e-mail para contato");return}
if (emailcheck(document.getElementById("form3").email.value)) {document.getElementById("form3").email.focus();return}
if (val_soc()) {return;}
if ((!document.getElementById("form3").cat_ins[0].checked) && (!document.getElementById("form3").cat_ins[1].checked) && (!document.getElementById("form3").cat_ins[2].checked)) {alert("Selecione uma das categorias");return;}
if ((!document.getElementById("form3").tip_ins[0].checked) && (!document.getElementById("form3").tip_ins[1].checked)) {alert("Informe o tipo de inscrição desejada");return}
document.getElementById("form3").action = "inscritos_update.asp"
document.getElementById("form3").submit()
}
function val_tip_ins() { 
if (document.getElementById("form3").tip_ins[2].checked) {  
	if ((!document.getElementById("form3").tip_aco[0].checked) && (!document.getElementById("form3").tip_aco[1].checked) && (!document.getElementById("form3").tip_aco[2].checked)) { 
		alert("Tipo de inscrição com hospedagem , selecione o tipo de acomodação");return true;}}
if (document.getElementById("form3").tip_ins[2].checked) {  
	if ((document.getElementById("form3").tip_aco[2].checked) && (document.getElementById("form3").cat_ins[2].checked)){document.getElementById("form3").tip_aco[2].checked=false;alert("Acomodação em quarto triplo válido apenas para Categorias Estudantes e Técnicos");return true;}}
if (!document.getElementById("form3").tip_ins[2].checked) {document.getElementById("form3").tip_aco[0].checked = false;document.getElementById("form3").tip_aco[1].checked = false;document.getElementById("form3").tip_aco[2].checked = false;}
return;			
}

function val_soc() { 

if ((!document.getElementById("form3").socio[0].checked) && (!document.getElementById("form3").socio[1].checked) && (!document.getElementById("form3").socio[2].checked)) {alert("Informe se é Sócio da ABFM, Sociadade Parceira ou não sócio.");return true;}
if (document.getElementById("form3").socio[0].checked) { 
	if (document.getElementById("form3").nsocio.value.length < 1) {document.getElementById("form3").nsocio.focus();alert("Informe seu número de sócio da ABFM");return true;} 
	}
if ((document.getElementById("form3").socio[1].checked) || (document.getElementById("form3").socio[2].checked)) {document.getElementById("form3").nsocio.value = "";}
return false;	
}

function desabilita_par() { 
document.getElementById("form3").qtd_par[1].checked = true;
return;
}
function alpha(wvalor) {
	var valid = "#@!|\;?/$%&*[]{}~^";
	var ok = "yes";
	var temp;
	for (var i=0; i<wvalor.length; i++) {
	temp = "" + wvalor.substring(i, i+1);
	if (valid.indexOf(temp) != "-1") ok = "no";}
	if (ok == "no") {
	alert("Caracteres Inválidos");
	return true;}
  return false;   
}
function tira_valor(){
var xxx = document.getElementById("frm99").comenta.value
var temp;
	var ok = "yes";
	for (var i=0; i<xxx.length; i++) {
	temp = "" + xxx.substring(i, i+1);
	if (temp == '"') ok = 'no';}
	if (ok == 'no') {
		alert('Caracter "(ASPAS) não deve ser utilizado');
 		return true;}
	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;
}

return false;
}
function mudou_ins() { 
document.getElementById("form3").tip_aco[0].checked = false;
document.getElementById("form3").tip_aco[1].checked = false;
document.getElementById("form3").tip_aco[2].checked = false;
if (document.getElementById("form3").tip_ins[1].checked) {alert("Opção esgotada");return}
}
function mudou_ins2() { 
if (document.getElementById("form3").tip_ins[3].checked) {
document.getElementById("form3").tip_ins_cur.checked = false;
}
}
function mudou_ins1() { 
document.getElementById("form3").tip_ins_cur.checked = false;
document.getElementById("form3").tip_aco[0].checked = false;
document.getElementById("form3").tip_aco[1].checked = false;
document.getElementById("form3").tip_aco[2].checked = false;
document.getElementById("form3").qtd_par[1].checked = true;

}
function mudou_insx() { 
document.getElementById("form3").tip_ins_cur.checked = false;
}
function mudou_insy() { 
if (document.getElementById("form3").tip_ins[1].checked) {
document.getElementById("form3").tip_ins_cur.checked = false;
}
}
function precos() {  
windowqt = window.open("precos_pop.asp", "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778,height=400, resizable=yes,scrollbars=yes");
windowqt.focus();}

function cursosi(w) {  
windowqt = window.open("cursos_pop.asp?cod="+w, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=600,height=200, resizable=yes,scrollbars=yes");
windowqt.focus();}

function esqueci_login() {  
windowqt = window.open("senha_pop.asp", "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=300,height=200, resizable=yes,scrollbars=yes");
windowqt.focus();}

function envia_esqueci() {   
if (document.getElementById("form_senha").email.value.length < 4) {document.getElementById("form_senha").email.focus();alert("Favor informar o e-mail ");return}
if (emailcheck(document.getElementById("form_senha").email.value)) {document.getElementById("form_senha").email.focus();return}
	document.form_senha.action = "senha_u.asp";
	document.form_senha.submit();

}


function par_ins() { 
if (document.getElementById("form3").tip_ins[3].checked)
	{alert("Não existe parcelamento só para cursos.") ;
	document.getElementById("form3").qtd_par[1].checked = true;
		return;}
if ((document.getElementById("form3").socio[0].checked)|| (document.getElementById("form3").socio[1].checked))  {return;}
if ((document.getElementById("form3").socio[2].checked)&& (document.getElementById("form3").cat_ins[0].checked))  {return;}
if ((document.getElementById("form3").socio[2].checked)&& (document.getElementById("form3").cat_ins[1].checked))  {return;}
	alert("Parcelamento apenas para sócios da ABFM, de Sociedades parceiras e para Estudantes e Técnicos.") ;
	document.getElementById("form3").qtd_par[1].checked = true;
return;
}
function hos_triplo() {
 
//if ((document.getElementById("form3").cat_ins[0].checked) || (document.getElementById("form3").cat_ins[1].checked)) {return;}
//alert("Hospedagem em quarto triplo apenas para Estudantes e Técnicos");
alert("Tipo de acomodação Esgotada");
document.getElementById("form3").tip_aco[2].checked = false;
return;
}
function hos_simples() { 
alert("Hospedagem em quarto simples esgotada");
document.getElementById("form3").tip_aco[0].checked = false;
return
}


function pesq_soc(x,z) { 
if (z == 1)  {   
	wpgm = "socios_con.asp?id="+x ;
}
if (z == 2)  {   
	wpgm = "socios_nom.asp?id="+x; 
}
	windowqt = window.open(wpgm, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=500,height=100, resizable=yes,scrollbars=yes");
	windowqt.focus();
}

function valida_atua() {  
if (document.getElementById("form3").fk_id_prc.value == "") {alert("Selecione Tabela de Preços");return;}
document.getElementById("form3").action = "validar_update.asp";
document.getElementById("form3").submit();
}
function ValidarAnexo() {
	if (document.frmAnexar.filAnexo.value == '') {
	alert('Você tem que selecionar um arquivo para ser anexado.')
	document.frmAnexar.filAnexo.focus();
}
else {
	
	document.frmAnexar.txtPath.value = document.frmAnexar.filAnexo.value;
	document.frmAnexar.action = "anexar.asp";
	document.frmAnexar.submit();
}
}
function ValidarAnexo3() {
	if (document.frmAnexar.filAnexo.value == '') {
	alert('Você tem que selecionar um arquivo para ser anexado.')
	document.frmAnexar.filAnexo.focus();
}
else {
	document.frmAnexar.txtPath.value = document.frmAnexar.filAnexo.value;
	document.frmAnexar.action = "anexar_correcoes.asp";
	document.frmAnexar.submit();
}
}
function ValidarAnexo2() {
	if (document.frmAnexar.filAnexo.value == '') {
	alert('Você tem que selecionar um arquivo para ser anexado.')
	document.frmAnexar.filAnexo.focus();
}
else {
	document.frmAnexar.txtPath.value = document.frmAnexar.filAnexo.value;
	document.frmAnexar.action = "s_anexar.asp";
	document.frmAnexar.submit();
}
}
function ValidarAnexo4() {
	if (document.frmAnexar.filAnexo.value == '') {
	alert('Você tem que selecionar um arquivo para ser anexado.')
	document.frmAnexar.filAnexo.focus();
}
else {
	document.frmAnexar.txtPath.value = document.frmAnexar.filAnexo.value;
	document.frmAnexar.action = "anexar_apresenta.asp";
	document.frmAnexar.submit();
}
}


function ValidarAnexo1() {
	if (document.frmtrab.nometrab.value.length < 1) {
		alert('Nome do trabalho Obrigatório.')
		document.frmtrab.nometrab.focus();
		return;
	}
	if (document.frmtrab.nomeautor.value.length < 1) {
		alert('Nome do Autor Apresentador Obrigatório.')
		document.frmtrab.nomeautor.focus();
		return;
	}
	if (document.frmtrab.coautor.value.length < 1) {
		alert('Nome do Autor Apresentador Obrigatório.')
		document.frmtrab.coautor.focus();
		return;
	}
		document.frmtrab.submit();

}

function boleto(w) { 
var wenvia = "boleto.asp?id_bol="+w
windowqt = window.open(wenvia, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778,height=400, resizable=yes,scrollbars=yes");
windowqt.focus();
}
function recibo_imprime() { 
windowqt = window.open("recibo.asp", "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778,height=400, resizable=yes,scrollbars=yes");
windowqt.focus();
}
function palavras(w) { 
var wenvia = "palavra.asp?id_tra="+w
windowqt = window.open(wenvia, "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=778,height=300, resizable=yes,scrollbars=yes");
windowqt.focus();
}
function palavra_1(w) { 
if ((document.getElementById("trab").palavra1.value == "") && 
	(document.getElementById("trab").palavra2.value == "") &&
	(document.getElementById("trab").palavra3.value == "") &&
	(document.getElementById("trab").palavra4.value == "") &&
	(document.getElementById("trab").palavra5.value == "")) {alert("Informe pelo menos uma palavra chave");return;} 
  	document.getElementById("trab").action = "palavra_update.asp?id_tra="+w;
  	document.getElementById("trab").submit()	  	
}

function validar_trabalho(w) { 
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "selecionadores_update.asp";
  	document.getElementById("form2").submit()
}

function enviar_trabalho(w) { 
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "selecionadores_submeter.asp";
  	document.getElementById("form2").submit()
}
function detalhar_trabalho(w) { 
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "detalhar_trabalhos.asp";
  	document.getElementById("form2").submit()
}
function enviar_correcoes(w) { 
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "enviar_correcoes.asp";
  	document.getElementById("form2").submit()
}

function botoes_trab(w) { 
if (w == 1) {
  	document.getElementById("trab").action = "muda_revisor.asp";
  	document.getElementById("trab").submit()}
if (w == 2) {
  	document.getElementById("trab").action = "recusa_revisao.asp";
  	document.getElementById("trab").submit()}	
if (w == 3) {
  	document.getElementById("trab").action = "avaliacao.asp";
  	document.getElementById("trab").submit()}
if (w == 4) {
  	document.getElementById("trab").action = "muda_area.asp";
  	document.getElementById("trab").submit()}
if (w == 5) {
  	document.getElementById("trab").action = "muda_forma.asp";
  	document.getElementById("trab").submit()}		
if (w == 6) {
  	document.getElementById("trab").action = "devolve_autor.asp";
  	document.getElementById("trab").submit()}		
if (w == 7) {
  	document.getElementById("trab").action = "avaliacao_recusa.asp";
  	document.getElementById("trab").submit()}
if (w == 8) {
  	document.getElementById("trab").action = "aprova_trab.asp";
  	document.getElementById("trab").submit()}			
}
function muda_rev() { 
if (document.getElementById("frm99").f_fk_id_rev1.value == 0){
	if (document.getElementById("frm99").n_fk_id_rev1.value == 0){
		alert("Selecione o novo revisor 01");return}}
if (document.getElementById("frm99").f_fk_id_rev2.value == 0){
	if (document.getElementById("frm99").n_fk_id_rev2.value == 0){
		alert("Selecione o novo revisor 02");return;}}		
		
if ((document.getElementById("frm99").f_fk_id_rev1.value > 0) && (document.getElementById("frm99").f_fk_id_rev2.value > 0)){
	if ((document.getElementById("frm99").n_fk_id_rev1.value == 0) && (document.getElementById("frm99").n_fk_id_rev2.value == 0)){	
				alert("Selecione pelo menos um dos novos revisores");return;}}		

			
  	document.getElementById("frm99").action = "muda_revisor_update.asp";
  	document.getElementById("frm99").submit()
}
function muda_area() { 
if (document.getElementById("frm99").n_fk_id_tms.value == ""){
		alert("Selecione a nova área");return}
		
  	document.getElementById("frm99").action = "muda_area_update.asp";
  	document.getElementById("frm99").submit()
}
function muda_forma() { 
if (document.getElementById("frm99").n_fk_id_for.value == ""){
		alert("Selecione a nova forma de apresentação");return}
		
  	document.getElementById("frm99").action = "muda_forma_update.asp";
  	document.getElementById("frm99").submit()
}
function ava_rev(w) {
if (w == 1) {
	if (document.getElementById("frm99").sit_trab.value == "") {alert("Selecione a avaliação do trabalho");return;}
	 if (tira_valor()) {return;}
	if (document.getElementById("frm99").comenta.value.length < 4)  {alert("Informe a avaliação do trabalho");return;}
	
	
  	document.getElementById("frm99").action = "avaliacao_update.asp";
  	document.getElementById("frm99").submit()}

if (w == 2) {
	if (document.getElementById("frm99").sit_trab.value == "") {alert("Selecione a avaliação do trabalho");return;}
	 if (tira_valor()) {return;}
	if (document.getElementById("frm99").comenta.value.length < 4)  {alert("Informe a avaliação do trabalho");return;}
	
	
  	document.getElementById("frm99").action = "avaliacao_recusa_update.asp";
  	document.getElementById("frm99").submit()}
	
	
	
}
function alterar_dados(w) { 
	if (w == 1 ){
  	document.getElementById("form2").action = "alterar.asp";
  	document.getElementById("form2").submit()}
	if (w == 2 ){
  	document.getElementById("form2").action = "muda_opcoes.asp";
  	document.getElementById("form2").submit()}	
	if (w == 3 ){
  	document.getElementById("form2").action = "muda_opcoes_cursos.asp";
  	document.getElementById("form2").submit()}	
}	
function curso(w){ 

if ((w == 20) && (document.getElementById("form3").cur_8_m[0].checked))  { 
	document.getElementById("form3").cur_8_m[0].checked = true;
	document.getElementById("form3").cur_9_t[0].checked =true;
	return;}
if ((w == 21) && (document.getElementById("form3").cur_9_t[0].checked))  { 
	document.getElementById("form3").cur_8_m[0].checked = true;
	document.getElementById("form3").cur_9_t[0].checked =true;
	return;}
if ((w == 20) && (!document.getElementById("form3").cur_8_m[0].checked))  { 
	document.getElementById("form3").cur_8_m[0].checked = false;
	document.getElementById("form3").cur_9_t[0].checked = false;
	return;}
if ((w == 21) && (!document.getElementById("form3").cur_9_t[0].checked))  { 
	document.getElementById("form3").cur_8_m[0].checked = false;
	document.getElementById("form3").cur_9_t[0].checked = false;
	return;}


if ((w == 50) && (document.getElementById("form3").cur_8_m[2].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = true;
	document.getElementById("form3").cur_9_t[4].checked =true;
	document.getElementById("form3").cur_8_t[2].checked =true;	
	return;}
if ((w == 51) && (document.getElementById("form3").cur_9_t[4].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = true;
	document.getElementById("form3").cur_9_t[4].checked =true;
	document.getElementById("form3").cur_8_t[2].checked =true;		
	return;}
if ((w == 52) && (document.getElementById("form3").cur_8_t[2].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = true;
	document.getElementById("form3").cur_9_t[4].checked =true;
	document.getElementById("form3").cur_8_t[2].checked =true;		
	return;}
if ((w == 50) && (!document.getElementById("form3").cur_8_m[2].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = false;
	document.getElementById("form3").cur_9_t[4].checked = false;
	document.getElementById("form3").cur_8_t[2].checked = false;		
	return;}
if ((w == 51) && (!document.getElementById("form3").cur_9_t[4].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = false;
	document.getElementById("form3").cur_9_t[4].checked = false;
	document.getElementById("form3").cur_8_t[2].checked = false;		
	return;}
if ((w == 52) && (!document.getElementById("form3").cur_8_t[2].checked))  { 
	document.getElementById("form3").cur_8_m[2].checked = false;
	document.getElementById("form3").cur_9_t[4].checked = false;
	document.getElementById("form3").cur_8_t[2].checked = false;	
	return;}		

if ((w == 70) && (document.getElementById("form3").cur_8_m[3].checked))  { 
	document.getElementById("form3").cur_8_m[3].checked = true;
	document.getElementById("form3").cur_8_t[4].checked =true;
	return;}
if ((w == 71) && (document.getElementById("form3").cur_8_t[4].checked))  { 
	document.getElementById("form3").cur_8_m[3].checked = true;
	document.getElementById("form3").cur_8_t[4].checked =true;
	return;}
if ((w == 70) && (!document.getElementById("form3").cur_8_m[3].checked))  { 
	document.getElementById("form3").cur_8_m[3].checked = false;
	document.getElementById("form3").cur_8_t[4].checked = false;
	return;}
if ((w == 71) && (!document.getElementById("form3").cur_8_t[4].checked))  { 
	document.getElementById("form3").cur_8_m[3].checked = false;
	document.getElementById("form3").cur_8_t[4].checked = false;
	return;}
	
if ((w == 80) && (document.getElementById("form3").cur_9_m[3].checked))  { 
	document.getElementById("form3").cur_9_m[3].checked = true;
	document.getElementById("form3").cur_9_t[2].checked =true;
	return;}
if ((w == 81) && (document.getElementById("form3").cur_9_t[2].checked))  { 
	document.getElementById("form3").cur_9_m[3].checked = true;
	document.getElementById("form3").cur_9_t[2].checked =true;
	return;}
if ((w == 80) && (!document.getElementById("form3").cur_9_m[3].checked))  { 
	document.getElementById("form3").cur_9_m[3].checked = false;
	document.getElementById("form3").cur_9_t[2].checked = false;
	return;}
if ((w == 81) && (!document.getElementById("form3").cur_9_t[2].checked))  { 
	document.getElementById("form3").cur_9_m[3].checked = false;
	document.getElementById("form3").cur_9_t[2].checked = false;
	return;}
	
if ((w == 40) && (document.getElementById("form3").cur_8_t[0].checked))  { 
	alert("ESGOTADO");
//	document.getElementById("form3").cur_8_t[0].checked = true;
//	document.getElementById("form3").cur_9_m[0].checked =true;
	document.getElementById("form3").cur_8_t[0].checked = false;
	document.getElementById("form3").cur_9_m[0].checked = false;	
	return;}
if ((w == 41) && (document.getElementById("form3").cur_9_m[0].checked))  { 
	alert("ESGOTADO");
//	document.getElementById("form3").cur_8_t[0].checked = true;
//	document.getElementById("form3").cur_9_m[0].checked =true;
	document.getElementById("form3").cur_8_t[0].checked = false;
	document.getElementById("form3").cur_9_m[0].checked = false;	
	return;}
if ((w == 40) && (!document.getElementById("form3").cur_8_t[0].checked))  { 
	document.getElementById("form3").cur_8_t[0].checked = false;
	document.getElementById("form3").cur_9_m[0].checked = false;
	return;}
if ((w == 41) && (!document.getElementById("form3").cur_9_m[0].checked))  { 
	document.getElementById("form3").cur_8_t[0].checked = false;
	document.getElementById("form3").cur_9_m[0].checked = false;
	return;}
	
if ((w == 30) && (document.getElementById("form3").cur_8_t[1].checked))  { 
	document.getElementById("form3").cur_8_t[1].checked = true;
	document.getElementById("form3").cur_9_t[1].checked =true;
	return;}
if ((w == 31) && (document.getElementById("form3").cur_9_t[1].checked))  { 
	document.getElementById("form3").cur_8_t[1].checked = true;
	document.getElementById("form3").cur_9_t[1].checked =true;
	return;}
if ((w == 30) && (!document.getElementById("form3").cur_8_t[1].checked))  { 
	document.getElementById("form3").cur_8_t[1].checked = false;
	document.getElementById("form3").cur_9_t[1].checked = false;
	return;}
if ((w == 31) && (!document.getElementById("form3").cur_9_t[1].checked))  { 
	document.getElementById("form3").cur_8_t[1].checked = false;
	document.getElementById("form3").cur_9_t[1].checked = false;
	return;}

if ((w == 90) && (document.getElementById("form3").cur_8_t[3].checked))  { 
	document.getElementById("form3").cur_8_t[3].checked = true;
	document.getElementById("form3").cur_9_t[3].checked =true;
	return;}
if ((w == 91) && (document.getElementById("form3").cur_9_t[3].checked))  { 
	document.getElementById("form3").cur_8_t[3].checked = true;
	document.getElementById("form3").cur_9_t[3].checked =true;
	return;}
if ((w == 90) && (!document.getElementById("form3").cur_8_t[3].checked))  { 
	document.getElementById("form3").cur_8_t[3].checked = false;
	document.getElementById("form3").cur_9_t[3].checked = false;
	return;}
if ((w == 91) && (!document.getElementById("form3").cur_9_t[3].checked))  { 
	document.getElementById("form3").cur_8_t[3].checked = false;
	document.getElementById("form3").cur_9_t[3].checked = false;
	return;}		
}	
function letras(w) {  


document.getElementById("form3").letra.value = w;
document.getElementById("form3").fase.value = 1;

document.getElementById("form3").action = "pesquisar.asp";
document.getElementById("form3").submit()}

function letrasx(w) {  


document.getElementById("form4").letra.value = w;
document.getElementById("form4").fase.value = 1;

document.getElementById("form4").action = "inscritos.asp";
document.getElementById("form4").submit()}

function pesq_nome() {  

 if (alpha(document.getElementById("form3").nome.value)) {document.getElementById("form3").nome.focus();return} 
 if (document.getElementById("form3").nome.value.length < 4){alert('Nome para consulta mínimo 4 letras');document.getElementById("form3").nome.focus();return}
 
 document.getElementById("form3").fase.value = 2;

document.getElementById("form3").action = "pesquisar.asp";
document.getElementById("form3").submit()
 
}
function pesq_nomex() {  

 if (alpha(document.getElementById("form4").nome.value)) {document.getElementById("form4").nome.focus();return} 
 if (document.getElementById("form4").nome.value.length < 4){alert('Nome para consulta mínimo 4 letras');document.getElementById("form4").nome.focus();return}
 
 document.getElementById("form4").fase.value = 2;

document.getElementById("form4").action = "inscritos.asp";
document.getElementById("form4").submit()
 
} 
function letras1(w) {  
document.getElementById("form3").letra.value = w;
document.getElementById("form3").fase.value = 1;
document.getElementById("form3").action = "pesquisa_coordenador.asp";
document.getElementById("form3").submit()}

function pesq_nome1(w) {  
if (w == 1) { 
 if (alpha(document.getElementById("form3").nome.value)) {document.getElementById("form3").nome.focus();return} 
 if (document.getElementById("form3").nome.value.length < 4){alert('Nome para consulta mínimo 4 letras');document.getElementById("form3").nome.focus();return}
 
 document.getElementById("form3").fase.value = 2;

document.getElementById("form3").action = "pesquisa_coordenador.asp";
document.getElementById("form3").submit()}
if (w == 2) { 
 document.getElementById("form3").fase.value = 3;
 document.getElementById("form3").action = "pesquisa_coordenador.asp";
document.getElementById("form3").submit()}
} 
function mudar_categoria(w) {  

 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "detalhar_part_categoria.asp";
document.getElementById("form2").submit()
 
}
function alterar_categoria() {  

 if (document.getElementById("form3").fk_id_cat.value.length < 1) {alert("Favor selecionar a nova categoria");return} 
if ((document.getElementById("form3").fk_id_cat.value == 3)|| (document.getElementById("form3").fk_id_cat.value == 4)){
	if (document.getElementById("form3").fk_id_tms.value.length < 1) {alert("Favor selecionar a Área temática");return}}
document.getElementById("form3").action = "pesquisa_coordenador_update.asp";
document.getElementById("form3").submit()
 
}
function detalhar_part(w) {  

 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "detalhar_part.asp";
document.getElementById("form2").submit()
 
}
function detalhar_partx(w) {  

 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "detalhar_part_recep.asp";
document.getElementById("form2").submit()
 
} 
function boleto_alterar(w) {
 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "alterar_boleto.asp";
document.getElementById("form2").submit()
}

function boleto_baixar(w) {
 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "baixar_boleto.asp";
document.getElementById("form2").submit()
}

function boleto_incluir(w) {
 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "incluir_boleto.asp";
document.getElementById("form2").submit()
 
}


function boleto_excluir(w) {
if (!confirm("Atenção você está prestes a excluir o boleto, clique OK para confirmar a operação")) {return;}

 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "excluir_boleto.asp";
document.getElementById("form2").submit()
 
}

function excluir_inscricao(w) {
if (!confirm("Atenção você está prestes a excluir essa inscrição, clique OK para confirmar a operação")) {return;}

 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "excluir_inscricao.asp";
document.getElementById("form2").submit()
 
}

function mudar_opcao_inscricao(w) {
 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "muda_opcoes_inscricao.asp";
document.getElementById("form2").submit()
 
}
function mudar_opcao_inscricao_recep(w) {
 document.getElementById("form2").id_pto.value = w;

document.getElementById("form2").action = "muda_opcoes_inscricao_recep.asp";
document.getElementById("form2").submit()
 
}
function atualiza_boleto() { 
document.getElementById("form3").action = "alterar_boleto_update.asp";
document.getElementById("form3").submit()
 
}

function baixa_boleto() { 
document.getElementById("form3").action = "baixar_boleto.asp";
document.getElementById("form3").submit()
 
}

function baixa_boleto_update() { 
document.getElementById("form3").action = "baixar_boleto_update.asp";
document.getElementById("form3").submit()
 
}
function incluir_boleto_atua() { 
document.getElementById("form3").action = "incluir_boleto_update.asp";
document.getElementById("form3").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 muda_opcoes() {   
if (val_soc()) {return;}
if ((!document.getElementById("form3").cat_ins[0].checked) && (!document.getElementById("form3").cat_ins[1].checked) && (!document.getElementById("form3").cat_ins[2].checked)) {alert("Selecione uma das categorias");return;}
if ((!document.getElementById("form3").tip_ins[0].checked) && (!document.getElementById("form3").tip_ins[1].checked) && (!document.getElementById("form3").tip_ins[2].checked) && (!document.getElementById("form3").tip_ins[3].checked)) {alert("Informe o tipo de inscrição desejada");return}
if (val_tip_ins()) {return;} 
if ((!document.getElementById("form3").qtd_par[0].checked) && (!document.getElementById("form3").qtd_par[1].checked)) {alert("Informe se deseja ou não parcelamento.");return;}
document.getElementById("form3").action = "muda_opcoes_update.asp"
document.getElementById("form3").submit()
}
function muda_opcoes_cursos() {   
document.getElementById("form3").action = "muda_opcoes_cursos_update.asp"
document.getElementById("form3").submit()
}

function muda_opcoes2() {   
if (val_soc()) {return;}
if ((!document.getElementById("form3").cat_ins[0].checked) && (!document.getElementById("form3").cat_ins[1].checked) && (!document.getElementById("form3").cat_ins[2].checked)) {alert("Selecione uma das categorias");return;}
if ((!document.getElementById("form3").tip_ins[0].checked) && (!document.getElementById("form3").tip_ins[1].checked) && (!document.getElementById("form3").tip_ins[2].checked) && (!document.getElementById("form3").tip_ins[3].checked)) {alert("Informe o tipo de inscrição desejada");return}
if (val_tip_ins()) {return;} 
if ((!document.getElementById("form3").qtd_par[0].checked) && (!document.getElementById("form3").qtd_par[1].checked)) {alert("Informe se deseja ou não parcelamento.");return;}
document.getElementById("form3").action = "muda_opcoes_inscricao_update.asp"
document.getElementById("form3").submit()
}
function muda_opcoes3() {   
if (val_soc()) {return;}
if ((!document.getElementById("form3").cat_ins[0].checked) && (!document.getElementById("form3").cat_ins[1].checked) && (!document.getElementById("form3").cat_ins[2].checked)) {alert("Selecione uma das categorias");return;}
if ((!document.getElementById("form3").tip_ins[0].checked) && (!document.getElementById("form3").tip_ins[1].checked)) {alert("Informe o tipo de inscrição desejada");return}
//if (val_tip_ins()) {return;} 
//if ((!document.getElementById("form3").qtd_par[0].checked) && (!document.getElementById("form3").qtd_par[1].checked)) {alert("Informe se deseja ou não parcelamento.");return;}
document.getElementById("form3").action = "muda_opcoes_inscricao_recep_update.asp"
document.getElementById("form3").submit()
}
function ValidarAnexoXX() {
	if (document.frmAnexar.filAnexo.value == '') {
	alert('Você tem que selecionar um arquivo para ser anexado.')
	document.frmAnexar.filAnexo.focus();
}
else {
	
	document.frmAnexar.txtPath.value = document.frmAnexar.filAnexo.value;
	document.frmAnexar.action = "teste_envio.asp";
	document.frmAnexar.submit();
}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function pop_up_apre(){ 
windowqt = window.open("apresenta_pop.asp", "Arquivo","toolbar=no,location=no,status=no,screenX=1,screenY=1,menubar=no,width=600,height=400, resizable=yes,scrollbars=yes");
windowqt.focus();}

function enviar_apresenta(w) {
 	document.getElementById("form2").id_pto.value = w;
  	document.getElementById("form2").action = "enviar_apresenta.asp";
  	document.getElementById("form2").submit()
}
