
jQuery(document).ready(function(){
	$('.faq_question').click(function() {
	  $(this).next().toggle();
		return false;
	}).next().hide();
	
	$('.faq_expand_all').click(function() {
		if($(this).hasClass('faq_all_expanded')) {
      $(this).removeClass("faq_all_expanded");
      $(this).html("Expand all");
  		$('.faq_question').next().hide();
  		$('.faq_expand_some').removeClass("faq_some_expanded");
      $('.faq_expand_some').html("Expand some");
    } else {
      $(this).addClass("faq_all_expanded");
      $(this).html("Collapse all");
      $('.faq_question').next().show();
  		$('.faq_expand_some').addClass("faq_some_expanded");
      $('.faq_expand_some').html("Collapse some");
    };
		return false;
  });
  
  $('.faq_expand_some').click(function() {
		if($(this).hasClass('faq_some_expanded')) {
      $(this).removeClass("faq_some_expanded");
      $(this).html("Expand section");
  		$('.faq_question.'+$(this).attr('rel')).next().hide();
    } else {
      $(this).addClass("faq_some_expanded");
      $(this).html("Collapse section");
      $('.faq_question.'+$(this).attr('rel')).next().show();
    };


		return false;
	});
});