$(document).ready(function () {
    


    // main menu
    jQuery(document).ready(function($) {
		// initialize FlexNav
		$(".flexnav").flexNav();
	});


    // scroll content - feeds
    $("#newsFeed .scrollContent div.feedItem").last().css("margin-bottom", "17px");
    $("#videoFeed .scrollContent div.feedItem").last().css("margin-bottom", "17px");
    $(".scrollContent div.eventItem").last().css("margin-bottom", "0px");
    
    $("#newsFeed .scrollContent").mCustomScrollbar({
		theme: "dark-3",
        mouseWheel: "disable",
        scrollButtons:{
			enable:true,
            scrollAmount: 240,
			scrollType:"stepped"
		},
    });
    
    $("#eventsFeed .scrollContent").mCustomScrollbar({
		theme: "dark-3",
        mouseWheel: "disable",
        scrollButtons:{
			enable:true,
            scrollAmount: 245,
			scrollType:"stepped"
		},
    });

    $("#videoFeed .scrollContent").mCustomScrollbar({
		theme: "dark-3",
        mouseWheel: "disable",
        scrollButtons:{
			enable:true,
            scrollAmount: 240,
			scrollType:"stepped"
		},
    });


    // bio landing page
    $("#bioLandWrap div.bioLand:nth-child(3n+1)").addClass("clearBio");
    if ($(window).width() < 634) {
        $("#bioLandWrap div.bioLand:nth-child(3n+1)").removeClass("clearBio");
        $("#bioLandWrap div.bioLand:nth-child(2n+1)").addClass("clearBio");
    }
    $(window).resize(function () {
        if ($(window).width() < 634) {
            $("#bioLandWrap div.bioLand:nth-child(3n+1)").removeClass("clearBio");
            $("#bioLandWrap div.bioLand:nth-child(2n+1)").addClass("clearBio");
        } else if ($(window).width() >= 634) {
            $("#bioLandWrap div.bioLand:nth-child(3n+1)").addClass("clearBio");
            $("#bioLandWrap div.bioLand:nth-child(2n+1)").removeClass("clearBio");
        }
    });


    // tabs
    $("#tab_buttons ul li").first().addClass("firsttab");
    
        //Accessibility helper
    $('.noscript').removeClass('noscript');

    //Show menu when focused
    $('.skip_links a').focus(function() {$('.skip_links').addClass('noscript');});
    $('.skip_links a').blur(function() {$('.skip_links').removeClass('noscript');});
    

  
  

    
      // 
   
 $(window).scroll(function () {


        if ($(window).width() > 734) {
      $('#header').addClass('navbar-fixed');
      $('#gallery').addClass('navbar-fixed');
        } else {
      $('#header').removeClass('navbar-fixed');
      $('#gallery').removeClass('navbar-fixed');
        }
        
        
            $('.topButton').addClass('visible');


  });




});

