if (typeof(loadFirebugConsole) != 'undefined') { loadFirebugConsole(); }
if (typeof(console) == 'undefined') { console = {debug: function() {}}; }

$(document).ready(function() {
  var section = (location.hash.length > 0)?location.hash:'#overview';
  $('.section')
    .hide()
    .filter(section)
      .show();
  
  $('#nav a').click(function(e) {
    var href = $(this).attr('href');
    if (href.indexOf('#') === 0) {
      $('.section')
        .hide()
        .filter(href)
          .show();
    }
  });
  
  $('#htmlFaq #faqList').simpleFAQ();
  $('#htmlFaq #faqList').bind('show.simpleFAQ', function(jQEvent, faqNode) {
    console.debug(faqNode);
  });
  
  $('#jsonFaq #faqList').simpleFAQ({
    data: faqs
  });
  
  $('#searchFaq #faqList').simpleFAQ({
    showOnlyOne: true,
    allowSearch: true,
    searchNode: '#faqSearch',
    minSearchScore: 0.5,
    sortSearch: true
  });
  $('#searchFaq #faqList').bind('searchStart.simpleFAQ', function(jQEvent) {
    console.debug("Search started...");
  });
  $('#searchFaq #faqList').bind('sort.simpleFAQ', function(jQEvent, results) {
    console.debug(results);
  });
  $('#searchFaq #faqList').bind('searchEnd.simpleFAQ', function(jQEvent, results) {
    console.debug(results);
    console.debug("...complete.");
  });
  
});

var faqs = [
  {
    question: "How do I change my password or email address?",
    answer: "<p>Any time you need to change your password or email address, just visit the 'Settings' page by clicking on the link at the bottom of every page. When changing your password, simply enter the new password, click on the button, and then confirm your old password.</p><p><strong> Note that if you change your email address, you will need to log in with the new address thereafter!  </strong></p>",
    tags: "change password, change email address, account settings, user settings"
  }
];

