vAtivo="nao";
function video(video,id) {
	if (vAtivo=="nao") {
		vAtivo="sim";
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
		vAtivo="nao";
	}
}
function corDIV(objeto,cor) {
	document.getElementById(objeto).style.background=cor;
}
function publicidade_chamada() {
	if (fechou=="nao") {
		document.getElementById("imagemCHA").style.display = 'block';
		document.getElementById("imagemCHA").style.height = '297px';
		document.getElementById("sld2_div").style.display = 'none';
		document.getElementById("sombra").style.display = 'none';
		document.getElementById("in").style.display = 'none';
		document.getElementById("linkdo2").style.display = 'none';
		document.getElementById("player").style.visibility = 'hidden';
		document.getElementById("linkPublicidade").style.display = 'block';
		

		document.getElementById("sld1_div").style.display = 'none';
		document.getElementById("in1").style.display = 'none';
		document.getElementById("linkdo1").style.display = 'none';

		document.getElementById("sld3_div").style.display = 'none';
		document.getElementById("in3").style.display = 'none';
		document.getElementById("linkdo3").style.display = 'none';
	}
}
function publicidade_chamadaOFF() {
	if (fechou=="nao") {
		document.getElementById("linkdo2").style.display = 'block';
		document.getElementById("sld2_div").style.display = 'block';
		document.getElementById("linkPublicidade").style.display = 'none';
		document.getElementById("imagemCHA").style.display = 'none';
		document.getElementById("sombra").style.display = 'block';
		document.getElementById("in").style.display = 'block';
		document.getElementById("player").style.visibility = 'visible';
		
		document.getElementById("sld1_div").style.display = 'block';
		document.getElementById("in1").style.display = 'block';
		document.getElementById("linkdo1").style.display = 'block';

		document.getElementById("sld3_div").style.display = 'block';
		document.getElementById("in3").style.display = 'block';
		document.getElementById("linkdo3").style.display = 'block';
	}
}
contP=0;
function popUP() {
	contP++;
	if (contP<2) {
		varPausa="popUP()";
		delayPausa = setTimeout(varPausa, 40000);
	} else {
		fechar();
		clearTimeout(delayPausa);
	}
}
function fechar() {
	document.getElementById("popup").style.display = 'none';
}
//zVar=1;
function startSLIDS(atual,tipo) {
	
	//zVar++;
	if (atual=="sld0_img") {
		//atual=anterior;
	}
	if (atual=="sld4_img") {
		//atual=proximo;
	}

	if (tipo=='click') {
		clearTimeout(gira);
	}
	
	// velocidade
	delay=8000;
	delay2=6000; // << Tempo do Pop-up
	// fim de velocidade
	
	if (atual=="sld1_img") {
		publicidade_chamadaOFF();
		document.getElementById("sld1_div").style.display = 'block';
		document.getElementById("sld2_div").style.display = 'none';
		document.getElementById("sld3_div").style.display = 'none';
		//document.getElementById("sld4_div").style.display = 'none';
		//document.getElementById("sld5_div").style.display = 'none';

		document.getElementById("sld2_txt").style.display = 'none';
		document.getElementById("sld3_txt").style.display = 'none';
		//document.getElementById("sld4_txt").style.display = 'none';
		//document.getElementById("sld5_txt").style.display = 'none';
		txt="sld1_txt";
		document.getElementById("sld1_number").className = 'numberOFF';
		document.getElementById("sld2_number").className = 'numberON';
		document.getElementById("sld3_number").className = 'numberON';
		//document.getElementById("sld4_number").className = 'numberON';
		//document.getElementById("sld5_number").className = 'numberON';
		anterior="sld3_img";
		proximo="sld2_img";
	}
	//alert(passou);
	
	if (atual=="sld2_img") {
		publicidade_chamadaOFF();
		document.getElementById("sld2_div").style.display = 'block';
		document.getElementById("sld1_div").style.display = 'none';
		document.getElementById("sld3_div").style.display = 'none';
		//document.getElementById("sld4_div").style.display = 'none';
		//document.getElementById("sld5_div").style.display = 'none';
		
		document.getElementById("sld1_txt").style.display = 'none';
		document.getElementById("sld3_txt").style.display = 'none';
		//document.getElementById("sld4_txt").style.display = 'none';
		//document.getElementById("sld5_txt").style.display = 'none';
		txt="sld2_txt";
		document.getElementById("sld2_number").className = 'numberOFF';
		document.getElementById("sld1_number").className = 'numberON';
		document.getElementById("sld3_number").className = 'numberON';
		//document.getElementById("sld4_number").className = 'numberON';
		//document.getElementById("sld5_number").className = 'numberON';
		anterior="sld2_img";
		proximo="sld1_img";
		//publicidade_chamada();
	}
	
	if (atual=="sld3_img") {
		if (fechou=="sim") {
			clearTimeout(gira);
			startSLIDS('sld3_3_img',"click");
		}
		if (fechou=="nao") {
			publicidade_chamada();
		}
	}
	
	
	if (atual=="sld3_3_img") {
		publicidade_chamadaOFF();
		document.getElementById("sld3_div").style.display = 'block';
		document.getElementById("sld2_div").style.display = 'none';
		document.getElementById("sld1_div").style.display = 'none';
		//document.getElementById("sld4_div").style.display = 'none';
		//document.getElementById("sld5_div").style.display = 'none';
		
		document.getElementById("sld1_txt").style.display = 'none';
		document.getElementById("sld2_txt").style.display = 'none';
		//document.getElementById("sld4_txt").style.display = 'none';
		//document.getElementById("sld5_txt").style.display = 'none';
		txt="sld3_txt";
		document.getElementById("sld3_number").className = 'numberOFF';
		document.getElementById("sld1_number").className = 'numberON';
		document.getElementById("sld2_number").className = 'numberON';
		//document.getElementById("sld4_number").className = 'numberON';
		//document.getElementById("sld5_number").className = 'numberON';
		anterior="sld2_img";
		proximo="sld1_img";
	}
	
	//document.getElementById(txt).style.zIndex = zVar;
	document.getElementById(txt).style.display = 'block';
	
	if (atual=="sld1_img") {
		gira = setTimeout("startSLIDS('sld2_img')", delay);
	}
	if (atual=="sld2_img") {
		gira = setTimeout("startSLIDS('sld3_img')", delay);	
	}
	if (atual=="sld3_img" && fechou=="nao") {
		gira = setTimeout("startSLIDS('sld3_3_img')", delay2);
	}
	if (atual=="sld3_3_img") {
		gira = setTimeout("startSLIDS('sld1_img')", delay);
	}
	
	if (tipo=='click') {
		clearTimeout(gira);
		startSLIDS(atual,"NOCLICK");
	}

}
function alphaON(objeto,velocidade) {
	contador=3;
	document.getElementById(objeto).style.opacity="0.3";
	var intervalo = window.setInterval(function() {
		contador++;
		if (contador==10) {
			document.getElementById(objeto).style.opacity="100";
		} else {
			document.getElementById(objeto).style.opacity="0."+contador;
		}
		document.getElementById(objeto).style.filter="alpha(opacity="+contador+"0)";
		if (contador==10) {
			clearInterval(intervalo);
		}
	}, velocidade);
}
function alphaOFF(objeto,velocidade) {
	contador=9;
	document.getElementById(objeto).style.opacity="100";
	var intervalo = window.setInterval(function() {
		document.getElementById(objeto).style.opacity="0."+contador;
		document.getElementById(objeto).style.filter="alpha(opacity="+contador+"0)";
		contador--;
		if (contador==-1) {
			clearInterval(intervalo);
		}
	}, velocidade);
}
function balao(e,texto) {
	if(document.all)e = event;
	var obj = document.getElementById('balao');
	obj.innerHTML = texto;
	obj.style.display = 'block';
	if (entraMove!="sim") {
		obj.style.opacity="0.0";
		obj.style.filter="alpha(opacity=0)";
		alphaON('balao',70);
		entraMove="sim";
	}
	obj.style.left = e.clientX + 20 + 'px';
	obj.style.top = e.clientY + 20 + 'px';
}
function balaoOFF(e) {
	if(document.all)e = event;
	var obj = document.getElementById('balao');
	obj.style.display = 'none';
	entraMove="nao";
	obj.innerHTML = "";
}
function fonteLoad() {
	atual=13;
	atual2=30;
}
function fonte(tipo) {
	var obj = document.getElementById('conteudo');
	if (tipo=="mais" && atual!=15) {	
		atual++;
		atual2=atual2+4;
		obj.style.fontSize = atual+"px";
		obj.style.lineHeight = atual2+"px";
	}
	if (tipo=="menos" && atual!=13) {	
		atual--;
		atual2=atual2-4;
		obj.style.fontSize = atual+"px";
		obj.style.lineHeight = atual2+"px";
	}
}
function some(objeto,tipo) {
	var obj = document.getElementById(objeto);
	if (tipo=="aparece") {	
		obj.style.display = 'block';
	}
	if (tipo=="some") {
		obj.style.display = 'none';
	}
}

