$(document).ready(function() {

  function toggleSection(head) {
    if (head.hasClass('expanded')) {
      head.removeClass('expanded');
    }
    else {
      head.addClass('expanded');
    }
    head.next().toggle('fast');
  }

  $('#content .accordion > h4, #content .accordion > h3').click(function() {
    var self = $(this);
    toggleSection(self);
    return false;
  });

});
