var timer;

$(document).ready(function() {
    !window.location.hash ?  
        hideAllExcept('#' + $('#toggleThis > div:first').attr('id')) 
            : hideAllExcept(window.location.hash);

    $('a.toggle').click(function() {
        var href = $(this).attr('href');
        window.location.hash = href;
        hideAllExcept(href);

        return false;
    });
});

function hideAllExcept(el) {
    $('a.toggle').removeClass('active');
    $('a[href="'+el+'"]').addClass('active'); // requires jquery 1.3

    $('#toggleThis > div').addClass('hide');
    $(el).removeClass('hide');
    window.scrollTo(0, 0); // keep page at top during page load.

    // new timer
    screensaver();
}

function screensaver() {

  // clear timer
  window.clearTimeout(window.timer);

  window.timer = setTimeout(function() {
      hideAllExcept("#BLANK");
  }, 10000);
}
