// config da barra
var BarraNumero = 24;
var BarraCor1 = '#7F8DA8'; // cor clara
var BarraCor2 = '#667077'; // cor escura

/* scripts.js */
var UFCorrente="";
var idcidade="";
var turno1=((location.href.indexOf("1turno")>=0)?1:0);
var uf="";
var letra="";

/*Pega o estado corrente*/
if(turno1==1) UFCorrente=location.href.replace(/index\.jhtm/g,"").replace(/.*?\/2006\/placar\/1turno\/(..).*?$/g,"$1");
else UFCorrente=location.href.replace(/index\.jhtm/g,"").replace(/.*?\/2006\/placar\/(..).*?$/g,"$1");
if(UFCorrente.length>2)
  UFCorrente="";

// GetMethodParserJS ::: fermads @ uol ////
var L=location.href;
var d=L.substring(L.indexOf("?")+1);
var c=v=new Array(); c=d.split("&");
for(i=0;i<c.length&&c.length>0;i++) {
v=c[i].split("="); if(v.length>1)
eval(v[0]+"=unescape('"+v[1].replace(/\+/g," ")+"')");}

if(location.href.indexOf("cidades.jhtm")>=0) UFCorrente=uf;

function regiaoNome(codigo){
  r="";
  if(codigo=="CO") r="CENTRO-OESTE";
  else if(codigo=="NE") r="NORDESTE";
  else if(codigo=="N") r="NORTE";
  else if(codigo=="SE") r="SUDESTE";
  else if(codigo=="S") r="SUL";
  return "REGIÃO "+r;
}

/*Retorna nome dos estados apartir da sigla*/
function nomeUF(uf){
r="";
if(uf=="ac") r="Acre";
else if(uf=="al") r="Alagoas";
else if(uf=="ap") r="Amapá";
else if(uf=="am") r="Amazonas";
else if(uf=="ba") r="Bahia";
else if(uf=="ce") r="Ceará";
else if(uf=="df") r="Distrito Federal";
else if(uf=="es") r="Espírito Santo";
else if(uf=="go") r="Goiás";
else if(uf=="ma") r="Maranhão";
else if(uf=="mt") r="Mato Grosso";
else if(uf=="ms") r="Mato Grosso do Sul";
else if(uf=="mg") r="Minas Gerais";
else if(uf=="pa") r="Pará";
else if(uf=="pb") r="Paraíba";
else if(uf=="pr") r="Paraná";
else if(uf=="pe") r="Pernambuco";
else if(uf=="pi") r="Piauí";
else if(uf=="rj") r="Rio de Janeiro";
else if(uf=="rn") r="Rio Grande do Norte";
else if(uf=="rs") r="Rio Grande do Sul";
else if(uf=="ro") r="Rondônia";
else if(uf=="rr") r="Roraima";
else if(uf=="sc") r="Santa Catarina";
else if(uf=="sp") r="São Paulo";
else if(uf=="se") r="Sergipe";
else if(uf=="to") r="Tocantins";
return r;
}

/* Função para remover caracteres especiais */
function removerCaracteresEspeciais(s){
  reg = new RegExp("[!@#$%¨&*()´`^~{}º,<>:;?|'\"\\-=_+\\[\\]/\\\\]","g");
  s.value=s.value.replace(reg,"");
}

/* Lista de objetos XML por Cargo */
function retornaObjXml(cargo){
  r="";
  if(cargo==1) r="xmlPresidentes";
  else if(cargo==3) r="xmlGovernadores";
  else if(cargo==5) r="xmlSenadores";
  else if(cargo==6) r="xmlDepFederal";
  else if(cargo==7) r="xmlDepEstadual";
  else if(cargo==8) r="xmlDepDistrital";
  return r;
}

