// JavaScript Document
intHeight = document.documentElement.clientHeight;
intWidth = document.documentElement.clientWidth;
var intT = ( ( intHeight / 2 ) - ( 650 / 2 ) );
var intL = ( ( intWidth / 2 ) - ( 1000 / 2 ) ) - 5;
var BG_DONE = false;
var BG_HEIGHT = 650;
var BG_WIDTH = 1000;
function BG_showT(caption, url, height, width) {
  BG_HEIGHT = height || 650;
  BG_WIDTH = width || 1000;
  if(!BG_DONE) {
    $(document.body)
      .append("<div id='BG_overlay'></div><div id='BG_window'><div id='BG_caption'></div>"
        + "<div id='btnContinua' alt='btnContinua' title='Continuar'><a href='"+url+"'></a></div>"
        + "<div id='fechar' alt='Fechar' title='Fechar'><a></a></div>"+
"</div>");
    $("#fechar").click(BG_hide);
        /*$("#btnContinua").click(function()
{
});*/
    $("#btnContinua").click(BG_hide);
    $("#homeSmiles").click(BG_hide);
    $("#homeCartao").click(BG_hide);
    $("#BG_overlay").click(BG_hide);
    $(window).resize(BG_positionT);
    BG_DONE = true;

  }

  $("#BG_frame").remove();
  $("#BG_window").append("<iframe id='BG_frame' src='../transicao/transicao.htm' Frameborder='0' allowtransparency='true'></iframe>");

  $("#BG_caption").html(caption);
  $("#BG_overlay").show();
  BG_positionT();

  if(BG_ANIMATION)
    $("#BG_window").show();
  else
    $("#BG_window").show();
}

function BG_positionT() {
intHeight = document.documentElement.clientHeight;
intWidth = document.documentElement.clientWidth;
var intT = ( ( intHeight / 2 ) - ( 400 / 2 ) ) - 10;
var intL = ( ( intWidth / 2 ) - ( 600 / 2 ) ) - 5;
  $("#BG_window").css({width:"600px",height:"400px",
    left: intL+"px", top:intT+"px" });
  $("#BG_frame").css("height","400px");
  $("#BG_frame").css("width","600px");
	$("#fechar a").css("width","30px");
	$("#fechar a").css("height","30px");
	$("#fechar a").css("position","absolute");
	$("#fechar a").css("left","540px");
	$("#fechar a").css("top","46px");
	$("#fechar a").css("z-index","1000");
}

      var BG_ANIMATION = true;
      $(document).ready(function(){
        $("a.externo").click(function(){
          var t = this.title || $(this).text() || this.href;
          BG_showT("", this.href,600,1000);
          return false;
        });

      });

