jQuery(function($) {
    "use strict";

    // Scroll to top functionality
    $(window).on('scroll', function() {
        if ($(this).scrollTop() >= 50) {
            $('#return-to-top').fadeIn(200);
        } else {
            $('#return-to-top').fadeOut(200);
        }
    });

    $('#return-to-top').on('click', function() {
        $('body,html').animate({ scrollTop: 0 }, 500);
    });

    // Side navigation toggle
    $('.gb_toggle').on('click', function() {
        manufacturing_hub_Keyboard_loop($('.side_gb_nav'));
    });

    // Preloader fade out
    setTimeout(function() {
        $(".loader").fadeOut("slow");
    }, 1000);

});

// Mobile responsive menu
function manufacturing_hub_menu_open_nav() {
    jQuery(".sidenav").addClass('open');
}

function manufacturing_hub_menu_close_nav() {
    jQuery(".sidenav").removeClass('open');
}


jQuery(document).ready(function($) {
  $('.main-sliders.owl-carousel').owlCarousel({
    items: 1,
    loop: true,
    nav: false,
    dots: false,
    autoplay: false,
    animateOut: 'slideOutUp',
    animateIn: 'slideInDown',
    smartSpeed: 800,
  });
});

// About
jQuery(document).ready(function($) {
  // Initialize the .abt-cat slider
  $('.abt-cat .owl-carousel').owlCarousel({
    loop: false,
    margin: 0,
    nav: false,
    dots: false,
    rtl: false,
    items: 3,
    autoplay: false,
    autoplayTimeout: 3000,
    autoplayHoverPause: true
  });
});

jQuery(document).ready(function ($) {
  $(".services-carousel").owlCarousel({
      loop: true,
      margin: 30,
      nav: false,
      dots: false,
      autoplay: false,
      autoplayTimeout: 3000,
      responsive: {
          0: {
              items: 1
          },
          768: {
              items: 2
          },
          1024: {
              items: 3
          }
      }
  });
});