/* httprequest.js */
function loadXMLDoc(url){
  url = url.replace(/\/2006\//g,"/2006/placar/");
	var obj=this;
  var re = new RegExp("&","g");
	this.runFunctions="";
	
	function load(){
		obj.complete=0;
		if (window.XMLHttpRequest) obj.xmlhttp=new XMLHttpRequest();
		else if (window.ActiveXObject) obj.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if(obj.xmlhttp){
			obj.xmlhttp.onreadystatechange=function(){
				if (obj.xmlhttp.readyState==4){
          if (obj.xmlhttp.status==200){
  					obj.complete=1;
            if(obj.runFunctions!=""){
          		
              /* Checa XML caso seja inválido  */
              returnError=false;
              if (window.XMLHttpRequest){
                try{
                  returnError=new XMLSerializer().serializeToString(obj.xmlhttp.responseXML);
                  if(returnError.indexOf("parsererror")>=0) returnError=true;
                }
                catch (er) {}
              }else if (window.ActiveXObject){
                returnError=obj.xmlhttp.responseXML.parseError.errorCode;
                if(returnError!=0) returnError=true;
              }

              if(returnError==true) eval("Error"+unescape((obj.runFunctions.replace(re,"; Error"))));
              else eval(unescape((obj.runFunctions.replace(re,";"))));

  					}
				  }else{
            eval("Error"+unescape((obj.runFunctions.replace(re,"; Error"))));
          }
				}
			};
            d=new Date();

			//obj.xmlhttp.open("GET",url+((url.indexOf("?")>=0)?"&rtimestampobj="+d.getTime():"?rtimestampobj="+d.getTime()),true);
			obj.xmlhttp.open("GET",url,true);
			obj.xmlhttp.send(null);
		}
	}
	
	/*Metodo para executar funções especificas do XML*/
	this.run=runF;
	function runF(x){
		if (obj.complete==1){
			eval(x.replace(re,";"));
		}
		obj.runFunctions+=((obj.runFunctions!="")?"&":"")+escape(x);
	}
	
	/*Metodo para reload do XML*/
	this.reload=load;
	this.reload();

    //Metodo para exibir loading de XML
    
    this.showLoadingXML=loading;
    function loading(ob,id){
        var H_DIV_load=document.createElement("div");
        H_DIV_load.appendChild(document.createTextNode("loading..."));
        H_DIV_load.id=ob+"h_loading";
        H_DIV_load.className="XMLload";
        if(eval(ob+".xmlhttp.readyState")<4) {
            //quando descomentado o loading pisca
            eval("setTimeout(\""+ob+".showLoadingXML('"+ob+"','"+id+"');\",300);");
            if(document.getElementById(H_DIV_load.id)) document.getElementById(id).removeChild(document.getElementById(H_DIV_load.id));
            else document.getElementById(id).appendChild(H_DIV_load);
        }else {
            if(document.getElementById(H_DIV_load.id)) document.getElementById(id).removeChild(document.getElementById(H_DIV_load.id));
        }
    }
}

///////////////////////////////////////

/* readxml.js */

/* Parte do script para exibir os candidatos presidentes */
function ErrorexibirPresidentes(){
  document.getElementById('presidenteLoad').style.display="none";
  document.getElementById('pres').getElementsByTagName('div')[1].innerHTML="<span class='mensagem-erro'>Informação não disponível</span>";
}

function exibirPresidentes(){
  document.getElementById('localizacao').innerHTML="Brasil";

  if(xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirPresidentes();
    return false;
  }

  document.getElementById('dataAtualizacao').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('tse')[0].getAttribute('dataGeracao')+" - "+xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('tse')[0].getAttribute('horaGeracao');
  document.getElementById('VotosApuradosNumero').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('comparecimento');
  document.getElementById('VotosApuradosPorcentagem').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('votosApuradosPorcentagem')+"%";
  document.getElementById('barraVotosApurados').style.width=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('votosApuradosGrafico')+"%";
  document.getElementById('UrnasApuradasNumero').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('secoesApuradas');
  document.getElementById('UrnasApuradasPorcentagem').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('secoesApuradasPorcentagem')+"%";
  document.getElementById('barraUrnasApuradas').style.width=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('secoesApuradasGrafico')+"%";
  document.getElementById('AbstencoesPorcentagem').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('abstencoesPorcentagem')+"%";
  document.getElementById('AbestencoesNumero').innerHTML=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('abstencoes');

      HTMLpresidentes=""+
        "		  <table cellspacing=\"0\">"+
        "			  <thead>"+
        "			  	<tr><td colspan=\"3\">PRESIDENTE</td></tr>"+
        "					<tr><th class=\"col1\">Candidato</th><th nowrap>Nº de votos</th><th>(em %)</th></tr>"+
        "			  </thead>"+
        "				<tbody>";
      Presidente=xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('presidente')[0];
      PresidenteCandidato=Presidente.getElementsByTagName('candidato');
      PresidentesCount=PresidenteCandidato.length;
      for(var i=0;i<PresidentesCount;i++){
        if((i==0 && PresidenteCandidato[i].getAttribute('posicao')=="1") || (i==1 && PresidenteCandidato[i].getAttribute('posicao')=="2")){
          situacaoCandidato="";
          if(PresidenteCandidato[i].getAttribute('situacao')=="") situacaoCandidato=eleitoMatematicamente(Presidente.getAttribute('votosValidos'),Presidente.getAttribute('votosApurados'),Presidente.getAttribute('votosApuradosPorcentagem'),Presidente.getAttribute('abstencoes'),PresidenteCandidato[i].getAttribute('votos'),"BR",PresidenteCandidato[i].getAttribute('id'));
        }
        HTMLpresidentes+="<tr><td class=\"col1 nome\"><div class=\"posicao\"><strong>"+PresidenteCandidato[i].getAttribute('posicao')+".</strong></div> "+PresidenteCandidato[i].getAttribute('nomeUrna').toLowerCase()+" - "+PresidenteCandidato[i].getAttribute('partido')+
        (((i==0 && PresidenteCandidato[i].getAttribute('situacao')=="") || (i==1 && PresidenteCandidato[i].getAttribute('situacao')==""))?situacaoCandidato:situacaoImg(PresidenteCandidato[i].getAttribute('situacao')))+
        "</td><td>"+PresidenteCandidato[i].getAttribute('votos')+"</td><td>"+PresidenteCandidato[i].getAttribute('votosPorcentagem')+"</td></tr>";
      }
      HTMLpresidentes+=""+
        "<tr class=\"validos\"><td class=\"col1\">Votos válidos apurados</td><td>"+Presidente.getAttribute('votosValidos')+"</td><td></td></tr>"+
        "			</tbody>"+
      	"			<tfoot>"+
        "  			<tr class=\"espaco\"><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>"+
      	"				<tr><td class=\"col1\">Brancos</td><td>"+Presidente.getAttribute('votosBranco')+"</td><td>"+Presidente.getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
      	"				<tr><td class=\"col1\">Nulos</td><td>"+Presidente.getAttribute('votosNulo')+"</td><td>"+Presidente.getAttribute('votosNuloPorcentagem')+"</td></tr>"+
        "  			<tr class=\"validos\"><td class=\"col1\">Total de votos apurados</td><td>"+xmlPresidentes.xmlhttp.responseXML.getElementsByTagName('total')[0].getAttribute('votosApurados')+"</td><td>"+Presidente.getAttribute('votosApuradosPorcentagem')+"</td></tr>"+
      	"				<tr><td class=\"col1\">Abstenções</td><td>"+Presidente.getAttribute('abstencoes')+"</td><td>"+Presidente.getAttribute('abstencoesPorcentagem')+"</td></tr>"+
      	"			</tfoot>"+
      	"		</table>";  	

  document.getElementById('pres').getElementsByTagName('div')[1].innerHTML=HTMLpresidentes;
  
  document.getElementById('presidenteLoad').style.display="none";
}

/* Parte do script para exibir os candidatos a governador */
function ErrorexibirGovernadores(){
  document.getElementById('governadorLoad').style.display="none";
  document.getElementById('regioes').getElementsByTagName('div')[1].innerHTML="<span class='mensagem-erro'>Informação não disponível</span>";
}

function exibirGovernadores(){
  regioesXML=xmlGovernadores.xmlhttp.responseXML.getElementsByTagName('regiao');
  for(var i=0;i<regioesXML.length;i++){
    HTMLgovernadores="";
    HTMLgovernadores+=""+
  		"<table cellspacing=\"1\">"+
  		"<thead>"+
  		"	<tr><th class=\"amEscuro\">"+regiaoNome(regioesXML[i].getAttribute('codigo'))+"</th><th class=\"col2\">Classificação</th><th class=\"col3\">Nº de votos *</th><th class=\"col4\">(em %)</th></tr>"+
  		"</thead>"+
  		"<tbody>";
      estados=regioesXML[i].getElementsByTagName('estado');
      if(estados.length==0){
        HTMLgovernadores+="<tr><td class=\"cor1\" colspan=\"4\"><span class='mensagem-erro'>Informação não disponível</span></td></tr>";
      }else{
        for(var j=0;j<estados.length;j++){
          if(estados[j].getAttribute('votosApuradosPorcentagem')=="0,00" || estados[j].getAttribute('votosApuradosPorcentagem')=="00,00"){
            HTMLgovernadores+="<tr class=\"cor"+((j%2==0)?1:2)+"\"><td class=\"nomeEstado\"><h3>"+nomeUF(estados[j].getAttribute('codigo').toLowerCase())+"</h3></td><td colspan=\"3\"><span class='mensagem-erro'>Informação não disponível</span></td></tr>";
          }else{
            HTMLgovernadores+="<tr class=\"cor"+((j%2==0)?1:2)+"\"><td rowspan=\""+((turno1==1)?3:2)+"\" class=\"nomeEstado\"><div class=\"nomeEstadoConteudo\"><h3><a href=\""+estados[j].getAttribute('codigo').toLowerCase()+"/index.jhtm\">"+nomeUF(estados[j].getAttribute('codigo').toLowerCase())+"</a></h3><div class=\"barraPorcentagem\"><div class=\"barraBorda\"></div><div id=\"barraVotosApurados\" class=\"barraBg\" style=\"width:"+estados[j].getAttribute('votosApuradosGrafico')+"%\"></div></div><div class=\"porcentagem\">"+estados[j].getAttribute('votosApuradosPorcentagem')+"% dos votos apurados</div></div></td>";
            candidatos=estados[j].getElementsByTagName('candidato');
            for(var k=0;k<((turno1==1)?candidatos.length:2);k++){
              situacaoCandidato="";
              if((k==0 && candidatos[k].getAttribute('posicao')=="1") || (k==1 && candidatos[k].getAttribute('posicao')=="2")){
                situacaoCandidato=eleitoMatematicamente(estados[j].getAttribute('votosValidos'),estados[j].getAttribute('votosApurados'),estados[j].getAttribute('votosApuradosPorcentagem'),estados[j].getAttribute('abstencoes'),candidatos[k].getAttribute('votos'),estados[j].getAttribute('codigo'),candidatos[k].getAttribute('id'));
              }
              HTMLgovernadores+=((k>0)?"<tr class=\"cor"+((j%2==0)?1:2)+"\">":"")+"<td class=\"nome\"><strong>"+candidatos[k].getAttribute('posicao')+"</strong> - "+candidatos[k].getAttribute('nomeUrna').toLowerCase()+" - "+candidatos[k].getAttribute('partido')+
              //(((k==0 && candidatos[k].getAttribute('situacao')=="") || (k==1 && candidatos[k].getAttribute('situacao')==""))?situacaoCandidato:situacaoImg(candidatos[k].getAttribute('situacao')))+
              situacaoCandidato+
              "</td><td class=\"col3\">"+candidatos[k].getAttribute('votos')+"</td><td class=\"col4\">"+candidatos[k].getAttribute('votosPorcentagem')+"</td></tr>";
            }
          }
        }
      }
    HTMLgovernadores+="</tbody></table>";
    eval("regiao"+regioesXML[i].getAttribute('codigo')+"=HTMLgovernadores;");
  }
  document.getElementById('governadorLoad').style.display="none";
  document.getElementById('regioes').style.height="";
  document.getElementById('regioes').getElementsByTagName('div')[1].innerHTML=regiaoSE+regiaoS+regiaoNE+regiaoCO+regiaoN;

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }

}


