text: (function() {
  
      var quotes = $(".quotes");
      var quoteIndex = -1;
  
      function showNextQuote() {
          ++quoteIndex;
          quotes.eq(quoteIndex % quotes.length)
              .fadeIn(2000)
              .delay(2000)
              .fadeOut(2000, showNextQuote);
      }
  
      showNextQuote();
  
  })();​
  
  window.smoothScroll = function(target) {
    var scrollContainer = target;
    do { //find scroll container
        scrollContainer = scrollContainer.parentNode;
        if (!scrollContainer) return;
        scrollContainer.scrollTop += 1;
    } while (scrollContainer.scrollTop == 0);
  
    var targetY = 0;
    do { //find the top of target relatively to the container
        if (target == scrollContainer) break;
        targetY += target.offsetTop;
    } while (target = target.offsetParent);
  
    scroll = function(c, a, b, i) {
        i++; if (i > 30) return;
        c.scrollTop = a + (b - a) / 30 * i;
        setTimeout(function(){ scroll(c, a, b, i); }, 20);
    }
    // start scrolling
    scroll(scrollContainer, scrollContainer.scrollTop, targetY, 0);
  }
  
  window.addEventListener('DOMContentLoaded', () => {
  
  	const observer = new IntersectionObserver(entries => {
  		entries.forEach(entry => {
  			const id = entry.target.getAttribute('id');
  			if (entry.intersectionRatio > 0) {
  				document.querySelector(`nav li a[href="#${id}"]`).parentElement.classList.add('active');
  			} else {
  				document.querySelector(`nav li a[href="#${id}"]`).parentElement.classList.remove('active');
  			}
  		});
  	});
  
  	// Track all sections that have an `id` applied
  	document.querySelectorAll('section[id]').forEach((section) => {
  		observer.observe(section);
  	});
  	
  });
  
  var btn = $('#button');
  
  $(window).scroll(function() {
    if ($(window).scrollTop() > 300) {
      btn.addClass('show');
    } else {
      btn.removeClass('show');
    }
  });
  
  btn.on('click', function(e) {
    e.preventDefault();
    $('html, body').animate({scrollTop:0}, '300');
  });
  
  