(function() {
  var _ref;

  $(function() {
    var Container, addListeners, setHow, setLetsGo, setWhat, setWho;
    Container = (function() {

      function Container(content) {
        this.content = content;
        this.template = "" + this.content + "-template";
        this.change();
      }

      Container.prototype.change = function() {
        var target;
        $("#nav span").removeClass('selected');
        $("span#" + this.content).addClass('selected');
        this.fadeSpeed = 'fast';
        target = $("#content");
        return target.fadeOut(this.fadeSpeed, function() {
          return app.container.fadeIn();
        });
      };

      Container.prototype.fadeIn = function() {
        var magick, target;
        magick = $("#magick-bg");
        target = $("#content");
        target.html($("#" + this.template).html());
        return target.fadeIn(this.fadeSpeed);
      };

      return Container;

    })();
    addListeners = function() {
      $("span#who a").click(setWho);
      $("span#what a").click(setWhat);
      $("span#how a").click(setHow);
      return $("span#lets-go a").click(setLetsGo);
    };
    setWho = function() {
      return app.container = new Container("who");
    };
    setWhat = function() {
      return app.container = new Container("what");
    };
    setHow = function() {
      return app.container = new Container("how");
    };
    setLetsGo = function() {
      return app.container = new Container("lets-go");
    };
    setWho();
    return addListeners();
  });

  this.app = (_ref = window.app) != null ? _ref : {};

}).call(this);

