r target = $(id);
      target.parent().show();
      $('html,body').animate({
        scrollTop: target.offset().top,
      }, 100);
      $("body").scrollspy('refresh');
    }

    if (location.hash) {
      setTimeout(function () {
        if (location.hash) {
          goToId(location.hash);
        }
      }, 1);
    }

    $("a").click(function (event) {
      var urlBeforeHashRegEx = new RegExp("^" + window.location.href.split("#")[0]);
      if (/^#/.test(this.hash) && urlBeforeHashRegEx.test(this.h