var Comments = {
  toggle_comment_section: function(element) {
    var section = jQuery(element).parents('.comment_section');
    section.find('.controls').toggleClass('hide');
    section.find('div.add_comment').toggleClass('hide');

    if (section.find('div.add_comment.hide').length == 0) {
      section.find('div.add_comment textarea').focus();
    }
    return false;
  },
  activate_comments: function(){
    jQuery("a.add_comment-button").click(function () {
      return Comments.toggle_comment_section(this);
    });

    jQuery("a.cancel_comment").click(function () {
      return Comments.toggle_comment_section(this);
    });
  }
}

activator_class(Comments);
