// JavaScript Document
<!--
// <<< Ações referentes ao Destaque Principal
dpCorrente = 1;
dpProximo = 2;
dpTotal = 3;
dpPausa = false;

function iniciaDestaquePrincipal() {
	intervalo = window.setInterval(function()
	{
		if (dpCorrente == dpTotal) {
			dpProximo = 1;
		} else if (dpCorrente > dpTotal) {
			dpCorrente=1;
		}

		MM_showHideLayers('destaquePrincipal_'+dpCorrente,'','hide');
		MM_showHideLayers('destaquePrincipal_'+dpProximo,'','show');

		dpCorrente++;
		dpProximo++;

	}, 5000);

}

function reiniciaDestaquePrincipal() {
	window.clearInterval(intervalo);
	iniciaDestaquePrincipal();
}

function pausaDestaquePrincipal() {
	if (dpPausa)
	{
		dpPausa = false;
		iniciaDestaquePrincipal();
	}
	else
	{
		window.clearInterval(intervalo);
		dpPausa = true;
	}
}

function trocaDps(corrente, proximo) {
	dpCorrente = corrente;
	dpProximo = proximo;
}
// >>>

// <<< Função para mostrar e esconder os Setores da Indústria
sdi = true;
function timerSetoresDaIndustria() {
	if (sdi == true)
	{
		MM_showHideLayers('setoresDaIndustria','','show');
		sdi = false;
	}
	else
	{
		MM_showHideLayers('setoresDaIndustria','','hide');
		sdi = true;
	}
}
// >>>

// <<< Ações referentes a TVFlash

tvfCorrente = 1;
tvfProximo = 2;
tvfTotal = 2;
tvfPausa = false;

function hideAllTvFlash() {
	for (i = 1 ; i <= tvfTotal ; i++) {
		MM_showHideLayers('destaqueTvFlash_'+i,'','hide'); 
		document.getElementById('linkTvFlash_'+i).className = '';
	}
	i=0;
}

function iniciaTvFlash(tvfTotalTemp) { 
	
	tvfTotal = tvfTotalTemp;
	
	if(tvfTotal > 1){
	
		intervaloTv = window.setInterval(function()
		{
			if (tvfCorrente == tvfTotal) {
				tvfProximo = 1;
			} else if (tvfCorrente > tvfTotal) {
				tvfCorrente=1;
			}
			
			hideAllTvFlash();
			document.getElementById('linkTvFlash_'+tvfProximo).className = 'atual';
			//MM_showHideLayers('destaqueTvFlash_'+tvfCorrente,'','hide'); 
			MM_showHideLayers('destaqueTvFlash_'+tvfProximo,'','show');
			  
			tvfCorrente++;
			tvfProximo++;
			
		}, 8000);
	
	}
	
}

function reiniciaTvFlash() { 
	window.clearInterval(intervaloTv);
	iniciaTvFlash(tvfTotal);
}

function trocaTvfs(corrente, proximo) {
	tvfCorrente = corrente;
	tvfProximo = proximo;
	document.getElementById('linkTvFlash_'+tvfCorrente).className = 'atual';
}

function abre(arquivo) {
	//alert('abre');
	var xmlHttp;
	try {
		// IE 6 e 7
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		//alert("IE 6 e 7");
	}
	catch (e) {
		// Outros...
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			//alert("Outros...");
		}
		catch (e){
			try {
				xmlHttp=new XMLHttpRequest();
				//alert("Firefox, Opera 8.0+, Safari");
			}
			catch (e) {
				alert("Seu navegador n&atilde;o suporta AJAX. Atualize-o em www.getfirefox.com");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState == 1) {
			document.getElementById("destaqueTvFlash_1").innerHTML = "Carregando...";
		}
		if(xmlHttp.readyState == 4) {
			document.getElementById("destaqueTvFlash_1").innerHTML = xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",arquivo,true);
	xmlHttp.send(null);
}

// >>>

-->
