function addSwf(f, l, a) {
    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" scale="Showall" style="width:' + l + 'px;height:' + a + 'px;" play="true" width="' + l + '" height="' + a + '">'
  + '<param name="allowScriptAccess" value="sameDomain" />'
  + '<param name="movie" value="' + f + '.swf"/>'
  + '<param name="quality" value="high" />'
  + '<param name="play" value="true" />'
  + '<param name="loop" value="false" />'
  + '<param name="wmode" value="transparent" />'
  + '<param name="bgcolor" value="#000000" /><embed src="' + f + '.swf" quality="high" scale="Showall"  play="true" wmode="transparent" bgcolor="#000000"'
  + ' width="' + l + '" height="' + a + '" style="width:' + l + 'px;height:' + a + 'px;" '
  + 'name="menu" allowScriptAccess="sameDomain"  loop="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
  + '</object>');
}




function addSwfTitulos( f, t, l, a )
{
  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" play="true" width="' + l + '" height="' + a + '" id="Titulo" align="middle">'
  + '<param name="allowScriptAccess" value="sameDomain" />'
  + '<param name="movie" value="' + f + '.swf?t=' + t + '"/>'
  + '<param name="quality" value="high" />'
  + '<param name="play" value="true" />'
  + '<param name="wmode" value="transparent" />'
  + '<param name="bgcolor" value="#000000" /><embed src="' + f + '.swf?t=' + t + '" quality="high"  play="true" wmode="transparent" bgcolor="#000000"'
  + ' width="' + l + '" height="' + a + '"'
  + 'name="menualign="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
  + '</object>');
}



function addSwfGal( f, g, l, a )
{
  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" play="true" width="' + l + '" height="' + a + '" id="Titulo" align="middle">'
  + '<param name="allowScriptAccess" value="sameDomain" />'
  + '<param name="movie" value="' + f + '.swf?g=' + g + '"/>'
  + '<param name="quality" value="high" />'
  + '<param name="play" value="true" />'
  + '<param name="wmode" value="transparent" />'
  + '<param name="bgcolor" value="#000000" /><embed src="' + f + '.swf?g=' + g + '" quality="high"  play="true" wmode="transparent" bgcolor="#000000"'
  + ' width="' + l + '" height="' + a + '"'
  + 'name="menualign="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
  + '</object>');
}





var flagFoto = false;

function ExibeFoto( f, l, u )
{

  if( document.all )
  {
      document.all( "ImgFoto" ).src = "imagens/carregando.gif";
      document.all( "ImgFoto" ).src = f;
      document.all( "DivFotoLegenda" ).innerHTML = l;
      document.all( "DivLink" ).innerHTML = "<span class=\"legendaFotoDestaque\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Visite: </span><a href=\"" + u + "\" class=\"LinkWebSites\" target=\"_blank\">" + u + "</a>";
      document.all( "DivFoto" ).style.display = "";
  }
  else
  {
      document.getElementById( "DivFoto" ).style.display = "";
      document.getElementById( "ImgFoto" ).src = "imagens/carregando.gif";
      document.getElementById( "ImgFoto" ).src = f;
      document.getElementById( "DivFotoLegenda" ).innerHTML = l;
      document.getElementById( "DivLink" ).innerHTML = u;
      document.getElementById( "DivFoto" ).style.display = "";
  }

  flagFoto = true;
}


function OcultaFoto( f )
{
  if( document.all )
  {
    document.all( "ImgFoto" ).src = "imagens/carregando.gif";
  document.all( "DivFoto" ).style.display = "none";
  document.all( "DivBkg" ).style.display = "none";
  }
  else
  {
    document.getElementById( "ImgFoto" ).src = "imagens/carregando.gif";
  document.getElementById( "DivFoto" ).style.display = "none";
  document.getElementById( "DivBkg" ).style.display = "none";
  }
flagFoto = false;
}


function RedimensionaFoto()
{

  if( flagFoto )
  {
    if( document.all )
    {
      document.all( "DivBkg" ).style.display = "";
      }
      else
      {
        document.getElementById( "DivBkg" ).style.display = "";
      }
  }
  //flagFoto = false;
}



var intervalo = window.setInterval( "AjustaPosScroll()", 500);

function AjustaPosScroll()
{



if( !flagFoto )
{
    if( document.all )
    {
      document.all( "DivBkg" ).style.display = "none";
      }
      else
      {
        document.getElementById( "DivBkg" ).style.display = "none";
      }
}
else
{
    if( document.all )
    {
      document.all( "DivBkg" ).style.display = "";
      }
      else
      {
        document.getElementById( "DivBkg" ).style.display = "";
      }
}


  var top = (document.documentElement && document.documentElement.scrollTop) ?
  document.documentElement.scrollTop : document.body.scrollTop;

  BodyWidth = document.body.scrollWidth;

  // Dimensiona e posiciona DIV de fundo:
  if( document.all )
  {
  document.all( "DivBkg" ).style.left = 0;
  document.all( "DivBkg" ).style.top = 0;
  document.all( "DivBkg" ).style.width = BodyWidth;
  document.all( "DivBkg" ).style.height = document.body.scrollHeight;
   }
   else
   {
  document.getElementById( "DivBkg" ).style.left = 0;
  document.getElementById( "DivBkg" ).style.top = 0;
  document.getElementById( "DivBkg" ).style.width = BodyWidth + "px";
  document.getElementById( "DivBkg" ).style.height = document.body.scrollHeight + "px";
   }
  BodyScroll = document.body.scrollTop;
  BodyScroll = top;



  if( document.all )
  {
  FotoAlt = document.all( "ImgFoto" ).height;
  }
  else
  {
  FotoAlt = document.getElementById( "ImgFoto" ).height;
  }
  BodyAlt = document.body.clientHeight;


  if( document.all )
  {
    BodyAlt = document.documentElement.clientHeight;
  }
  else
  {
    BodyAlt = window.innerHeight;
  }

  //alert( BodyAlt );

  PosMid = BodyScroll + ( ( BodyAlt - ( FotoAlt + 35 ) ) / 2 );


  if( document.all )
  {
  document.all( "DivFoto" ).style.top = PosMid;

  FotoLrg   = document.all( "ImgFoto" ).width;
  PosCnt = ( BodyWidth - ( FotoLrg + 30 ) ) / 2;
  document.all( "DivFoto" ).style.left = PosCnt;
  }
  else
  {
  document.getElementById( "DivFoto" ).style.top = PosMid + "px";

  FotoLrg   = document.getElementById( "ImgFoto" ).width;
  PosCnt = ( BodyWidth - ( FotoLrg + 30 ) ) / 2;
  document.getElementById( "DivFoto" ).style.left = PosCnt + "px";
  }

}







