


const navbar = document.querySelector('#stikyNav');
//let top = navbar.offsetTop;
function stickynavbar() {
  if (window.scrollY >= 200) {    
    navbar.classList.add('sticky');
  } else {
    navbar.classList.remove('sticky');    
  }
}
  window.addEventListener('scroll', stickynavbar);


  document.addEventListener("DOMContentLoaded", () => {
 function counter(id, start, end, duration) {
  let obj = document.getElementById(id),
   current = start,
   range = end - start,
   increment = end > start ? 1 : -1,
   step = Math.abs(Math.floor(duration / range)),
   timer = setInterval(() => {
    current += increment;
    obj.textContent = current;
    if (current == end) {
     clearInterval(timer);
    }
   }, step);
 }
counter("count3", 0, 216, 3000);
 counter("count4", 100, 38, 2500);
 counter("count5", 0, 35, 3000);
 counter("count6", 100, 8, 2500);
 counter("count7", 0, 10, 3000);
 
});




$(document).ready(function(){
    
    $('#clickTop').hide();
    
    //Check to see if the window is top if not then display button
    
    $(window).scroll(function(){
        if ($(this).scrollTop() > 300) {
            $('#clickTop').fadeIn();
        } else {
            $('#clickTop').fadeOut();
        }
    });
    
    //Click event to scroll to top
    
    $('#clickTop').click(function(){
        $('html, body').animate({scrollTop : 0},500);
        return false;
    });
    
});








  function myFunction() {
    var dots = document.getElementById("dots");
    var moreText = document.getElementById("more");
    var btnText = document.getElementById("myBtn");
  
    if (dots.style.display === "none") {
      dots.style.display = "inline";
      btnText.innerHTML = "Read more"; 
      moreText.style.display = "none";
    } else {
      dots.style.display = "none";
      btnText.innerHTML = "Read less"; 
      moreText.style.display = "inline";
    }
  }



  $('#owl-carousel').owlCarousel({
    loop: true,
    margin: 30,
    dots: true,
    nav: false,
    items: 4,
    // navText: ["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"],
    autoplay: false,
    // autoplayHoverPause:true,
    // slideTransition: 'linear',
    // autoplayTimeout: 5000,
    // autoplaySpeed: 70000,
    // loop: true,
    responsive:{
    0:{
        items:1,
       
    },
    767:{
        items:2,
       
    },
    991:{
        items:3,
        
    },

    992:{
        items:3,
        
    },

    1200:{
        items:4,
        
    },
    
    1366:{
        items:4,
       
    },
    1920:{
        items:4,
        
    }
}
    
})


$('#owl-carousel').owlCarousel({
    loop: true,
    margin: 30,
    dots: false,
    nav: false,
    items: 1,
    autoplay:true,
})



$('#owl-carousel_sustain').owlCarousel({
    loop: true,
    margin: 30,
    dots: false,
    nav: false,
    items: 1,
    autoplay:true,
})

$('#owl-carousel_sustain1').owlCarousel({
    loop: true,
    margin: 30,
    dots: false,
    nav: false,
    items: 1,
    autoplay:true,
})

$('#owl-carousel_sustain2').owlCarousel({
    loop: true,
    margin: 30,
    dots: false,
    nav: false,
    items: 1,
    autoplay:true,
})

$('#owl-carousel_client').owlCarousel({
    loop: true,
    margin: 30,
    dots: false,
    nav: false,
    items: 6,
    autoplay:true,
     autoplayHoverPause:true,
    slideTransition: 'linear',
    autoplayTimeout: 3000,
    autoplaySpeed: 3000,
    loop: true,
     responsive:{
    0:{
        items:3,
       
    },
    767:{
        items:4,
       
    },
    991:{
        items:5,
        
    },

    992:{
        items:6,
        
    },

    1200:{
        items:6,
        
    },
    
    1366:{
        items:6,
       
    },
    1920:{
        items:6,
        
    }
}
})