//entraMove="nao";
// deixando imagens/texto do slid invisiveis
/*document.getElementById('sld1_img').style.display = 'none';
document.getElementById('sld2_img').style.display = 'none';
document.getElementById('sld3_img').style.display = 'none';
document.getElementById('sld1_txt').style.display = 'none';
document.getElementById('sld2_txt').style.display = 'none';
document.getElementById('sld3_txt').style.display = 'none';*/
// fim de deixando imagens/texto do slid invisiveis
function someIMG () {
	/*document.getElementById('sld1_txt').style.display = 'none';
	document.getElementById('sld2_txt').style.display = 'none';
	document.getElementById('sld3_txt').style.display = 'none';*/
}
function zoom(imagem,referente,largura,altura,larguraMIN,alturaMIN) {

	//document.getElementById(referente).src=imagem+"&largura="+larguraMIN+"&altura="+alturaMIN;
	document.getElementById(referente).style.width=larguraMIN+"px";
	document.getElementById(referente).style.height=alturaMIN+"px";
	
	document.getElementById(referente).style.display = 'block';
	ate=largura;
	maximo=450;
	
	
	while (largura>larguraMIN) {
		largura=largura/1.1;
		altura=altura/1.1;
	}

	var intervalo = window.setInterval(function() {
		
		largura=largura*1.1;
		altura=altura*1.1;
												
		document.getElementById(referente).style.width=largura+"px";
		document.getElementById(referente).style.height=altura+"px";
		if (largura>ate || largura>maximo) {
			clearInterval(intervalo);
		}
	}, 20);
	
}
function clicouEnquete () {
	var obj = document.formulario;
	
	obj.target="enquete";
	obj.action="enquete.php";
	
	document.getElementById('sub').href='javascript:document.formulario.submit()';
}
function clicouMural(pgn) {
	entrou="nao";	
	var obj = document.formulario;
	//obj.target="enquete";
	obj.action="?pgn=not&cod="+pgn+"&func=enviarRecado";
	obj.method="POST";
	
	if (obj.nome.value=="") {
		entrou="sim";	
	}
	
	if (obj.cidade.value=="") {
		entrou="sim";	
	}
	
	if (obj.mensagem.value=="") {
		entrou="sim";	
	}
	
	if (entrou=="sim") {
		alert("Por favor preencha todos os campos")
		return false;
	} else {
		
	}
	
	document.getElementById('envmural').href='javascript:document.formulario.submit()';
}
function clicouMural2() {
	entrou="nao";	
	var obj = document.formulario;
	//obj.target="enquete";
	if (obj.nome.value=="") {
		entrou="sim";	
	}
	
	if (obj.cidade.value=="") {
		entrou="sim";	
	}
	
	if (obj.mensagem.value=="") {
		entrou="sim";	
	}
	
	if (entrou=="sim") {
		alert("Por favor preencha todos os campos, (arquivo não obrigatório)")
		return false;
	} else {
		obj.action="?pgn=mural&func=enviarRecado";
		obj.method="POST";
	}
	//obj.onsubmit="subarqui()";
	
	document.getElementById('envmural').href='javascript:document.formulario.submit()';
}
function clicouContatos() {
	entrou="nao";	
	var obj = document.formulario;
	
	if (obj.nome.value=="") {
		entrou="sim";	
	}
	
	if (obj.email.value=="") {
		entrou="sim";	
	}
	
	if (obj.assunto.value=="") {
		entrou="sim";	
	}
	
	if (obj.cidade.value=="") {
		entrou="sim";	
	}
	
	if (obj.mensagem.value=="") {
		entrou="sim";	
	}
	
	if (entrou=="sim") {
		alert("Por favor preencha todos os campos, (arquivo não obrigatório)")
		return false;
	} else {
		obj.action="?pgn=contato&func=enviarRecado";
		obj.method="POST";
	}

	document.getElementById('envmural').href='javascript:document.formulario.submit()';
}
function subarqui() {
	alert("");
	//var obj = document.formulario;
	
	//if (obj.arquivo.value!="") {
		//document.getElementById('carregando').style.display = 'hidden';
		//document.getElementById('carregandotxt').style.display = 'hidden';
	//}	
}
function clicouBusca () {
	var obj = document.formulario;
	
	obj.target="_top";
	obj.action="?pgn=busca";
}
function zoomOff(referente,largura,altura) {
	document.getElementById(referente).style.display = 'none';
	document.getElementById(referente).style.width=largura+"px";
	document.getElementById(referente).style.height=altura+"px";
}
function list(q) {
	q=115*q;
	document.getElementById('list').style.width = q+"px";
}
function scrolll(tipo){
	var m=document.getElementById("scro");
	contador=0;
	var intervalo = window.setInterval(function() {
	if(tipo=="sobe") {
		m.scrollLeft-=contador++;
	} else {
		m.scrollLeft+=contador++;
	}
	
	if (contador>20) {
		clearInterval(intervalo);
	}
		
	}, 50);	
}
function abrir(URL,largura,altura) {
						
	var width = largura;
	var height = altura;
					
	var left = 99;
	var top = 99;
						
	window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
			
}

function abrir2(URL,largura,altura) {
						
	var width2 = largura;
	var height2 = altura;
					
	var left2 = 99;
	var top2 = 99;
						
	window.open(URL,'janela', 'width='+width2+', height='+height2+', top='+top2+', left='+left2+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
			
}

primCar="sim";
function carrr() {
	if (primCar=="sim") {
		document.getElementById('carreC').style.display='block';
		guardaOfertas=document.getElementById('clasP').innerHTML;
		document.getElementById('carreC').innerHTML="<img src=\"imagens/carreg.gif\" />";
		primCar="nao";
	} else {
		document.getElementById('clasP').innerHTML=guardaOfertas;
		document.getElementById('linkClass2').style.display="none";
		document.getElementById('linkClass').style.display="block";
		primCar="sim";
	}
}


