function tb_afterShow(type)
{
  switch (type)
  {
    case "image":
    
      break;
    case "inline": case "ajax":
      $("#TB_ajaxContent").css({
        height: $("#TB_ajaxContent").height() - 10,
        width: $("#TB_ajaxContent").width() - 10
      });
      break;
    case "iframe":
      $("#TB_iframeContent").css({
        height: $("#TB_iframeContent").height() - 17,
        width: $("#TB_iframeContent").width() - 29
      });
      break;
  }
}

// initialize the inline popup script
if (Shadowbox.client.isIE7) Shadowbox.client.isIE6 = false;
Shadowbox.init({
  players: ["html", "iframe", "img"]
});

$(function()
{
  $("#pgAdvanced").click(function()
  {
    var el = $(this);
    var menu = $("#pgTopSearch");
    
    if (menu.css("display") == "none")
    {
      menu.css("visibility", "hidden").show();
      menu.css({
        left: el.offset().left + el.width() - menu.width(),
        top: el.offset().top + el.height(),
        zIndex: 100000
      });
      menu.css("visibility", "visible");
    }
    else
      menu.hide();
    return false;
  });
  
  $("#txtSearchZipTop, #txtTopZip").maskLabel({
    css: {
      fontWeight: "bold",
      color: "#ccc"
    },
    text: "ENTER 5 DIGIT ZIP"
  });
  
  $("#pgTopMenu ul.ddMenu").ddMenu({
    hideDelay: 500
  });
  
  if ($("#redirectLink").length > 0)
  {
    setTimeout(function()
    {
      location.href = $("#redirectLink").attr("href");
    }, iRedirectTimeout * 1000);
  }
});