//formata campos
function txtBoxFormat(objeto, sMask, evtKeyPress) {
var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;
if(document.all) { // Internet Explorer
nTecla = evtKeyPress.keyCode; }
else if(document.layers) { // Nestcape
nTecla = evtKeyPress.which;
}
sValue = objeto.value;
// Limpa todos os caracteres de formatação que
// já estiverem no campo.
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( " ", "" );
sValue = sValue.toString().replace( " ", "" );
fldLen = sValue.length;
mskLen = sMask.length;
i = 0;
nCount = 0;
sCod = "";
mskLen = fldLen;
while (i <= mskLen) {
bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))
if (bolMask) {
sCod += sMask.charAt(i);
mskLen++; }
else {
sCod += sValue.charAt(nCount);
nCount++;
}
i++;
}
objeto.value = sCod;
if (nTecla != 8) { // backspace
if (sMask.charAt(i-1) == "9") { // apenas números...
return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
else { // qualquer caracter...
return true;
} }
else {
return true;
}
}
contadorPausa=0;
function topo() {
	contadorPausa++;
	//if (contadorPausa<2) {
	varPausa="topo()";
	delayPausa = setTimeout(varPausa, 8000);
	mudaImg();
	//} else {
	//	clearTimeout(delayPausa);
	//}
}
zin=0;
atual="img1";
atual2="img3";
naoAtual="img2";
naoAtual2="img4";
function mudaImg() {
	zin++;
	document.getElementById(naoAtual).style.display="none";
	document.getElementById(naoAtual2).style.display="none";
	document.getElementById(atual).className="alpha10";
	document.getElementById(atual2).className="alpha10";
	document.getElementById(atual).style.display="block";	
	document.getElementById(atual2).style.display="block";
	alpha();
	document.getElementById(atual).zIndex=zin;	
	document.getElementById(atual2).zIndex=zin;	
	
	if (atual=="img1") {
		atual="img2";	
		naoAtual="img1";
		atual2="img4";	
		naoAtual2="img3";
	} else {
		atual="img1";	
		naoAtual="img2";
		atual2="img3";	
		naoAtual2="img4";
	}
}
cont=0;
function alpha() {
	cont++;
	varAlpha="alpha()";
	paradinha = setTimeout(varAlpha, 100);
	if (cont==1) {
		document.getElementById(naoAtual).className="alpha50";		
		document.getElementById(naoAtual2).className="alpha50";	
	}
	if (cont==2) {
		document.getElementById(naoAtual).className="alpha80";	
		document.getElementById(naoAtual2).className="alpha80";	
	}
	if (cont==3) {
		cont=0;
		document.getElementById(naoAtual).className="";	
		document.getElementById(naoAtual2).className="";	
		clearTimeout(paradinha);
	}
}
fundoAtual="noticia_img1";
fundoAnterior="noticia_img2";
fundoAnterior2="noticia_img3";
numero="um";
numeroant="tres";
numeroant2="dois";
textoAtivo="texto1";

function noticias(obj) {
	if (obj) {
		if (obj==2) {
			textoAtivo="texto2";
			fundoAtual="noticia_img2";
			numero="dois";
			numeroant="um";
			numeroant2="tres";
			fundoAnterior="noticia_img1";
			fundoAnterior2="noticia_img3";
		} else {
		if (obj==3)  {
			textoAtivo="texto3";
			fundoAtual="noticia_img3";
			numero="tres";
			numeroant="dois";
			numeroant2="um";
			fundoAnterior="noticia_img1";
			fundoAnterior2="noticia_img2";
		} else {
		if (obj==1) {
			textoAtivo="texto1";
			numero="um";
			numeroant="tres";
			numeroant2="dois";
			fundoAtual="noticia_img1";
			fundoAnterior="noticia_img3";
			fundoAnterior2="noticia_img2";
		} } }
		clearTimeout(paraNot);
		obj="";
	}
	document.getElementById("textos").innerHTML=document.getElementById(textoAtivo).innerHTML
	document.getElementById(numero).style.color="#000000";
	document.getElementById(numeroant).style.color="#ffffff";
	document.getElementById(numeroant2).style.color="#ffffff";
	document.getElementById(fundoAtual).style.display="block";
	document.getElementById(fundoAnterior).style.display="none";
	document.getElementById(fundoAnterior2).style.display="none";
	if (fundoAtual=="noticia_img1") {
		textoAtivo="texto2";
		fundoAtual="noticia_img2";
		numero="dois";
		numeroant="um";
		numeroant2="tres";
		fundoAnterior="noticia_img1";
		fundoAnterior2="noticia_img3";
	} else {
	if (fundoAtual=="noticia_img2")  {
		textoAtivo="texto3";
		fundoAtual="noticia_img3";
		numero="tres";
		numeroant="dois";
		numeroant2="um";
		fundoAnterior="noticia_img1";
		fundoAnterior2="noticia_img2";
	} else {
	if (fundoAtual=="noticia_img3") {
		textoAtivo="texto1";
		numero="um";
		numeroant="tres";
		numeroant2="dois";
		fundoAtual="noticia_img1";
		fundoAnterior="noticia_img3";
		fundoAnterior2="noticia_img2";
	} } } 
	varnot="noticias("+obj+")";
	paraNot = setTimeout(varnot, 7500);
}
function ageita() {
	altura = document.getElementById('contexto').offsetHeight;
	altura=altura+20;
	altura=altura+"px";
	document.getElementById('coluna1').style.height=altura;
	document.getElementById('coluna2').style.height=altura;	
}
function aguarde() {
	parent.document.getElementById('alert').style.display="block";
	parent.document.getElementById('texto').innerHTML="Aguarde...";	
}
function aguardeRecados() {
	parent.document.getElementById('op2').style.display="block";
}