/*readxml-estados.js*/

/* Monta paginação de qualquer cargo */
function montarPaginacao(total,atual,cargo,partido){
  total=parseFloat(total);
  atual=parseFloat(atual);
  paginasHTML="";
  if(total>1){
        if(typeof(busca)=='undefined') busca=0;
        paginasHTML=((atual<total)?"<a class=\"proxima\" href=\"javascript:mudarDePagina("+cargo+","+(atual+1)+",'"+partido+"')\">próxima</a>":"") + ((atual>1 && total>1)?"<a class=\"anterior\" href=\"javascript:mudarDePagina("+cargo+","+(atual-1)+",'"+partido+"')\">anterior</a>":"");
        paginasHTML+="<div class=\"paginas\">";
        loopInicio=1;
        loopFim=((total>10)?10:total);
        if(total>10 && atual>=5){
          loopInicio=atual-4;
          loopFim=atual+5;
          if(loopFim>total) loopFim=total;
        }
        for(var i=loopInicio;i<=loopFim;i++) paginasHTML+="<a href=\"javascript:mudarDePagina("+cargo+","+i+",'"+partido+"')\""+((i==atual)?" class=\"sel\"":"")+">"+i+"</a>";
        paginasHTML+="</div>";
  }else{
    paginasHTML="&nbsp;";
  }
  return paginasHTML;
}

/* Função para mudar de página */
function mudarDePagina(cargo,pagina,partido){
      if(partido==0 || partido==1){
        eval(retornaObjXml(cargo)+((partido==1)?"partido":"")+" = new loadXMLDoc(\"/2006/1turno/xml/"+UFCorrente+"/"+((idcidade!="")?idcidade+"/"+UFCorrente+"-"+idcidade:UFCorrente)+"-c"+cargo+((partido==1)?"p":"")+"-p"+pagina+".xml\");\n"+
        retornaObjXml(cargo)+((partido==1)?"partido":"")+".run(\"exibir"+retornaObjXml(cargo)+((partido==1)?"partido":"")+"()\");");
      }else{
        buscaMudaPagina=partido.split('|');
        xmlBuscanameOrNumber=buscaMudaPagina[1];
        xmlBuscapositionNumber=cargo;
        xmlBuscaoffset=(xmlBuscahits*(pagina-1))+1;
        defineBoxesBusca();
        document.getElementById(xmlBuscaDIVload).style.display="block";
        realXmlBuscaCandidatos();
      }
}

