	// INICIA A CLASSE XMLHttpRequest DEPENDENDO DO TIPO DE BROWSER
    try{
        xmlhttp = new XMLHttpRequest();
    }catch(ee){
        try{
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
                xmlhttp = false;
            }
        }
    }



/*
FUNÇÃO QUE RETORNA STRING FORMATADA DA DATA LOCAL
NA PAGINA QUE FOR USADO COLOCAR: <script language="javascript" type="text/javascript">showData();</script> 
*/
function showData(){
	dia = new Date();
	ano = dia.getYear();
	if (ano < 2000){
		ano = 1900 + dia.getYear();
	}
	mes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro")
	dia_semana = new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado");
	document.writeln(dia_semana[dia.getDay()] + ", " + dia.getDate() + " de " +  mes[dia.getMonth()] + " de " + ano + "");
}


function openPub(cod,tipo){
	document.frmProcessa.location.href = "publicidade.abre.php?c="+cod+"&t="+tipo;
}

function fechaPublicidade(){
	tmp = document.getElementById('contentBannerExtra').style.display;
	if(tmp.length < 1 || tmp == 'inline'){
		document.getElementById('contentBannerExtra').style.display = 'none';
	} else {
		document.getElementById('contentBannerExtra').style.display	= 'inline';
	}
}


function openServico(cod){
	url 		= 'servicos.detalhes.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=350';
	janela		= 'imprimir';
    window.open(url,janela,parametros);
}

function imprime(cod, tipo){
	url 		= 'imprimir.materia.php?c='+cod+'&t='+tipo;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
	janela		= 'imprimir';
    window.open(url,janela,parametros);
}

function votar(cod){
	url 		= 'enquete.resultados.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=400';
	janela		= 'enquete';
    window.open(url,janela,parametros);
}

function envia(cod){
	url 		= 'enviar.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=450';
	janela		= 'boleto';
    window.open(url,janela,parametros);
}

function album(cod){
	url 		= 'album.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=550,height=550';
	janela		= 'album';
    window.open(url,janela,parametros);
}

function album2(cod){
	url 		= 'album2.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=550,height=550';
	janela		= 'album2';
    window.open(url,janela,parametros);
}

function albumPS(cod){
	url 		= 'albumPS.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=550,height=550';
	janela		= 'albumPS';
    window.open(url,janela,parametros);
}

function albumPromo(cod){
	url 		= 'albumPromo.php?c='+cod;
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=550,height=550';
	janela		= 'albumPromo';
    window.open(url,janela,parametros);
}

function concorrerPromo(cod){
	url = 'promocao.concorrer.php?c='+cod;
    window.frmProcessa.location.href = url;
}

function showContas(div,number){
		tmp = document.getElementById(div+'-'+number).style.display;
/*
		inicio = div.split('-');
		for(x in document.all){
			if(x.indexOf(inicio[0])>-1){
				document.getElementById(x).style.display = "none";
			 }
		}
*/

		inicio	= div.split('-');
		search	= inicio[0];
		obj	= document.getElementsByTagName("div")

		for(var x=0 ; x<obj.length ; x++){
			if(obj[x].id.indexOf(search)>-1){
				obj[x].style.display = "none";
			}
		}

		if(tmp == 'inline'){
			document.getElementById(div+'-'+number).style.display = "none";
		} else {
			document.getElementById(div+'-'+number).style.display = "inline";
		}
}






function verifTamanho(target){
		var dC;
		dC = document.frmComent;

		var StrLen;
		var corte;
		var nome;
		var adicional;
		var maximo;
		maximo = 1024;
		adicional = 0;  // Caracteres que serão adicionados para formatar a mensagem.
		StrLen = adicional;
		corte = StrLen;
		if (dC.COMENTARIO.value.length != "" ){
			StrLen = StrLen + dC.COMENTARIO.value.length;
		}
		if (StrLen == 1 && dC.COMENTARIO.value.substring(0,1) == " "){
        	dC.COMENTARIO.value = "";
			StrLen = StrLen - 1;
    	}
    	if (StrLen > maximo){
			dC.COMENTARIO.value = dC.COMENTARIO.value.substring(0,maximo-corte);
			StrLen = StrLen - 1;
		}
       dC.CHAR.value = maximo - StrLen;
}



function red(x,y){
		// para simular tela cheia numa determinada resolução ( X = x+8 ; Y = y-20 )
		var telaX = screen.width;
		var telaY = screen.height;
		var janelaX = x;
		var janelaY = y;
		window.resizeTo(janelaX,janelaY);
		window.moveTo(telaX/2-janelaX/2,(telaY/2-janelaY/2-14));//28pixel o menu inferior
}


/* ESCONDE BANNER */
hideBanner = function() {
	document.getElementById('bannerFloater').style.display	= 'none';
}





/* FUNCAO QUE ATUALIZA BANNER */

function startBanner(){
	timerID=setTimeout('swapBanner()',30000)
}

function startBannerFull(){
	timerID=setTimeout('swapBannerFull()',30000)
}

function swapBanner() {
	if(xmlhttp){
		var url="inc.banner.lateral.ajax.php";
		xmlhttp.open("GET", url,true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				resposta=xmlhttp.responseText
				document.getElementById('tblBanner').innerHTML = resposta;
			}
		}
		//Enquanto ocorre a conexao e busca, mostra o texto nos campos...
//		document.getElementById('tblBanner').innerHTML = "Aguarde...";
		xmlhttp.send(null)
	}else{
		//Caso o navegador nao suporte XMLHttpRequest
		window.location.reload()
		//alert("Seu navegador não suporta algumas funcionalidades deste site.")
	}




//	alert("5 seconds have elapsed since the button was clicked.")
	startBanner();
}

function swapBannerFull() {
	if(xmlhttp){
		var url="inc.banner.full.ajax.php";
		xmlhttp.open("GET", url,true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				resposta=xmlhttp.responseText
				document.getElementById('tblBannerFull').innerHTML = resposta;
			}
		}
		//Enquanto ocorre a conexao e busca, mostra o texto nos campos...
//		document.getElementById('tblBanner').innerHTML = "Aguarde...";
		xmlhttp.send(null)
	}else{
		//Caso o navegador nao suporte XMLHttpRequest
		window.location.reload()
		//alert("Seu navegador não suporta algumas funcionalidades deste site.")
	}




//	alert("5 seconds have elapsed since the button was clicked.")
	startBannerFull();
}


