//ELEIÇÕES 2008

function validaForm_ELEICOES2008(){	
	
	if($F('cboCargo')=='11'){
		window.location='eleicoesPrefeito2008.cfm?municipio='+$F('cboMunicipio')+'&turno='+$F('cboTurno')+'&eleito='+$F('rdoLista');
	}
	else if($F('cboCargo')=='13'){
		window.location='eleicoesVereador2008.cfm?municipio='+$F('cboMunicipio')+'&turno='+$F('cboTurno')+'&eleito='+$F('rdoLista');
		}
    else{
		window.location='eleicoesResumo2008.cfm?municipio='+$F('cboMunicipio')+'&turno='+$F('cboTurno')+'&eleito='+$F('rdoLista');}		
	/**/
}


// NOTICIAS.CFM

function chamaCarregaConteudo(hidInicio){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnResultadoBusca',txtPalavra+','+txtDtIni+','+txtDtFim+','+hidInicio,'ajaxPortal.cfm');
}

// CONTADOR
function chamaAjaxAcesso(){	
	if (!eNulo($('chkIndex')) && $('chkIndex').checked) var chkIndex=0; else chkIndex=1;
	if (!eNulo($('chkIndex')) && document.all.rdoIPs[0].checked) var rdoIPs=1;
	if (!eNulo($('chkIndex')) && document.all.rdoIPs[1].checked) var rdoIPs=2;
	if (!eNulo($('chkIndex')) && document.all.rdoIPs[2].checked) var rdoIPs=3;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;	
carregaConteudo('spnAcessoPortal',chkIndex+'$$'+rdoIPs+'$$'+txtDtIni+'$$'+txtDtFim,'ajaxPortal.cfm');
}

// PROPOSICOES.CFM

function chamaAjax(){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('cboTipo'))) var cboTipo=0; else cboTipo=$('cboTipo').value;
	var cboDeputado=$('cboDeputado').value;
	carregaConteudo('spnProposicao','0$$'+cboDeputado+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+txtNumero+'$$'+cboTipo,'ajaxPortal.cfm');
}
/*
function chamaAjax(){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	var cboDeputado=$('cboDeputado').value;
	carregaConteudo('spnProposicao','0$$'+cboDeputado+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim,'ajaxPortal.cfm');
}
*/
// SESSÕES PLENARÁRIAS
function chamaAjaxSessaoPlenaria(hidInicio){
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('cboAno'))) var cboAno=0; else cboAno=$('cboAno').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	if (eNulo($('cboTipoSessao'))) var cboTipoSessao=0; else cboTipoSessao=$('cboTipoSessao').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnSessoesPlenaria',txtNumero+'$$'+cboAno+'$$'+cboTipoSessao+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+$('hidInicio').value,'ajaxPortal.cfm');
}

// SESSÕES FREQUENCIA
function chamaAjaxSessaoFrequencia(hidInicio){
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('cboAno'))) var cboAno=0; else cboAno=$('cboAno').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	if (eNulo($('cboTipoSessao'))) var cboTipoSessao=0; else cboTipoSessao=$('cboTipoSessao').value;
	//if (eNulo($('cboDeputado'))) var cboDeputado=0; else cboDeputado=$('cbodeputado').value;
	cboDeputado=0;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnSessoesFrequencia',txtNumero+'$$'+cboAno+'$$'+cboTipoSessao+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+cboDeputado+'$$'+$('hidInicio').value,'ajaxPortal.cfm');
}



// TRANSPARENCIAVERBA.CFM

function chamaAjaxVerba(){
	if (eNulo($('cboDeputado'))) var cboDeputado=0; else cboDeputado=$('cboDeputado').value;
	if (eNulo($('cboCategoria'))) var cboCategoria=0; else cboCategoria=$('cboCategoria').value;
	if (eNulo($('cboMes'))) var cboMes=0; else cboMes=$('cboMes').value;
	if (eNulo($('cboAno'))) var cboAno=0; else cboAno=$('cboAno').value;
	
	carregaConteudo('spnVerba',cboDeputado+','+cboCategoria+','+cboMes+','+cboAno,'ajaxPortal.cfm');
}

// DISCURSO.CFM

function chamaAjaxDiscurso(hidInicio){
	var rdoTipo=0;
	for (i=0;i<document.all.rdoTipo.length;i++){
		if(document.all.rdoTipo[i].checked){
			rdoTipo=document.all.rdoTipo[i].value;
			}
		}
	
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnDiscursos',rdoTipo+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

//SESSOES.CFM

function chamaAjaxSessoes(hidInicio){	
	
	if (eNulo($('cboTipo'))) var cboTipo=0; else cboTipo=$('cboTipo').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnSessoes',cboTipo+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

// LICITACOES.CFM

function chamaAjaxLicita(hidInicio){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnResultadoBuscaLicitacao',txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

function chamaAjaxInforme(hidInicio){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;	
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	if (eNulo($('cboComissao'))) var cboComissao=0; else cboComissao=$('cboComissao').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnInforme',cboComissao+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

// ATOSDORH.CFM

function chamaAjaxAtos(hidInicio){
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnResultadoBuscaAto',txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

// PARECER
function chamaAjaxParecer(hidInicio){
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('cboComissao'))) var cboComissao=0; else cboComissao=$('cboComissao').value;
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	
	carregaConteudo('spnParecer','0$$'+cboComissao+'$$'+txtNumero+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

// ORDEMDODIA.CFM

function chamaAjaxOrdemDoDia(hidInicio){
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnResultadoBuscaOrdemDoDia','0$$'+txtNumero+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}

// PAUTA.CFM

function chamaAjaxPauta(hidInicio){
	if (eNulo($('txtNumero'))) var txtNumero=0; else txtNumero=$('txtNumero').value;
	if (eNulo($('txtPalavra'))) var txtPalavra=0; else txtPalavra=$('txtPalavra').value;
	if (eNulo($('txtDtIni'))) var txtDtIni=0; else txtDtIni=$('txtDtIni').value;
	if (eNulo($('txtDtFim'))) var txtDtFim=0; else txtDtFim=$('txtDtFim').value;
	$('hidInicio').value=hidInicio;
	carregaConteudo('spnResultadoBuscaPauta','0$$'+txtNumero+'$$'+txtPalavra+'$$'+txtDtIni+'$$'+txtDtFim+'$$'+hidInicio,'ajaxPortal.cfm');
}