/* Função para alternar exibição de candidatos ou partidos */
function mudarExibicao(cargo,tipo){
  if(tipo=='ca'){
      eval(retornaObjXml(cargo)+" = new loadXMLDoc(\"/2006/1turno/xml/"+UFCorrente+"/"+((idcidade!="")?idcidade+"/"+UFCorrente+"-"+idcidade:UFCorrente)+"-c"+cargo+"-p1.xml\");\n"+
      retornaObjXml(cargo)+".run(\"exibir"+retornaObjXml(cargo)+"()\");");
  }else if(tipo=='pa') {
      eval(retornaObjXml(cargo)+"partido = new loadXMLDoc(\"/2006/1turno/xml/"+UFCorrente+"/"+((idcidade!="")?idcidade+"/"+UFCorrente+"-"+idcidade:UFCorrente)+"-c"+cargo+"p-p1.xml\");\n"+
      retornaObjXml(cargo)+"partido.run(\"exibir"+retornaObjXml(cargo)+"partido()\");");
  }
}

/* Monta a busca de candidatos */
var xmlBuscaCandidatos;
var xmlBuscaoffset=1;
var xmlBuscahits=10;
var xmlBuscanameOrNumber;
var xmlBuscapositionNumber;

var xmlBuscaDIVload="";
var xmlBuscaDIVbox="";

function defineBoxesBusca(){
    if(xmlBuscapositionNumber==5){
      xmlBuscaDIVload="senadorLoad";
      xmlBuscaDIVbox="boxSen";
    }else if(xmlBuscapositionNumber==6){
      xmlBuscaDIVload="depfederalLoad";
      xmlBuscaDIVbox="boxFed";
    }else if(xmlBuscapositionNumber==7 || xmlBuscapositionNumber==8){
      xmlBuscaDIVload="DepEstadualLoad";
      xmlBuscaDIVbox="boxEst";
    }
}

function executarBuscaCandidatos(f,cargo){
  if(f.nameOrNumber.value==false || f.nameOrNumber.value=="Nome ou N° do candidato"){
    alert('Informe um nome ou um número de candidato válido');
  }else{
    xmlBuscanameOrNumber=f.nameOrNumber.value;
    xmlBuscapositionNumber=cargo;
    xmlBuscaoffset=1;
    defineBoxesBusca();

    document.getElementById(xmlBuscaDIVload).style.display="block";
    realXmlBuscaCandidatos();
  }
}

function realXmlBuscaCandidatos(){
  xmlBuscaCandidatos=new loadXMLDoc("/buscarPosicaoCandidato.html?offset="+xmlBuscaoffset+"&hits="+xmlBuscahits+"&positionNumber="+xmlBuscapositionNumber+"&partyNumber=&state="+UFCorrente+"&nameOrNumber="+xmlBuscanameOrNumber+((idcidade!="")?"&city="+idcidade:""));
  xmlBuscaCandidatos.run("exibirxmlBuscaCandidatos()");
}

/* Função para encontrar a pagina correspondente do candidato buscado */
function buscaAbrePagina(pagina,cargo,id){
  eval(retornaObjXml(cargo)+" = new loadXMLDoc(\"/2006/1turno/xml/"+UFCorrente+"/"+((idcidade!="")?idcidade+"/"+pagina:pagina)+".xml\");\n"+
  retornaObjXml(cargo)+".run(\"exibir"+retornaObjXml(cargo)+"("+id+")\");");
}

/*Função para exibir regua das letras das cidades e lista de cidades de uma letra*/
function ErrorexibirxmlCidades(){

}

function exibirxmlCidades(){

  outrasCidades=xmlCidades.xmlhttp.responseXML;
  letras=outrasCidades.getElementsByTagName('outras')[0].getAttribute('letras');
  HTMLletras="<table id=\"regua\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
  LetraAtual=0;
  for(var i=0;i<letras.length;i++){
    if(letras.substring(i,i+1)>letra && LetraAtual==0){
      LetraAtual=1;
      HTMLletras+="<td id=\"sel\"><a href=\"/2006/placar/"+((turno1==1)?"1turno/":"")+"cidades.jhtm?uf="+uf+"&letra="+letra+"\">"+letra+"</a></td>";
    }
    HTMLletras+="<td"+((letras.substring(i,i+1)==letra)?" id=\"sel\"":"")+"><a href=\"/2006/placar/"+((turno1==1)?"1turno/":"")+"cidades.jhtm?uf="+uf+"&letra="+letras.substring(i,i+1)+"\">"+letras.substring(i,i+1)+"</a></td>";
  }
  if(LetraAtual==0) HTMLletras+="<td id=\"sel\"><a href=\"/2006/placar/"+((turno1==1)?"1turno/":"")+"cidades.jhtm?uf="+uf+"&letra="+letra+"\">"+letra+"</a></td>";
  HTMLletras+="</tr></table>";
  document.getElementById('letrasReguas').innerHTML=HTMLletras;

  cidadesLista=outrasCidades.getElementsByTagName('cidade');
  cidadesQtPorColuna=Math.floor(cidadesLista.length/3)+((cidadesLista.length%3>0)?1:0);
  
  HTMLcidades="<ul>";
  for(var i=0;i<cidadesLista.length;i++){
    if(i%cidadesQtPorColuna==0) HTMLcidades+="</ul>\n\n<ul>";
    HTMLcidades+="<li"+((i%2==0)?" class=\"cinza\"":"")+"><a href=\"/2006/placar/"+((turno1==1)?"1turno/":"")+uf+"/index.jhtm?idcidade="+cidadesLista[i].getAttribute('id')+"\">"+(cidadesLista[i].getAttribute('nome').toLowerCase())+"</a></li>";
  }
  HTMLcidades+="</ul><br clear=\"all\">";
  
  document.getElementById('listaOutrasCidades').innerHTML=HTMLcidades;

}

