
  (function(window, document, $) {
    return $(document).ready(function() {
      var currentPage, hostname;
      if (Modernizr.testAllProps('boxSizing')) {
        $('html').addClass("boxsizing");
      } else {
        $('html').addClass("no-boxsizing");
      }
      hostname = window.location.hostname;
      $("a[href^=http]").not("a[href*='" + hostname + "']").addClass("link external").attr("target", "_blank");
      $("html.ie *:first-child").addClass("first");
      $("html.ie *:last-child").addClass("last");
      currentPage = window.location.href;
      $("a").each(function(index) {
        var linkHref;
        linkHref = $(this)[0].href;
        if (linkHref === currentPage) return $(this).addClass("current");
      });
      window.equalize = function(height) {
        var wrapperHeight;
        wrapperHeight = $("#container").outerHeight();
        $("#wrapper").css({
          height: wrapperHeight < parseInt(wrapperHeight + height) ? parseInt(wrapperHeight + height) : void 0
        });
        return $('#main').css({
          height: height
        });
      };
      $("a.get-page").live("click", function(event) {
        event.preventDefault();
        return $(this).getPage();
      });
      $("a.tag").live("click", function(event) {
        var tag, tags;
        event.preventDefault();
        tag = $(this).text();
        tags = $("a.tag[rev=" + tag + "]");
        return tags.toggleClass("selected");
      });
      $(".item").live("click", function(event) {
        event.preventDefault();
        if ($(".item").find("a.selected").length > 0) {
          $(".item").each(function() {
            $(this).removeClass("tagged not-tagged");
            if ($(this).find("a.selected").length > 0) {
              return $(this).addClass("tagged");
            } else {
              return $(this).addClass("not-tagged");
            }
          });
        } else {
          $(".item").removeClass("tagged not-tagged");
        }
        if ($(this).hasClass("selected")) {
          return ".items".addClass("not-it");
        } else {
          return $(".items").removeClass("not-it");
        }
      });
      $("nav").find("a").live("click", function(event) {
        event.preventDefault();
        $("nav").find("a").removeClass("current");
        $(this).addClass("current");
        $("nav").find("li").removeClass("current");
        return $(this).closest("li").addClass("current");
      });
      $("ul.effects").find("a").click(function() {
        var effect, target;
        effect = $(this).attr("rel");
        target = $("link[rev=" + effect + "]") || false;
        if (target.length > 0) {
          target.remove();
        } else {
          $("head").append("<link rel=\"stylesheet\" rev=\"" + effect + "\" href=\"stylesheets/effect_" + effect + ".css\" type=\"text/css\" />");
        }
        return false;
      });
      $("ul.colors").find("a").click(function() {
        var scheme;
        scheme = $(this).attr("rel");
        $("link.color-scheme").remove();
        $("head").append("<link class=\"color-scheme\" rel=\"stylesheet\" rev=\"" + scheme + "\" href=\"stylesheets/color_" + scheme + ".css\" type=\"text/css\" />");
        return false;
      });
      return $("ul.colors").find("li:first-child").find("a").trigger("click");
    });
  })(window, document, jQuery);

