    var isInViewport = function (elem) {
        var bounding = elem.getBoundingClientRect();
        return (
            bounding.top >= 0 &&
            bounding.left >= 0 &&
            bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
            bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
        );
    };
  
    var target = document.querySelector('.custom');
    var intersectionObserverOptions = {
      root: null,
      rootMargin: '0px',
      threshold: 1.0
    }
    var observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);
    observer.observe(target);
    function onIntersection(entries){
      entries.forEach(entry => {
        if (entry.intersectionRatio < 1) {
        document.body.classList.add('is-sticky');
        } else {
        document.body.classList.remove('is-sticky');
        }
      });
    }
  

    /*
   window.onscroll = function() {scrollFunction()};

   function scrollFunction() {
       const $header = document.getElementById('header');
       if (!$header) {
           return;
       }
       if (document.body.scrollTop > 0 || document.documentElement.scrollTop > 0) {
        document.body.classList.add('is-sticky');
        } else {
        document.body.classList.remove('is-sticky');
        }
   }
   */
    
  if(!!window.MSInputMethodContext && !!document.documentMode == true){
    document.body.classList.add("ie11");
  }


function targetBlank() {
  var internal = location.host.replace("www.", "");
      internal = new RegExp(internal, "i");
      
  var a = document.getElementsByTagName('a');
  for (var i = 0; i < a.length; i++) {
    var href = a[i].host;
    if( !internal.test(href) ) {
      a[i].setAttribute('target', '_blank');
      a[i].setAttribute('rel', 'noopener noreferrer');
    }
  }
};

targetBlank();