Looking for a better way to make a FAQ page with fading objects

Looking for a better way to make a FAQ page with fading objects

Hi all

I'm kind of stuck here. I wanted to build a FAQ page with about 20 questions. To show the content of the questions I have a list with all questions and when you click on one question the answer is showing. Now I use the animation function (opacity:toggle) and a if/else to check which answer to fade in or out. I also use variables to know the status of the layer.
But since I have about 20 layers the JS will be huge and repeats itself. And if content is added I would have to change all code.
Is there a better way to do that, maybe more dynamic?

here's my script so fare:
  1. var que1 = 'on';
  2. var que2 = 'off';
  3. var que3 = 'off';

  4. $("a.q1").click(function() {
  5. if (que1 == 'off' && que2 == 'on') {
  6.           $("#que2").animate({
  7.             opacity: 'toggle'
  8.           }, setTimeout, function() {
  9.           $("#que1").animate({
  10.             opacity: 'toggle'}, 500);
  11.           });
  12.         que1 = 'on';
  13.    que2 = 'off';
  14. } else if (que1 == 'on') {
  15.  
  16. } else if (que1 == 'off' && que3 == 'on') {
  17.           $("#que3").animate({
  18.             opacity: 'toggle'
  19.           }, setTimeout, function() {
  20.           $("#que1").animate({
  21.             opacity: 'toggle'}, 500);
  22.           });
  23.         que1 = 'on';
  24.         que3 = 'off';
  25.         } else if …