function init() {
  $('td > .toggle-button').click(function() {
    $(this.parentNode.parentNode.parentNode.parentNode).toggleClass('expanded');
  })

  $('dt > .toggle-button').click(function() {
    $(this.parentNode.parentNode).toggleClass('expanded');
  })

  $('#show-all').click(function () {
    var $this = $(this);
    var text  = $this.text();
    if (/Show/.test(text)) {
      $('.test').addClass('expanded');
      text = text.replace('Show', 'Hide');
    }
    else {
      $('.test').removeClass('expanded');
      text = text.replace('Hide', 'Show');
    }
    $this.text(text);
    return false;
  });
}

$(init);

