	var SlideTempo 		= ""; //Tempo de intervalo do Slide Show
	var SlideAtiva		= false;//Indicação de ativação do Slide Show
	
	var ImgsData 		= '';
	var ImgsContentData = '';
	
	var arrImgs = '';
	var arrImgsContent = '';
	var numPagesG = 0;
	var galeriaSetData=false;
	
	function defVarsGaleria()
	{
		if(!galeriaSetData)
		{
			SlideTempo 		= ById('strSlideTempo').value;
			
			ImgsData 		= ById('strImgsData').value;
			ImgsContentData = ById('srtImgsContentData').value;
			
			arrImgs = ImgsData.split(",");
			arrImgsContent = ImgsContentData.split(",");
			numPagesG = ById('strNumPagesG').value;
		}
	}
	
	function fechaCMD(){
		ById("CmdFoto").style.display='none';
		SlideShowOFF();
		ById("cmdSombra").style.display='none';
		ById("cmdSiteContent").style.display='block';
		ById("cmdBackContent").style.display='block';
	}
	
	function showPic(numPic)
	{
		defVarsGaleria();
		//Ajusta a camada da sombra com o tamanho da ajanela.
		ById("cmdSiteContent").style.display='none';
		ById("cmdBackContent").style.display='none';
		ById("cmdSombra").style.display='block';
		
		//ById("descImages").innerHTML="&nbsp;"+arrImgsContent[numPic];
		if((Math.round(numPic)+1)<10){var numPicFinal = "0"+(Math.round(numPic)+1);}else{var numPicFinal =Math.round(numPic)+1;}
		ById("CmdFoto").style.display='block';
		
		var posLeft = (document.body.clientWidth/2)-(document.getElementById("CmdFoto").clientWidth/2);
		var posTop = (document.body.clientHeight/2)-(document.getElementById("CmdFoto").clientHeight/2);//
		ById("CmdFoto").style.left=posLeft.toString()+'px';
		ById("CmdFoto").style.top=posTop.toString()+'px';
		
		
		ById("fAtual").value=numPic;
	
		AC_FL_RunContentGaleria('style','z-index:10;','codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','550','height','550','wmode','transparent','src','imagemGaleria','FlashVars','fotoLoad='+arrImgs[numPic]+'&reLoad=1','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','imagemGaleria'); //end AC code
	}
	
	function zoomPic()
	{
		var nfAtual = document.all.fAtual.value;
		var fAtual = arrImgs[nfAtual];
		window.open('zoomfoto.asp?f='+fAtual,'ZF'+nfAtual,'width=50,height=50');
	}
	
	function proxPic()
	{
		var atualPic = document.all.fAtual.value;
		var nAtualPic = Math.round(atualPic)+1;
	
		if((Math.round(nAtualPic)+1)<=numPagesG){
			showPic(nAtualPic,0);
			document.all.fAtual.value = nAtualPic;
		}else{
			fechaCMD();
		}
	}
	
	function antePic()
	{
		var atualPic = document.all.fAtual.value;
		var nAtualPic = Math.round(atualPic)-1;
		
		if((Math.round(nAtualPic)+1)>0){
			showPic(nAtualPic,0);
			document.all.fAtual.value = nAtualPic;
		}else{
			fechaCMD();
		}
	}
	
	/* CONTROLES PARA O SLIDE SHOW */
	function SlideShowOFF()
	{
		SlideAtiva = false;
		ById("cmdSOff").style.display = "none";
		ById("cmdSOn").style.display = "block";
		ById("picSlideState").alt="Iniciar Slide Show";
		ById("picSlideState").src="images/galeria_slide_on.png";
	}
	
	function SlideShowON()
	{
		if(numPagesG>1)
		{
			SlideAtiva = true;
			ById("cmdSOff").style.display = "block";
			ById("cmdSOn").style.display = "none";
			ById("picSlideState").alt="Parar Slide Show";
			ById("picSlideState").src="images/galeria_slide_off.png";
			setTimeout("fSlideShow()",SlideTempo);
		}
	}
	
	function fSlideShow()
	{
		if(SlideAtiva)
		{
			ById("picSlideState").src="images/galeria_slide_off.gif";
			if(Math.round(document.all.fAtual.value)+1==Math.round(numPagesG)){document.all.fAtual.value=-1;}
			proxPic();
			setTimeout("fSlideShow()",SlideTempo);
		}
		else
		{
			ById("picSlideState").src="images/galeria_slide_on.gif";
		}
	}
	
	
	
	
	
	
	function mostraRelease()
	{
		if(ById("cmdAreaGaleria")!=null){ById("cmdAreaGaleria").style.display='none';}
		ById("cmdAreaRelease").style.display='block';
	}
	
	function mostraDesfile()
	{
		if(ById("cmdAreaRelease")!=null){ById("cmdAreaRelease").style.display='none';}
		ById("cmdAreaGaleria").style.display='block';
	}

	function mostraCatalogo(){window.open('catalogo.html','revistaCatalogo','scrollbars=no,fullscreen=yes');}


	/*AÇÕES DE VIDEO*/
	function mostraVideo()
	{
		if(ById('ColecaoVideoDesfile')!=null)
		{
			video_url = ById('ColecaoVideoDesfile').value;
			ById("cmdVideoArea").style.display='block';
			ById("cmdSombra").style.display='block';

			document.getElementById("cmdVideo").innerHTML='<table width=300 height=100 ><tr><td align=center ><img src=images/loader.gif /></td></tr></table>';
		
			var posLeft = (document.body.clientWidth/2)-(document.getElementById("cmdVideoArea").clientWidth/2);
			var posTop = (document.body.clientHeight/2)-(document.getElementById("cmdVideoArea").clientHeight/2);//
			document.getElementById("cmdVideoArea").style.left=posLeft.toString()+'px';
			document.getElementById("cmdVideoArea").style.top=posTop.toString()+'px';
		
			//Dados do vídeo
			FlashVars = "";
			AC_FL_RunContentVideo('src','http://www.youtube.com/v/'+video_url+'&hl=en&fs=1','movie','http://www.youtube.com/v/'+video_url+'&hl=en&fs=1','allowfullscreen','true','allowscriptaccess','true','width','640','height','385','wmode','transparent','flashvars',FlashVars,'quality','high','codebase',AC_codebase,'pluginspage',AC_pluginspage);
			
			posLeft = (document.body.clientWidth/2)-(document.getElementById("cmdVideoArea").clientWidth/2);
			posTop = (document.body.clientHeight/2)-(document.getElementById("cmdVideoArea").clientHeight/2);//
		
			document.getElementById("cmdVideoArea").style.left=posLeft.toString()+'px';
			document.getElementById("cmdVideoArea").style.top=posTop.toString()+'px';
			
			ById("cmdSiteContent").style.display='none';
			ById("cmdBackContent").style.display='none';
		}
	}

	function fechaVideo()
	{
		document.getElementById("cmdVideoArea").style.display='none';
		document.getElementById("cmdVideo").innerHTML='';
		ById("cmdSombra").style.display='none';
		ById("cmdSiteContent").style.display='block';
		ById("cmdBackContent").style.display='block';
	}

	/****************/

	