$( '#topheader .navbar-nav a' ).on( 'click', function () {
	$( '#topheader .navbar-nav' ).find( 'li.active' ).removeClass( 'active' );
	$( this ).parent( 'li' ).addClass( 'active' );
});


$(function() {
  $('.slide').slide({

    // auto play
    isAutoSlide: false, 

    // pause on hover
    isHoverStop: true,

    // pause when window loses focus
    isBlurStop: true,

    // shows pagination bullets
    isShowDots: true,

    // shows navigation arrows
    isShowArrow: true,

    // shows navigation arrows on hover
    isHoverShowArrow: true,

    // load all images on load
    isLoadAllImgs: false,

    // sliding speed
    slideSpeed: 2000,

    // switching speed
    switchSpeed: 500,

    // click, mouseover or mouseenter
    dotsEvent: 'click',

    // default CSS classes
    dotsClass: 'dots',  
    dotActiveClass: 'active', 
    arrowClass: 'arrow',
    arrowLeftClass: 'arrow-left', 
    arrowRightClass: 'arrow-right'

  });
});

$(document).ready(function(){
  $(".navbar-expand-md .navbar-nav .nav-link:last").css("border-right", "none");
});


// Add active class to the current button (highlight it)
var header = document.getElementById("navbar");
var btns = header.getElementsByClassName(".navbar .navbar-nav>.active>a");
for (var i = 0; i < btns.length; i++) {
  btns[i].addEventListener("click", function() {
  var current = document.getElementsByClassName("active");
  current[0].className = current[0].className.replace(" active", "");
  this.className += " active";
  });
}