<!--

var arVersion = navigator.appVersion.split("MSIE") ;
var version = parseFloat(arVersion[1]) ;

if ((version >= 5.5) && (document.body.filters)) {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i] ;
		var imgName = img.src.toUpperCase() ;
	
		if ( (imgName.substring(imgName.length-3, imgName.length) == "PNG") && (img.className == "Tpng") ) {
			var imgID = (img.id) ? "id='" + img.id + "' " : "" ;
			var imgClass = (img.className) ? "class='" + img.className + "' " : "" ;
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " ;
			var imgStyle = "display:inline-block;" + img.style.cssText ;
		
			if (img.align == "left")
				imgStyle = "float:left;" + imgStyle ;

			if (img.align == "right")
				imgStyle = "float:right;" + imgStyle ;
	
			if (img.parentElement.href)
				imgStyle = "cursor:hand;" + imgStyle ;
	
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
	
			img.outerHTML = strNewHTML ;
			i = i-1
		}
	}
}

function TrocaClass() {
	var a=TrocaClass.arguments;

	for(i=0;i<=(a.length-2);i+=2) {
		objElem = document.getElementById(a[i]);
		objElem.className = a[i+1];
	}
}

function AbreSubMenu(op) {
	objMenu = document.getElementById("divSubMenu_" + op) ;
	
	if (condSubMenu[op] == "F") {
		objMenu.style.display = "block" ;
		condSubMenu[op] = "O" ;
	}
	else {
		objMenu.style.display = "none" ;
		condSubMenu[op] = "F" ;
	}
}

function SubMenu(id){
	objSubMenu = document.getElementById("divSubMenu_" + id);
	
    if (objSubMenu.style.display = "block"){
        objSubMenu.style.display = "none";
	}
    else {
        objSubMenu.style.display = "block";
	}
}

function mostraEsconde(divId){
	var alvo = document.getElementById(divId);
	if (alvo.style.display != "none"){
		alvo.style.display = "none";
	}
    else {
        alvo.style.display = "block";
	}
}

// AJAX
	try{
	xmlhttp = new XMLHttpRequest();}catch(ee){try{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
	catch(E){xmlhttp = false;}}}
	
function SelecionaFederacao() {
		xmlhttp.open("POST", "ajax_fed.asp?id=" + document.getElementById('federacoes').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ResultadoBusca').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('ResultadoBusca').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaFederacoes() {
		xmlhttp.open("POST", "ajax_feds.asp" ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ResultadoBusca').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('ResultadoBusca').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaPerfilM() {
	perfilMasc = document.getElementById('perfilM').value
	
	if (perfilMasc == ""){
		
	}
    else {
        xmlhttp.open("POST", "ajax_perfil.asp?id=" + perfilMasc ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ResultadoBusca').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('ResultadoBusca').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha')
	}
}

function SelecionaPerfilF() {
	perfilFem = document.getElementById('perfilF').value
	
	if (perfilFem == ""){
		
	}
    else {
        xmlhttp.open("POST", "ajax_perfil.asp?id=" + perfilFem ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ResultadoBusca').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('ResultadoBusca').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha')
	}
}

function SelecionaCalendario() {
	var selecao = document.getElementById("selecaoId").value
	self.location = "http://www.cbv.com.br/v1/selecao/calendario.asp?calendario=" + selecao
	
}

function SelecionaInformativo() {
		xmlhttp.open("POST", "informativo_" + document.getElementById('Arquivo').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('informativo').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('informativo').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaDecisoes() {
		xmlhttp.open("POST", "decisoes_" + document.getElementById('Arquivo').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('decisoes').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('decisoes').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}
function SelecionaCitacoes() {
		xmlhttp.open("POST", "citacoes_" + document.getElementById('Arquivo').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('citacoes').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('citacoes').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaArbitragem() {
		xmlhttp.open("POST", "arbitragem/" + document.getElementById('Arquivo').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('arbitragem').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('arbitragem').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaRankingSL() {
		xmlhttp.open("POST", "ranking_" + document.getElementById('Arquivo').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ranking').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('ranking').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaCalendarioMesProximo() {
	var mes = document.getElementById('mes').value
	var proximomes
	if (mes == "agosto08"){
	mes_selecionado = "setembro08"
	}
	else if (mes == "setembro08"){
	mes_selecionado = "outubro08"
	}
	else if (mes == "outubro08"){
	mes_selecionado = "novembro08"
	}
	else if (mes == "novembro08"){
	mes_selecionado = "dezembro08"
	}
	else if (mes == "dezembro08"){
	mes_selecionado = "dezembro08"
	}
		xmlhttp.open("POST", "calendario/" + mes_selecionado + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('divNavDiaMes').innerHTML = '<img src="imagens/loading.gif" title="Carregando..." alt="Carregando..."/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('divNavDiaMes').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaCalendarioMesAnterior() {
	var mes = document.getElementById('mes').value
	var proximomes
	if (mes == "agosto08"){
	mes_selecionado = "agosto08"
	}
	else if (mes == "setembro08"){
	mes_selecionado = "agosto08"
	}
	else if (mes == "outubro08"){
	mes_selecionado = "setembro08"
	}
	else if (mes == "novembro08"){
	mes_selecionado = "outubro08"
	}
	else if (mes == "dezembro08"){
	mes_selecionado = "novembro08"
	}
	
		xmlhttp.open("POST", "calendario/" + mes_selecionado + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('divNavDiaMes').innerHTML = '<img src="imagens/loading.gif" title="Carregando..." alt="Carregando..."/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('divNavDiaMes').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaCalendarioDia(dia_selecionado) {
	var mes = document.getElementById('mes').value
		xmlhttp.open("POST", "calendario/" + mes + "/" + dia_selecionado + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('divListaEventos').innerHTML = '<img src="imagens/loading.gif" title="Carregando..." alt="Carregando..."/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('divListaEventos').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function SelecionaCBS() {
		xmlhttp.open("POST", document.getElementById('calendario').value + ".asp",true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('divCalendario').innerHTML = 'Aguarde...'
		   if(xmlhttp.readyState == 4){
					document.getElementById('divCalendario').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('aloha') 
}

function MudaCBS(){
	pagina = document.getElementById("calendario").value
	self.location = pagina;
}

function BaixarBalanco(pdf_balanco){
	balanco = "http://www.cbv.com.br/v1/institucional/balancos/" + pdf_balanco
	window.open(balanco, "balanço")
}

function mctext(){
	lc = location.search.substring(1,location.search.length);
	if (lc.search("bsc=") >= 0) { 
   		inisel(lc.split('bsc=')[1]);
	} 
}

function inisel(lc){
	
	var tc1 = "<span class='highlight'>";
	var	tc2 = "</span>";
	var repl = "$1" + tc1 + "$2" + tc2 + "$3";

	bsc1 = lc.replace(/\+|\%20/gi, " ");
	var Re1 = new RegExp("([\\s\\>\\(']|&nbsp)(" + bsc1 + ")([\\)\\.\\<\\s,']|&nbsp)","gi");
	document.getElementById("divBuscada").innerHTML = document.getElementById("divBuscada").innerHTML.replace(Re1,repl);
}

//-->
