$(document).ready(function(){
  $("#dim-lights").click(function() {
    var color = $("body").css("background-color");
    //$(this).text(color);
    // We really should be swapping classes, not messing with the element style of every
    // element.
    if (color == "rgb(255, 255, 255)" || color == "rgb(255,255,255)" || color == "#ffffff" || color == "#fff") {
      $("body").css("background-color", "rgb(127, 127, 127)");
      $("#main a,#main a:link,#main a:hover").css("color", "rgb(202, 202, 202)");
      $("h3,#stream_title").css("border-bottom-color", "rgb(93, 93, 93)");
      $(".tourn-infobox-body-content").
          css("background-color",  "rgb(120, 120, 120) !important");
      $(".tourn-infobox-item").css("border-bottom", "1px dashed #666");
      $(".tourn-infobox-header").css("color", "rgb(64, 64, 64)");
      $(this).text("Raise the Lights");
    }
    else {
      $("body").css("background-color", "rgb(255, 255, 255)");
      $("#main a,#main a:link,#main a:hover").css("color", "rgb(180, 24, 24)");
      $("h3,#stream_title").css("border-bottom-color", "rgb(221, 221, 221)");
      $(".tourn-infobox-body-content").
          css("background-color", "rgb(248, 248, 248) !important");
      $(".tourn-infobox-item").css("border-bottom", "1px dashed #DDD");
      $(".tourn-infobox-header").css("color", "rgb(255, 255, 255)");
      $(this).text("Dim the Lights");
    }
  });
});

