 $(document).ready(function() {
  $('dl > dd').hide();
  $('dl > dt').click(function() {
   $(this).toggleClass('expanded').next().toggle();
   return false;
  });
  $('table > tbody > tr:even:not(:last-child)').addClass('alternate');
  $('table > thead > tr > th > p.expand').click(function() {
   $(this).toggleClass('collapse').toggleClass('expand');
   if ($(this).is(':contains("Expand All")')) {
    $(this).text('Collapse All');
   } else {
    $(this).text('Expand All');
   }
   $('table > tbody > tr > th > dl > dt').toggleClass('expanded').next().toggle();
  });
  $('.expandable p.expand').click(function() {
   $(this).toggleClass('collapse').toggleClass('expand');
   if ($(this).is(':contains("Expand All")')) {
    $(this).text('Collapse All');
   } else {
    $(this).text('Expand All');
   }
   $('.expandable > dl > dt').toggleClass('expanded').next().toggle();
  });
 });
