$(function() {
  faqFunctions();
  fixFooter();
  $(window).resize(function() { fixFooter() });
})

faqFunctions = function() {
  $('.BlockLevel1').hide();
  $('.blockHeader').click(function() {
    $(window).unbind();
    $('.BlockLevel1:visible').slideUp('slow');
    $('#folder'+ this.id.substr(6, 2) +':hidden').slideToggle('slow');
  });
}

/**
 * Keep footer at bottom of page (in case content isn't covered).
 */
fixFooter = function() {
  if ($.browser.mozilla) {
    _top = window.innerHeight - $('#footer').height() - $('#container').height();
/*    console.log('_top: '+ _top +"\n container:"+ $('#container').height());  */
    if (_top > 0) {
      $('#footer').css({top: _top});
    }
    else {
      $('#footer').css({top: 'auto'});
    }
  }
}