$(document).ready(function(){
  // close the offDiv content sections
  //(doing this with js instead of css means if no js, content is all visible)
  $('.offDiv > .show-hide').hide();
  // show the correct buttons for each div
  // they are hidden with css for no-js users
  $('.offDiv > .showLink').show();

// showLink shows the content
$('a.showLink').click(function(){
  $(this).siblings('.show-hide').slideToggle('fast');
  $(this).parents('.offDiv').removeClass().addClass('onDiv');
  $('a.hideAll').show();
  $(this).hide();
  $(this).siblings('.hideLink').show();
  return false;
});
// hideLink hides the content
$('a.hideLink').click(function(){
  $(this).siblings('.show-hide').slideToggle('fast');
  $(this).parents('.onDiv').removeClass().addClass('offDiv');
  $('a.showAll').show();
  $(this).hide();
  $(this).siblings('.showLink').show();
  return false;
});

 // title is clickable, and toggles the content
$(".faqTitle").click( function() { 
  $(this).next("div").slideToggle('fast');
  $(this).parent("div").toggleClass('offDiv');
  $(this).parent("div").toggleClass('onDiv');
  $(this).siblings("a").toggle();
 } );

$('.offDiv >.faqTitle').click(function(){
  $('a.hideAll').show();
  });

$('.onDiv >.faqTitle').click(function(){
  $('a.showAll').show();
  }); 

});


