/* Author:
  Maciej Kolodziej
*/

function toggleFoldable(foldableHeader) {
  var speed = 300;
  var el = $(foldableHeader);
  
  // get the parent of the clicked h3 (div.foldable) and hide ul's for it's siblings and remove class
  el.parent().siblings().each(function(index) {
    
    h3 = $(this).children('h3').first();
    if(h3.hasClass("unfolded")) {
      h3.removeClass("unfolded");
      $(this).children('ul').first().slideUp(speed);
    }
  });
    
  el.toggleClass("unfolded");
  el.next('ul').slideToggle(speed);
}

function slideUp() {
  $(this).children('.drop-down').first().slideUp('fast');
}

function slideDown() {
  $(this).children('.drop-down').first().slideDown('fast');
}
