$(function() {
    $(window).scroll(function() {
        var winTop = $(window).scrollTop();
        if (winTop >= 30) {
            $("body").addClass("sticky-header");
        } else {
            $("body").removeClass("sticky-header");
        } //if-else
    }); //win func.
}); //ready func.

$('.slider-primary').owlCarousel({
    loop: true,
    center: true,
    animateOut: 'fadeOut',
    animateIn: 'fadeIn',
    autoplay: true,
    autoplayTimeout: 3000,
    items: 1,
    rtl: true,
    smartSpeed: 450
});
$('#logo-slider1').owlCarousel({
    items: 1,
    rtl: true,
    autoplay: true,
    loop: true,
    autoplayTimeout: 3000,
    smartSpeed: 450
})
$('#logo-slider2').owlCarousel({
    items: 1,
    rtl: true,
    autoplay: true,
    loop: true,
    autoplayTimeout: 5000,
    smartSpeed: 450
});
$('.news-carousel').owlCarousel({
    loop: true,
    autoplay: true,
    autoplayTimeout: 2000,
    items: 1,
    rtl: true,
    smartSpeed: 450
});
jQuery(document).ready(function($) {
    "use strict";
    //  TESTIMONIALS CAROUSEL HOOK
    $('#customers-testimonials').owlCarousel({
        loop: true,
        center: true,
        items: 5,
        margin: 0,
        rtl: true,
        autoplay: true,
        dots: false,
        nav: true,
        autoplayTimeout: 3000,
        smartSpeed: 450,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 2
            },
            768: {
                items: 3
            },
            1170: {
                items: 4
            },
            1200: {
                items: 5
            }
        }
    });
});

$(document).ready(function() {
    // Show or hide the sticky footer button
    $(window).scroll(function() {
        if ($(this).scrollTop() > 200) {
            $('.go-top').fadeIn(200);
        } else {
            $('.go-top').fadeOut(200);
        }
    });

    // Animate the scroll to top
    $('.go-top').click(function(event) {
        event.preventDefault();

        $('html, body').animate({
            scrollTop: 0
        }, 300);
    })
});