function Status() {
	window.status = "Prats";
	setTimeout("Status()", 0);
}
Status();

function flash(arquivo, largura, altura, id)
{
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + largura + "' height='" + altura + "' id='" + id + "'>")
    document.write("<param name='movie' value='" + arquivo + "'>")
    document.write("<param name='quality' value='high'>")
	document.write("<param name='wmode' value='transparent'>")
    document.write("<embed src='" + arquivo + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + largura + "' height='" + altura + "' wmode='transparent' name='" + id + "' swLiveConnect='true'></embed>")
    document.write("</object>")
}

var popUp = true;

function flashPopUp(arquivo, largura, altura, id)
{
    str = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + largura + "' height='" + altura + "' name='" + id + "' id='" + id + "'>"
    str += "<param name='movie' value='" + arquivo + "'>"
    str += "<param name='quality' value='high'>"
	str += "<param name='wmode' value='transparent' name='" + id + "' id='" + id + "'>"
    str += "<embed src='" + arquivo + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + largura + "' height='" + altura + "' wmode='transparent'></embed>"
    str += "</object>"
	
	return str;
}

var CaminhoAntigo = "";

function popUpImagem() {
	if(popUp){
		Caminho = document.getElementById("imagemGde").src.split("/")
		CaminhoG = "";
		for(i=0;i<(Caminho.length - 1);i++){
			CaminhoG += Caminho[i] + "/";
		}
		CaminhoG += "G/" + Caminho[Caminho.length - 1];
		CaminhoG = CaminhoG.replace("G/G/", "G/")
	
		if(top.document.getElementById("popUpImagem").style.display == 'none'){
			if(Caminho[Caminho.length - 1] !== "spacer.gif"){
				top.document.getElementById("popUpImagem").style.display = 'block';
			}
		} else {
			if(CaminhoAntigo == CaminhoG || Caminho[Caminho.length - 1] == "spacer.gif") {
				top.document.getElementById("popUpImagem").style.display = 'none';
			}
		}
		
		top.document.getElementById("popUpImagem").innerHTML = ""
		top.document.getElementById("popUpImagem").innerHTML = flashPopUp('../Imagens/POPUP.swf?foto=' + CaminhoG , '550', '382');
		
		CaminhoAntigo = CaminhoG;
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
  
  for(i=0;i<(a.length-2);i+=3) 
  if ((x=MM_findObj(a[i]))!=null){
	  document.MM_sr[j++]=x;

	  x.src=a[i+2];
	  
	  if(x.oSrc==x.src){
		 popUpImagem();
	  } else {
		if(top.document.getElementById("popUpImagem").style.display == 'block'){
		  popUpImagem();
		}	  
	  }
	  
	  x.oSrc=x.src;
  }

}

function scrollImagens(destino, limite){
	for(var i=1;i<=limite;i++){
		Caminho = frameMiniaturas.document.getElementById("imagemPeq" + i).title;
		MM_preloadImages(Caminho);
		if(i < destino || i > (destino+5)){
			frameMiniaturas.document.getElementById("imagemPeq" + i).style.display = 'none';
		} else {
			frameMiniaturas.document.getElementById("imagemPeq" + i).style.display = 'block';
		}		
	}
	atual = destino;
	if(atual == 1){
		frameMiniaturas.document.getElementById("b_anterior").style.display = 'none';
	} else {
		frameMiniaturas.document.getElementById("b_anterior").style.display = 'block';
	}
	
	if((atual + 5) >= limite){
		frameMiniaturas.document.getElementById("b_proxima").style.display = 'none';
	} else {
		frameMiniaturas.document.getElementById("b_proxima").style.display = 'block';
	}

	if(limite<=1){
		frameMiniaturas.document.getElementById("TbImagensPeq").style.display = 'none';
		document.getElementById("conteudoTexto").style.height = '288px';
		document.getElementById("conteudoMiniaturas").style.height = '0px';
		document.getElementById("frameMiniaturas").style.height = '0px';
	} else {
		document.getElementById("conteudoTexto").style.height = '210px';
		document.getElementById("conteudoMiniaturas").style.height = '70px';
		document.getElementById("frameMiniaturas").style.height = '70px';
	}
	
	if(limite == 0){// && imagemGdeDiv.menu !== 'OK'){
		document.getElementById("imagemGdeDiv").style.display = 'none';
		document.getElementById("centro").style.width = '576px';
	} else {
		document.getElementById("imagemGdeDiv").style.display = 'block';
		document.getElementById("centro").style.width = '';
	}
}

function execute(pagina){
	escreveConteudo("&nbsp;");
	//trocaLegenda("");
	//document.getElementById("imagemGde").src = '../Imagens/spacer.gif';
	//document.getElementById("imagemGde").oSrc = '../Imagens/spacer.gif';
	
	top.document.getElementById("execute").src=pagina;
}

function saibaMais(){
	var sSaibaMais = "saiba mais";
	var sVoltar = "voltar";
	
	if (top.nIdioma == 1){
		sSaibaMais = "saiba mais";
		sVoltar = "voltar";
	} else if(top.nIdioma == 2){
		sSaibaMais = "more information";
		sVoltar = "back";
	} else if(top.nIdioma == 3){
		sSaibaMais = "sepa más";
		sVoltar = "volver";
	}
	
	if(frameConteudo.document.getElementById("textoResumo").style.display == "none"){
		frameConteudo.document.getElementById("textoResumo").style.display = "block";
		frameConteudo.document.getElementById("textoCompleto").style.display = "none";
		frameConteudo.document.getElementById("SaibaMaisTXT").innerHTML = sSaibaMais;
	} else {
		frameConteudo.document.getElementById("textoResumo").style.display = "none";
		frameConteudo.document.getElementById("textoCompleto").style.display = "block";
		frameConteudo.document.getElementById("SaibaMaisTXT").innerHTML = sVoltar;		
	}
}

function carregaConteudo(pagina){
	popUp = true;
	trocaTitulo("&nbsp;", "branco")
	escreveConteudo("&nbsp;");
	escreveMiniaturas("&nbsp;");
	trocaLegenda("");

	document.getElementById("imagemGde").style.display = 'block';
	document.getElementById("imagemGde").src = '../Imagens/spacer.gif';
	document.getElementById("imagemGde").oSrc = '../Imagens/spacer.gif';
	document.getElementById("legenda").style.display = 'block';
	window.document.flashHome.SetVariable("pagina", pagina);
	window.document.flashHome.Play();
	document.getElementById("imagemGdeBottom").innerHTML = "&nbsp;";
	
	document.getElementById("frameConteudo").src = "../conteudos/" + pagina + "_" + top.idioma + ".asp";
	document.getElementById("frameChamadas").src = "../includes/chamadas_" + top.idioma + ".asp?pagina=" + pagina;
}

function trocaTitulo(titulo, cor){
	document.getElementById("imagemGde").className = "img_" + cor;
	document.getElementById("tituloPag").className = "titulo_" + cor;
	document.getElementById("tituloPag").innerHTML = titulo + "<img src='../Imagens/hr" + cor + ".gif' width='580' height='2'>";	
}

function trocaLegenda(legenda){
	document.getElementById('legenda').value=legenda;	
}

function carregaMiniaturas(pasta, cor){
	document.getElementById("frameMiniaturas").src = "../includes/imagens.asp?pasta=" + pasta + "&cor=" + cor;
}

function escreveConteudo(conteudo){
	frameConteudo.document.getElementById("iFrameConteudo").innerHTML = conteudo;
}

function escreveMiniaturas(conteudo){
	frameMiniaturas.document.getElementById("iFrameMiniaturas").innerHTML = conteudo;
}