jQuery.noConflict();
jQuery(document).ready(function ($){

  // Add JS-CSS-Style class to all H5 elements.
  var int_listHeight = 0;
  $(".ipd_breed_datasheet_narrow_2009_sectionText").addClass("ipd_breed_datasheet_narrow_2009_sectionTextClosed");
  $(".ipd_breed_datasheet_narrow_2009_sectionText:first").each(function () {
    $(this).removeClass("ipd_breed_datasheet_narrow_2009_sectionTextClosed");
    $(this).parent().find("h5").addClass("ipd_breed_datasheet_narrow_2009_breedSectionsJsTitleOpend");

    int_listHeight = $(this).height() + $(this).parent().find("h5").height() + 30;
  });

  // Compute the new height of the list element
  $("#ipd_breed_datasheet_narrow_2009_breedSections ul").height(int_listHeight + "px");

  // Add JS-CSS-Style class to all H5 elements.
  $("#ipd_breed_datasheet_narrow_2009_breedSections h5").addClass("ipd_breed_datasheet_narrow_2009_breedSectionsJsTitle");

  // Add JS-CSS-Style class to all LI elements.
  $("#ipd_breed_datasheet_narrow_2009_breedSections li").addClass("ipd_breed_datasheet_narrow_2009_breedSectionsJsListElement");

  // Bind onclick function to all "stripes"
  $("#ipd_breed_datasheet_narrow_2009_breedSections h5").click(function () {
    // Remove "JsTitleOpend" class from all h5 elements
    $("#ipd_breed_datasheet_narrow_2009_breedSections h5").removeClass("ipd_breed_datasheet_narrow_2009_breedSectionsJsTitleOpend");

    // Add "JsTitleOpend" class to the current element
    $(this).addClass("ipd_breed_datasheet_narrow_2009_breedSectionsJsTitleOpend");

    // Close current tab
    $(".ipd_breed_datasheet_narrow_2009_sectionText:not(.ipd_breed_datasheet_narrow_2009_sectionTextClosed)").addClass("ipd_breed_datasheet_narrow_2009_sectionTextClosed");

    // Open new tab
    $(this).parent().find(".ipd_breed_datasheet_narrow_2009_sectionText").each(function() {
      $(this).removeClass("ipd_breed_datasheet_narrow_2009_sectionTextClosed");

      // Compute the new height of the list element
      int_listHeight = $(this).height() + $(this).parent().find("h5").height() + 30;
      $("#ipd_breed_datasheet_narrow_2009_breedSections ul").height(int_listHeight + "px");
    });
  });

});

