/*Wie funktionierts START*/
jQuery(document).ready(function() {
  var box_n = 1;
  var box_open = 1;

  jQuery('#reporter-top div.box').each(function() {
    jQuery(this)
      .addClass('b' + box_n)
      .attr('box:n', box_n);
    box_n += 1;
  });
  jQuery('#reporter-top div.boxes').addClass('open' + box_open);
  jQuery('#reporter-top div.b1').addClass('opened');
  
  jQuery('#reporter-top div.box').click(function() {
    jQuery('#reporter-top div.box.opened').removeClass('opened');
    jQuery(this).addClass('opened');
    
    var box = jQuery(this).attr('box:n');
    jQuery('#reporter-top div.boxes')
      .removeClass('open' + box_open)
      .addClass('open' + box);
    box_open = box;
  });
});
/*Wie funktionierts END*/
/*FAQ start*/
function show_answer(anchor) {
  jQuery('div.faq_element').hide();
  var id = anchor.substring(1);
  var answer = jQuery('#' + id);
  answer.parents('div.faq_element').show();
  answer.slideDown(200);
}

jQuery(document).ready(function() {
  var anchor = location.hash;
  if (anchor != '#' && anchor != '') {
    show_answer(anchor);
  }
  
  jQuery('div.antwort a').click(function () {
    var href = jQuery(this).attr('href');
    var pos = href.lastIndexOf('#');
    if (pos >= 0) {
      var anchor = href.substring(pos);
      if (anchor != '#') {
        show_answer(anchor);
        return false;	  
      }
    }
  });

  jQuery('.faq_topic').click(function() {
    jQuery('div.faq_element').hide();
	  var thema = jQuery(this).attr('faq:thema');
	  jQuery('#' + thema).show();
	  return false;
  });

  jQuery('.question').toggle(function() {
    jQuery(this).next().slideDown(200);
  }, function() {
    jQuery(this).next().slideUp(200);
  });
}); 
/*FAQ END*/
/*Impressum START*/
jQuery(document).ready(function() {

  jQuery('#credit-handle').toggle(function() {
    jQuery('#credits').slideDown(100);
  }, function() {
    jQuery('#credits').slideUp(100);
  });
});
/*Impressum END*/
