;
(function($) {
    "use strict";
    //Mobile Menu
    $("#primary-menu").slicknav({
        allowParentLinks: true,
        prependTo: '#mobile',
        label: 'Menu',
    });
    var sf = $('#primary-menu').superfish({
        delay: 500, // one second delay on mouseout
        animation: { opacity: 'show', height: 'show' }, // fade-in and slide-down animation
        speed: 'fast', // faster animation speed
    });
    if ($('.braking').length) {
        $('.braking').owlCarousel({
            loop: true,
            margin: 10,
            items: 1,
            nav: true,
            dots: false,
            autoplay: true,
            autoplayTimeout: 2000,
            autoplayHoverPause: true
        })
    }
    if ($('.home-post-slider').length) {
        $('.home-post-slider').owlCarousel({
            loop: true,
            margin: 10,
            items: 1,
            nav: false,
            dots: true,
            autoplay: true,
            autoplayTimeout: 3000,
            autoplayHoverPause: true
        })
    }
    // Bottom to top 
    $(window).on('scroll', function() {
        if ($(this).scrollTop() > 300) {
            $('#back-top').fadeIn();
        } else {
            $('#back-top').fadeOut();
        }
    });
    $('#back-top').on('click', function() {
        $("html, body").animate({
            scrollTop: 0
        }, 1000);
        return false;
    });
    if ($('.category-menu ul li').length) {
        $('.category-menu ul li').on('click', function() {
            $('.category-menu ul li').removeClass('active');
            $(this).addClass('active');
            var selector = $(this).attr('data-filter');
            $('.anews-hcat-list').isotope({
                filter: selector,
            });
        });
        $(".anews-hcat-list").isotope({
            layoutMode: 'fitRows',
        });
    }

}(jQuery))