(function() {
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };

  Home.Views || (Home.Views = {});

  Home.Views.Index = (function() {

    __extends(Index, Backbone.View);

    function Index() {
      Index.__super__.constructor.apply(this, arguments);
    }

    Index.prototype.initialize = function(attr) {
      _.bindAll(this, 'render');
      this.path = attr["path"];
      return this;
    };

    Index.prototype.events = {
      "click .nav a": "unMark",
      "mouseenter .inner-body": "show",
      "mouseleave .inner-body": "hide",
      "mouseenter .nav a": "showMenu",
      "mouseleave .nav a": "hideMenu"
    };

    Index.prototype.unMark = function(evn) {
      evn.preventDefault();
      if ($(evn.currentTarget).attr("href") === "#" + this.path) {
        window.location = "#";
        $(".nav li a[href=#" + this.path + "] img").css("display", "none");
      } else {
        window.location = $(evn.currentTarget).attr("href");
      }
      return this;
    };

    Index.prototype.show = function(evn) {
      return this.showPad($(evn.currentTarget));
    };

    Index.prototype.showMenu = function(evn) {
      return this.showPad($($(evn.currentTarget).attr("href")));
    };

    Index.prototype.showPad = function(pad) {
      var panel, slide;
      panel = pad.children(".title");
      slide = pad.children(".slide");
      panel.slideUp();
      return slide.animate({
        opacity: 1
      }, 800);
    };

    Index.prototype.hide = function(evn) {
      return this.hidePad($(evn.currentTarget));
    };

    Index.prototype.hideMenu = function(evn) {
      return this.hidePad($($(evn.currentTarget).attr("href")));
    };

    Index.prototype.hidePad = function(pad) {
      var panel, slide;
      if ($(pad).attr("id") !== this.path) {
        panel = pad.children(".title");
        slide = pad.children(".slide");
        panel.slideDown();
        return slide.animate({
          opacity: 0
        }, 800);
      }
    };

    Index.prototype.render = function() {
      var that;
      that = this;
      $(".nav li a").removeClass("active");
      $(".nav li a[href=#" + this.path + "]").addClass("active");
      $(".inner-body").each(function() {
        that.hidePad($(this));
        return $(".nav li a[href=#" + $(this).attr("id") + "] img").css("display", "none");
      });
      this.showPad($("#" + this.path));
      $(".nav li a[href=#" + this.path + "] img").css("display", "inline");
      return this;
    };

    return Index;

  })();

}).call(this);

