title: close other div when div1 is show and duplicate code pb jquery
body: <p>I have 2 problems<br>
  1.First i need to allow only one div open , so when div question1 is show
  div question2 and all other  should hide, actually its not case in my poor code :).</p>
  
  <p>2.Second problem , I achieve to made a code with an addclass when "is checked", but actually i duplicate all the code for each div .. Perhaps someone have a better elegant option to merge the code and avoiding duplicate code..</p>
  
  <pre><code>   $(".checkbox").hide();
      $(".question").show();
  
      $('.question').click(function(){
      $(".checkbox").toggle(10);
      });
  
  
  $('#test').change(function(){
      if($(' input[type=checkbox]:checked').length) {
          $('div.question').addClass("question-active");
      } else {
          $('div.question').removeClass("question-active");
      }
  });
  
  $(".checkbox2").hide();
      $(".question2").show();
  
      $('.question2').click(function(){
      $(".checkbox2").toggle(10);
      });
  
  
  $('#test2').change(function(){
      if($(' input[type=checkbox]:checked').length) {
          $('div.question2').addClass("question-active");
      } else {
          $('div.question2').removeClass("question-active");
      }
  });
  </code></pre>
  
  <p>Here is my code : <a href="http://jsfiddle.net/5C3p9/3/" rel="nofollow">http://jsfiddle.net/5C3p9/3/</a></p>
  
  <p>Thanks for help</p>
  
  <p>Regards</p>