/* Função para selecionar cidade */
function nivelCidade(id){
  if(id=='estado'){
    document.location="/2006/placar/"+((turno1==1)?"1turno/":"")+UFCorrente.toLowerCase()+"/index.jhtm";
  }else if(id.length>1){
    document.location="?idcidade="+id;
  }else if(id.length==1){
    document.location="/2006/placar/"+((turno1==1)?"1turno/":"")+"cidades.jhtm?uf="+UFCorrente+"&letra="+id;
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os candidatos a governador */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlGovernadores(){
  document.getElementById('governadorLoad').style.display="none";
  document.getElementById('boxGov').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">GOVERNADOR</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlGovernadores(){
  XG=xmlGovernadores.xmlhttp.responseXML;
  if(XG.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlGovernadores();
    return false;
  }
  document.getElementById('localizacao').innerHTML="<a href=\"/2006/placar/"+UFCorrente+"/index.jhtm\">"+nomeUF(UFCorrente)+"</a>"+((idcidade!="")?" &gt; "+XG.getElementsByTagName('tse')[0].getAttribute('cidade').toLowerCase():"");
  document.getElementById('dataAtualizacao').innerHTML=XG.getElementsByTagName('tse')[0].getAttribute('dataGeracao')+" - "+XG.getElementsByTagName('tse')[0].getAttribute('horaGeracao');
  document.getElementById('VotosApuradosNumero').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('comparecimento');
  document.getElementById('VotosApuradosPorcentagem').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('votosApuradosPorcentagem')+"%";
  document.getElementById('barraVotosApurados').style.width=XG.getElementsByTagName('total')[0].getAttribute('votosApuradosGrafico')+"%";
  document.getElementById('UrnasApuradasNumero').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('secoesApuradas');
  document.getElementById('UrnasApuradasPorcentagem').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('secoesApuradasPorcentagem')+"%";
  document.getElementById('barraUrnasApuradas').style.width=XG.getElementsByTagName('total')[0].getAttribute('secoesApuradasGrafico')+"%";
  document.getElementById('AbstencoesPorcentagem').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('abstencoesPorcentagem')+"%";
  document.getElementById('AbestencoesNumero').innerHTML=XG.getElementsByTagName('total')[0].getAttribute('abstencoes');

    HTMLgovernadores=""+
    	"  <table cellspacing=\"1\">"+
  		"	  <thead>"+
  		"	  	<tr><td colspan=\"3\">GOVERNADOR</td></tr>"+
  		"			<tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr>"+
  		"	  </thead>"+
  		"		<tbody>";
      governadores=XG.getElementsByTagName('governadores')[0].getElementsByTagName('candidato');
      votosAnterior=0;
      for(var i=0;i<governadores.length;i++){
        situacaoCandidato="";
        if((i==0 && governadores[i].getAttribute('posicao')=="1") || (i==1 && governadores[i].getAttribute('posicao')=="2")){
          situacaoCandidato=eleitoMatematicamente(XG.getElementsByTagName('total')[0].getAttribute('votosValidos'),XG.getElementsByTagName('total')[0].getAttribute('votosApurados'),XG.getElementsByTagName('total')[0].getAttribute('votosApuradosPorcentagem'),XG.getElementsByTagName('total')[0].getAttribute('abstencoes'),governadores[i].getAttribute('votos'),UFCorrente.toUpperCase(),governadores[i].getAttribute('id'));
        }
        HTMLgovernadores+="<tr><td class=\"col1 nome\"><div class=\"posicao\">"+((governadores[i].getAttribute('votos')!=votosAnterior)?"<strong>"+governadores[i].getAttribute('posicao')+". </strong>":"")+"</div>"+governadores[i].getAttribute('nomeUrna').toLowerCase()+" - "+governadores[i].getAttribute('partido')+
        //(((i==0 && governadores[i].getAttribute('situacao')=="") || (i==1 && governadores[i].getAttribute('situacao')==""))?situacaoCandidato:situacaoImg(governadores[i].getAttribute('situacao')))+
        situacaoCandidato+
        "</td><td>"+governadores[i].getAttribute('votos')+"</td><td>"+governadores[i].getAttribute('votosPorcentagem')+"</td></tr>";
        votosAnterior=governadores[i].getAttribute('votos');
      }
  
  		HTMLgovernadores+=""+
      	"	<tfoot>"+
        "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XG.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XG.getElementsByTagName('paginacao')[0].getAttribute('atual')),3,0)+"</div></td></tr>"+
  			"		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
  			"		<tr><td class=\"col1\">Brancos</td><td>"+XG.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XG.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
  			"		<tr><td class=\"col1\">Nulos</td><td>"+XG.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XG.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
  			"	</tfoot></table>";  

  document.getElementById('governadorLoad').style.display="none";
  document.getElementById('boxGov').getElementsByTagName('div')[1].innerHTML=HTMLgovernadores;
  document.getElementById('boxGov').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}


///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os Presidentes */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlPresidentes(){
  document.getElementById('presidenteLoad').style.display="none";
  document.getElementById('boxPre').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">PRESIDENTE</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlPresidentes(){
  XP=xmlPresidentes.xmlhttp.responseXML;

  if(XP.getElementsByTagName('total')[0].getAttribute('votosApurados')=="0"){
    ErrorexibirxmlPresidentes();
    return false;
  }

    HTMLpresidente=""+
  		"  <table cellspacing=\"1\">"+
  		"	  <thead>"+
  		"	  	<tr><td colspan=\"3\">PRESIDENTE</td></tr>"+
  		"			<tr><th class=\"col1\">Candidato</th><th>Brasil(%)</th><th>"+((idcidade=="")?UFCorrente.toUpperCase():"Município")+"(%)</th></tr>"+
  		"	  </thead>"+
  		"		<tbody>";
    presidentes=XP.getElementsByTagName('presidente')[0].getElementsByTagName('candidato');
    votosAnterior=0;
    for(var i=0;i<presidentes.length;i++){
      if((i==0 && presidentes[i].getAttribute('posicao')=="1") || (i==1 && presidentes[i].getAttribute('posicao')=="2")){
        situacaoCandidato="";
        if(presidentes[i].getAttribute('situacao')=="") situacaoCandidato=eleitoMatematicamente(XP.getElementsByTagName('presidente')[0].getAttribute('votosValidos'),XP.getElementsByTagName('presidente')[0].getAttribute('votosApurados'),XP.getElementsByTagName('presidente')[0].getAttribute('votosApuradosPorcentagem'),XP.getElementsByTagName('presidente')[0].getAttribute('abstencoes'),presidentes[i].getAttribute('votos'),"BR",presidentes[i].getAttribute('id'));
      }
      HTMLpresidente+="<tr><td class=\"col1 nome\"><div class=\"posicao\">"+((presidentes[i].getAttribute('votos')!=votosAnterior)?"<strong>"+presidentes[i].getAttribute('posicao')+". </strong>":"")+"</div>"+presidentes[i].getAttribute('nomeUrna').toLowerCase()+" - "+presidentes[i].getAttribute('partido')+
      (((i==0 && presidentes[i].getAttribute('situacao')=="") || (i==1 && presidentes[i].getAttribute('situacao')==""))?situacaoCandidato:situacaoImg(presidentes[i].getAttribute('situacao')))+
      "</td><td>"+presidentes[i].getAttribute('votosBrasilPorcentagem')+"</td><td>"+presidentes[i].getAttribute('votosPorcentagem')+"</td></tr>";
      votosAnterior=presidentes[i].getAttribute('votos');
    }
  
  	HTMLpresidente+=""+
      "	<tfoot>"+
      "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XP.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XP.getElementsByTagName('paginacao')[0].getAttribute('atual')),6,0)+"</div></td></tr>"+
      "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
      "		<tr><td class=\"col1\">Brancos</td><td>"+XP.getElementsByTagName('presidente')[0].getAttribute('votosBranco')+"</td><td>"+XP.getElementsByTagName('presidente')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
      "		<tr><td class=\"col1\">Nulos</td><td>"+XP.getElementsByTagName('presidente')[0].getAttribute('votosNulo')+"</td><td>"+XP.getElementsByTagName('presidente')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
      "	</tfoot></table>";  

  document.getElementById('presidenteLoad').style.display="none";
  document.getElementById('boxPre').getElementsByTagName('div')[1].innerHTML=HTMLpresidente;
  document.getElementById('boxPre').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os senadores */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlSenadores(){
  document.getElementById('senadorLoad').style.display="none";
  document.getElementById('boxSen').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">SENADOR</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlSenadores(){
  BuscaExibi=0;
  if(arguments.length>0) BuscaExibi=arguments[0];
  XS=xmlSenadores.xmlhttp.responseXML;
  if(XS.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlSenadores();
    return false;
  }

  HTMLsenadores=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">SENADOR</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,5);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";

  senadores=XS.getElementsByTagName('senadores')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<senadores.length;i++){
    HTMLsenadores+="<tr><td class=\"col1 nome "+((BuscaExibi>0 && BuscaExibi==senadores[i].getAttribute('id'))?" sel":"")+"\"><div class=\"posicao\">"+((senadores[i].getAttribute('votos')!=votosAnterior)?"<strong>"+senadores[i].getAttribute('posicao')+". </strong>":"")+"</div>"+senadores[i].getAttribute('nomeUrna').toLowerCase()+" - "+senadores[i].getAttribute('partido')+situacaoImg(senadores[i].getAttribute('situacao'))+"</td><td>"+senadores[i].getAttribute('votos')+"</td><td>"+senadores[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=senadores[i].getAttribute('votos');
  }

	HTMLsenadores+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XS.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XS.getElementsByTagName('paginacao')[0].getAttribute('atual')),5,0)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XS.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XS.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XS.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XS.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('senadorLoad').style.display="none";
  document.getElementById('boxSen').getElementsByTagName('div')[1].innerHTML=HTMLsenadores;
  document.getElementById('boxSen').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados federais */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepFederal(){
  document.getElementById('depfederalLoad').style.display="none";
  document.getElementById('boxFed').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. FEDERAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepFederal(){
  BuscaExibi=0;
  if(arguments.length>0) BuscaExibi=arguments[0];
  XDF=xmlDepFederal.xmlhttp.responseXML;

  if(XDF.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepFederal();
    return false;
  }

  HTMLdepfederal=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. FEDERAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,6);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(6,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(6,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depfederais=XDF.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depfederais.length;i++){
    HTMLdepfederal+="<tr><td class=\"col1 nome "+((BuscaExibi>0 && BuscaExibi==depfederais[i].getAttribute('id'))?" sel":"")+"\"><div class=\"posicao\">"+((depfederais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depfederais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depfederais[i].getAttribute('nomeUrna').toLowerCase()+" - "+depfederais[i].getAttribute('partido')+situacaoImg(depfederais[i].getAttribute('situacao'))+"</td><td>"+depfederais[i].getAttribute('votos')+"</td><td>"+depfederais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depfederais[i].getAttribute('votos');
  }

	HTMLdepfederal+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDF.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDF.getElementsByTagName('paginacao')[0].getAttribute('atual')),6,0)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('depfederalLoad').style.display="none";
  document.getElementById('boxFed').getElementsByTagName('div')[1].innerHTML=HTMLdepfederal;
  document.getElementById('boxFed').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados federais - partidos */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepFederalpartido(){
  document.getElementById('depfederalLoad').style.display="none";
  document.getElementById('boxFed').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. FEDERAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepFederalpartido(){
  XDF=xmlDepFederalpartido.xmlhttp.responseXML;

  if(XDF.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepFederalpartido();
    return false;
  }

  HTMLdepfederal=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. FEDERAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,6);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(6,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(6,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depfederais=XDF.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depfederais.length;i++){
    HTMLdepfederal+="<tr><td class=\"col1 nome \"><div class=\"posicao\">"+((depfederais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depfederais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depfederais[i].getAttribute('partido')+"</td><td>"+depfederais[i].getAttribute('votos')+"</td><td>"+depfederais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depfederais[i].getAttribute('votos');
  }

	HTMLdepfederal+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDF.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDF.getElementsByTagName('paginacao')[0].getAttribute('atual')),6,1)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDF.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('depfederalLoad').style.display="none";
  document.getElementById('boxFed').getElementsByTagName('div')[1].innerHTML=HTMLdepfederal;
  document.getElementById('boxFed').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados estaduais */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepEstadual(){
  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. ESTADUAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepEstadual(){
  BuscaExibi=0;
  if(arguments.length>0) BuscaExibi=arguments[0];
  XDE=xmlDepEstadual.xmlhttp.responseXML;

  if(XDE.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepEstadual();
    return false;
  }

  HTMLdepestadual=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. ESTADUAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,7);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(7,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(7,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depestaduais=XDE.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depestaduais.length;i++){
    HTMLdepestadual+="<tr><td class=\"col1 nome "+((BuscaExibi>0 && BuscaExibi==depestaduais[i].getAttribute('id'))?" sel":"")+"\"><div class=\"posicao\">"+((depestaduais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depestaduais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depestaduais[i].getAttribute('nomeUrna').toLowerCase()+" - "+depestaduais[i].getAttribute('partido')+situacaoImg(depestaduais[i].getAttribute('situacao'))+"</td><td>"+depestaduais[i].getAttribute('votos')+"</td><td>"+depestaduais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depestaduais[i].getAttribute('votos');
  }

	HTMLdepestadual+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('atual')),7,0)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML=HTMLdepestadual;
  document.getElementById('boxEst').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados estaduais - partido*/
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepEstadualpartido(){
  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. ESTADUAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepEstadualpartido(){
  XDE=xmlDepEstadualpartido.xmlhttp.responseXML;

  if(XDE.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepEstadualpartido();
    return false;
  }

  HTMLdepestadual=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. ESTADUAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,7);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(7,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(7,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depestaduais=XDE.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depestaduais.length;i++){
    HTMLdepestadual+="<tr><td class=\"col1 nome \"><div class=\"posicao\">"+((depestaduais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depestaduais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depestaduais[i].getAttribute('partido')+"</td><td>"+depestaduais[i].getAttribute('votos')+"</td><td>"+depestaduais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depestaduais[i].getAttribute('votos');
  }

	HTMLdepestadual+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('atual')),7,1)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML=HTMLdepestadual;
  document.getElementById('boxEst').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados distrital */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepDistrital(){
  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. DISTRITAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepDistrital(){
  BuscaExibi=0;
  if(arguments.length>0) BuscaExibi=arguments[0];
  XDE=xmlDepDistrital.xmlhttp.responseXML;

  if(XDE.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepDistrital();
    return false;
  }

  HTMLdepestadual=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. DISTRITAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,8);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(8,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(8,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depestaduais=XDE.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depestaduais.length;i++){
    HTMLdepestadual+="<tr><td class=\"col1 nome "+((BuscaExibi>0 && BuscaExibi==depestaduais[i].getAttribute('id'))?" sel":"")+"\"><div class=\"posicao\">"+((depestaduais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depestaduais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depestaduais[i].getAttribute('nomeUrna').toLowerCase()+" - "+depestaduais[i].getAttribute('partido')+situacaoImg(depestaduais[i].getAttribute('situacao'))+"</td><td>"+depestaduais[i].getAttribute('votos')+"</td><td>"+depestaduais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depestaduais[i].getAttribute('votos');
  }

	HTMLdepestadual+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('atual')),8,0)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML=HTMLdepestadual;
  document.getElementById('boxEst').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir os deputados distrital - partido*/
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlDepDistritalpartido(){
  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">DEP. DISTRITAL</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlDepDistritalpartido(){
  XDE=xmlDepDistritalpartido.xmlhttp.responseXML;

  if(XDE.getElementsByTagName('total')[0].getAttribute('comparecimento')=="0"){
    ErrorexibirxmlDepDistritalpartido();
    return false;
  }

  HTMLdepestadual=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td colspan=\"3\"><div class=\"cargo\">DEP. DISTRITAL</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,8);return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"			<tr><th class=\"col1\"><form action=\"\" style=\"display:inline;\"><input name=\"tipo\" type=\"radio\" onclick=\"mudarExibicao(8,'ca')\" />Candidato&nbsp;<input name=\"tipo\" type=\"radio\" checked=\"checked\" onclick=\"mudarExibicao(8,'pa')\" />Partido</form></th><th>Votos</th><th>% válidos</th></tr>"+
		"	  </thead>"+
		"		<tbody>";
  depestaduais=XDE.getElementsByTagName('deputados')[0].getElementsByTagName('candidato');
  votosAnterior=0;
  for(var i=0;i<depestaduais.length;i++){
    HTMLdepestadual+="<tr><td class=\"col1 nome \"><div class=\"posicao\">"+((depestaduais[i].getAttribute('votos')!=votosAnterior)?"<strong>"+depestaduais[i].getAttribute('posicao')+". </strong>":"")+"</div>"+depestaduais[i].getAttribute('partido')+"</td><td>"+depestaduais[i].getAttribute('votos')+"</td><td>"+depestaduais[i].getAttribute('votosPorcentagem')+"</td></tr>";
    votosAnterior=depestaduais[i].getAttribute('votos');
  }

	HTMLdepestadual+=""+
    "	<tfoot>"+
    "		<tr><td class=\"paginacao\" colspan=\"3\">"+montarPaginacao(parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('total')),parseFloat(XDE.getElementsByTagName('paginacao')[0].getAttribute('atual')),8,1)+"</div></td></tr>"+
    "		<tr><th>&nbsp;</th><th>Votos</th><th>%</th></tr>"+
    "		<tr><td class=\"col1\">Brancos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBranco')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosBrancoPorcentagem')+"</td></tr>"+
    "		<tr><td class=\"col1\">Nulos</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNulo')+"</td><td>"+XDE.getElementsByTagName('total')[0].getAttribute('votosNuloPorcentagem')+"</td></tr>"+
    "	</tfoot></table>";

  document.getElementById('DepEstadualLoad').style.display="none";
  document.getElementById('boxEst').getElementsByTagName('div')[1].innerHTML=HTMLdepestadual;
  document.getElementById('boxEst').style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}


///////////////////////////////////////////////////////////////////////////////////////////////
/* Parte do script para exibir busca de candidatos */
///////////////////////////////////////////////////////////////////////////////////////////////

function ErrorexibirxmlBuscaCandidatos(){
  document.getElementById(xmlBuscaDIVload).style.display="none";
  document.getElementById(xmlBuscaDIVbox).getElementsByTagName('div')[1].innerHTML="<table cellspacing=\"1\"><thead><tr><td colspan=\"3\">"+
    ((xmlBuscapositionNumber==5)?"SENADOR":"")+
    ((xmlBuscapositionNumber==6)?"DEP. FEDERAL":"")+
    ((xmlBuscapositionNumber==7)?"DEP. ESTADUAL":"")+
    ((xmlBuscapositionNumber==8)?"DEP. DISTRITAL":"")+
  "</td></tr><tr><th class=\"col1\">Candidato</th><th>Votos</th><th>% válidos</th></tr></thead><tbody><tr><td class=\"col1\" colspan=\"3\">"+
  "<span class='mensagem-erro'>Informação não disponível</span>"+
  "</td></tr></tbody></table>";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

function exibirxmlBuscaCandidatos(){
  XB=xmlBuscaCandidatos.xmlhttp.responseXML;

  HTMLbusca=""+
		"  <table cellspacing=\"1\">"+
		"	  <thead>"+
		"	  	<tr><td><div class=\"cargo\">"+
    ((xmlBuscapositionNumber==5)?"SENADOR":"")+
    ((xmlBuscapositionNumber==6)?"DEP. FEDERAL":"")+
    ((xmlBuscapositionNumber==7)?"DEP. ESTADUAL":"")+
    ((xmlBuscapositionNumber==8)?"DEP. DISTRITAL":"")+
    "</div><div class=\"busca\"><form action=\"\" onsubmit=\"executarBuscaCandidatos(this,"+xmlBuscapositionNumber+");return false;\" name=\"busca\"><label>BUSCA</label><input type=\"text\" name=\"nameOrNumber\" value=\"Nome ou N° do candidato\" onfocus=\"this.value=''\" onkeyup=\"removerCaracteresEspeciais(this)\" /><input class=\"ok-button\" type=\"image\" src=\"http://el.i.uol.com.br/2006/placarapuracao/ok.gif\" /></form></div></td></tr> <!-- Manter na mesma linha -->"+
		"	  </thead>";
  
  if(XB.getElementsByTagName('erro')[0].getAttribute('tipo')==0){
    if(XB.getElementsByTagName('candidatos')[0].getElementsByTagName('candidato').length==1 && XB.getElementsByTagName('paginacao')[0].getAttribute('total')==1){
      buscaAbrePagina(XB.getElementsByTagName('candidatos')[0].getElementsByTagName('candidato')[0].getAttribute('pagina'),xmlBuscapositionNumber,XB.getElementsByTagName('candidatos')[0].getElementsByTagName('candidato')[0].getAttribute('id'));
      return false;
    }else{
      HTMLbusca+="		<tbody><tr><td class=\"buscaCandidatos\"><div class=\"frase\">Foram encontrados "+XB.getElementsByTagName('candidatos')[0].getAttribute('ocorrencias')+" resultados com <strong>\""+XB.getElementsByTagName('candidatos')[0].getAttribute('busca')+"\"</strong></div>";
      candidatos=XB.getElementsByTagName('candidatos')[0].getElementsByTagName('candidato');
      for(var i=0;i<candidatos.length;i++){
        HTMLbusca+="<a href=\"javascript:buscaAbrePagina('"+candidatos[i].getAttribute('pagina')+"',"+xmlBuscapositionNumber+","+candidatos[i].getAttribute('id')+");\" class=\"nome\">"+candidatos[i].getAttribute('nomeUrna').toLowerCase()+" - "+candidatos[i].getAttribute('partido')+"</a><br />";
      }
      HTMLbusca+="</td></tr></tbody><tfoot><tr><td class=\"paginacao\">"+montarPaginacao(XB.getElementsByTagName('paginacao')[0].getAttribute('total'),XB.getElementsByTagName('paginacao')[0].getAttribute('atual'),xmlBuscapositionNumber,'busca|'+XB.getElementsByTagName('candidatos')[0].getAttribute('busca'))+"</td></tr></tfoot></table>";
    }
  }else if(XB.getElementsByTagName('erro')[0].getAttribute('tipo')==1){
    HTMLbusca+="<tbody><tr><td class=\"buscaCandidatos\"><div class=\"frase\">Nenhum candidato foi encontrado</div></td></tr></tbody><tfoot><tr><td class=\"paginacao\"><a href=\"javascript:buscaAbrePagina('"+((idcidade!="")?UFCorrente+"-"+idcidade:UFCorrente)+"-c"+xmlBuscapositionNumber+"-p1',"+xmlBuscapositionNumber+",0)\" class=\"anterior\">voltar</td></tr></tfoot></table>";
  }

  document.getElementById(xmlBuscaDIVload).style.display="none";
  document.getElementById(xmlBuscaDIVbox).getElementsByTagName('div')[1].innerHTML=HTMLbusca;
  document.getElementById(xmlBuscaDIVbox).style.height="auto";

  if(typeof(setHeight)!="undefined"){
    document.getElementById('corpo').style.height="auto";
    setHeight('corpo');
  }
}

/*scripts-postload.js*/

// posiciona elementos na tela
function placePos(bId, pos, sum) {
	if(bFs != 0) document.getElementById(bId).style.top = (sum+pos)/bFs+'em';		
}

// mostra banners //
if(typeof(DErand)=="undefined") {
	var DEt=new Date(); DEt=DEt.getTime(); DErand=Math.floor(DEt*1000*Math.random());
}
var scw=0,sch=0; if(screen.height){scw=screen.width;sch=screen.height;}
function DEshow(ad,pos,sum){
	if(typeof(sum)=='undefined') sum=0;
	if(document.getElementById('banner-'+ad+'-area')) {
	document.write('<'+'scr'+'ipt type="text/javascript" src="http://bn.uol.com.br/js.ng/site='+DEsite+'&amp;chan='+DEchan+'&amp;subchan='+DEsubc+'&amp;affiliate='+DEsite+DEchan+'&amp;size='+ad+'&amp;page='+pos+'&amp;conntype='+DEconn+'&amp;expble='+Expble+'&amp;reso='+scw+'x'+sch+'&amp;tile='+DErand+'?"><\/scr'+'ipt>');
		if(ad!='1x1'&&ad!='300x250') placePos('banner-'+ad, findPos('banner-'+ad+'-area'), sum); // se não é popup, posiciona na tela
		}
}
