imgUse = 0;
maxImg = 0;
function swImage(opt,max)
{
  maxImg = max;
  if(opt=='next')
  {
    if((imgUse+1)<maxImg)
    {
      document.getElementById('spi_'+imgUse).style.display = 'none';
      document.getElementById('spi_'+(imgUse+1)).style.display = '';
      imgUse = imgUse+1;
      document.getElementById('lnkesquerda').style.backgroundImage = 'url(images/setae.jpg)'

      if((imgUse+1)>=maxImg)
      {
        document.getElementById('lnkdireita').style.backgroundImage = 'url(images/setastop.jpg)';
      }
    }
  }


  if(opt=='prev')
  {
    if((imgUse-1)>=0)
    {
      document.getElementById('spi_'+imgUse).style.display = 'none';
      document.getElementById('spi_'+(imgUse-1)).style.display = '';
      imgUse = imgUse-1;
      document.getElementById('lnkdireita').style.backgroundImage = 'url(images/setad.jpg)';
      if((imgUse-1)<0)
      {
        document.getElementById('lnkesquerda').style.backgroundImage = 'url(images/setastop.jpg)';
      }
    }
  }

}

function optJump(path)
{
  if(path!='')
  {
  window.location = path;
  }
}


function dtkVid(id,opt)
{

  if(opt=='on')
  {
    document.getElementById('vid_'+id).style.borderColor        = '#cccccc';
    document.getElementById('vid_'+id).style.backgroundColor    = '#dadada';
    document.getElementById('tvid_'+id).style.borderColor       = '#cccccc';
    document.getElementById('ovid_'+id).style.backgroundColor   = '#ffffff';
    document.getElementById('spvid_'+id).style.display          = '';
  }

  if(opt=='off')
  {
    document.getElementById('vid_'+id).style.borderColor        = '#ffffff';
    document.getElementById('vid_'+id).style.backgroundColor    = '#ffffff';
    document.getElementById('tvid_'+id).style.borderColor       = '#ffffff';
    document.getElementById('spvid_'+id).style.display          = 'none';
    document.getElementById('ovid_'+id).style.backgroundColor   = '';
  }

}


function objeto(nome,largura,altura){

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+
' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'+
' width="'+largura+'" height="'+altura+'" id="'+nome+'" align="middle">');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<param name="allowFullScreen" value="true" />');
document.write('<param name="movie" value="'+nome+'" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="'+nome+'" quality="high" menu="false" wmode="transparent" '+
' width="'+largura+'" height="'+altura+'" name="'+nome+'" align="middle"'+
' allowScriptAccess="always" allowfullscreen="true" type="application/x-shockwave-flash"'+
' pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}





/*GALERIA FADE*/


function abreGaleria(larguraConteudo,cod,src)
{
	//Aqui pegamos as dimensões da tela USÁVEL do browser
	if(document.body.scrollHeight<document.documentElement.clientHeight)
	{var alturaTela	= document.documentElement.clientHeight;}
	else
	{var alturaTela	= document.body.scrollHeight+12;}
	var larguraTela = document.documentElement.clientWidth;

	//Aqui definimos o tamanho da div com o FADE de acordo com a dimensões obtidas anteriormente
	document.getElementById('efeitoTransp').style.height				= alturaTela+'px';
	document.getElementById('efeitoTransp').style.width					= larguraTela+'px';

	//Aqui mostramos a galeria mudando o estado 'none' do style display:none ( ou seja mostramos a dita cuja )
	document.getElementById('efeitoTransp').style.display = '';
	document.getElementById('conteudoGaleria').style.display		= '';

	//Aqui centralizamos a DIV com o conteúdo na tela
	var base  = screen.availWidth/2;
	var temp	= base - (larguraConteudo /2);
	document.getElementById('conteudoGaleria').style.left				= temp+'px';
  location.hash = 'topo';
  getAjax('ajaxgal','ajgal','&cod='+cod+'&src='+src+'&img=','');
	//document.getElementById('se').style.display		= 'none';
}


function fechaGaleria()
{
	//Aqui mostramos a galeria mudando o estado '' do style display: ( ou seja escondemos a dita cuja )
	document.getElementById('efeitoTransp').style.display				= 'none';
	document.getElementById('conteudoGaleria').style.display		= 'none';
	document.getElementById('ajgal').innerHTML		              = '';
	//document.getElementById('se').style.display                 = '';
}

function showClose()
{
	document.getElementById('btf').style.display				= '';
}
function hideClose()
{
	document.getElementById('btf').style.display				= 'none';
}

/*GALERIA FADE*/