$(document).ready(function() {
$('.count').each(function () {
    $(this).prop('Counter',0).animate({
        Counter: $(this).text()
    }, {
        duration: 4000,
        easing: 'swing',
        step: function (now) {
            $(this).text(Math.ceil(now));
        }
    });
});
$(window).scroll(function(){
    if($(this).scrollTop() > 90){
    $(".header-top").addClass("fixed-top");
    }else{
    $(".header-top").removeClass("fixed-top");
    }
});

$(".video-player-button").modalVideo({
  youtube:{
    controls:0,
    nocookie: true
  }
});

//////////////////
$('.modalBtn').click(function(event) {
      event.preventDefault();
      var id = $(this).data('id');
      $(id).modal({
        fadeDuration:500,
        fadeDelay: 0.50
      });
    });

//////////////////
var owl = $('#testimonial');
    owl.owlCarousel({
      margin: 50,
      nav: true,
      loop: true,
autoHeight:true,
autoplay:false,
autoplayTimeout:2000,
      responsive: {
        0: {
          items: 1
        },
        600: {
          items: 1
        },
        1000: {
          items: 3,
          margin:30
        }
      }
    })

    var owl = $('#featured');
    owl.owlCarousel({
      nav: true,
      loop: true,
autoHeight:true,
autoplay:true,
autoplayTimeout:3000,
responsive: {
    0: {
        items: 4,
        nav: true,
        margin:10
    },
    600: {
        items:6,
        nav: false,
        margin:10
    },
    1000: {
        items:6,
        nav: true,
        loop: false,
        margin:0
    }
      }
    })

var owl = $('#products');
owl.owlCarousel({
    nav: true,
    loop: true,
    autoHeight:true,
    autoplay:false,
    autoplayTimeout:4000,
    responsive: {
        0: {
            items:1,
            nav: true
        },
        600: {
            items:2,
            nav: false
        },
        1000: {
            items:3,
            nav: true,
            margin:30
        }
    }
})
})
