// Whenever there is a link with a class of "thickbox",
// change the URL so that there is a query string with
// Thickbox parameters
$(document).ready(function() {
  $("a.thickbox").each(function() {
    if ($(this).hasClass("related")) {
      // This is a video that has related videos with it, so stretch out the width
      // of the thickbox
      $(this).attr("href", $(this).attr("href") + "&lb=1&KeepThis=true&TB_iframe=true&height=520&width=792&js=true");
    } else if ($(this).hasClass("playerwide")) {
      // big video with no related vids
      $(this).attr("href", $(this).attr("href") + "&lb=1&KeepThis=true&TB_iframe=true&height=550&width=792&js=true");
    } else if ($(this).hasClass("hassettings")) {
        //do nothing to the url....its fine as it is...
    } else {
      // Just a single video
      $(this).attr("href", $(this).attr("href") + "&lb=1&KeepThis=true&TB_iframe=true&height=520&width=436&js=true");
    }
    
    $(this).bind("click", function() {
      // if there are any Flash pieces on the page, thanks to Firefox/Mac, hide them
      // it's up to Thickbox, when closing, to show all Flash pieces again
      $("object").css("visibility", "hidden");
    });
  });
});


// A quick script to add a Windows identifier to the sidebar so that the
// proper background images can be used
$(document).ready(function() {
  $("#sidebar").addClass($.os.name);
});