/* Back To Top */
var $backToTop = $("#backtop2");
    $backToTop.hide();
    $(window).on('scroll', function() {
      if ($(this).scrollTop() > 100) {
        $backToTop.fadeIn();
      } else {
        $backToTop.fadeOut();
      }
});

$backToTop.on('click', function(e) {
      $("html, body").animate({scrollTop: 0}, 500);
});

/* Fixed Header */
window.onscroll = function() {myFunction()};
var header = document.getElementById("main-header");
var sticky = header.offsetTop;
function myFunction() {
  if (window.pageYOffset > sticky) {
    header.classList.add("sticky");
  } else {
    header.classList.remove("sticky");
  }
}