

(function($) {
    "use strict";


    jQuery(document).ready(function($) {

        $(".navbar-nav .nav-link").on('click', function(){
            $(".navbar-collapse").removeClass("show");
        });

       
        $('.page-scroll').on('click', function(event) {
            var $anchor = $(this);
            $('html, body').stop().animate({
                scrollTop: $($anchor.attr('href')).offset().top
            }, 1500, 'easeInOutExpo');
            event.preventDefault();
        });

        $("#navbarCollapse").scrollspy({ offset: 0});

       
        $(".element").each(function(){
            var $this = $(this);
                $this.typed({
                strings: $this.attr('data-elements').split(','),
                typeSpeed: 100,
                loop: true,
                startDelay: 1000,
                backDelay: 1000,
            });
        });

        $(".text-rotate").textrotator({
            animation: "flipUp",
            speed: 1750
        });

        
        $('#partner-slider-1, #partner-slider-2').owlCarousel({
            loop : true,
            dots : false,
            nav : false,
            autoplay : true,
            autoplayHoverPause : true,
            autoHeight : true,
            responsiveCla1ss :true,
            responsive : {
                0 : {
                    items: 2
                },
                540 : {
                    items: 2,
                },
                720 : {
                    items: 3,
                },
                992 : {
                    items: 3,
                },
                1140 : {
                    items: 4,
                },
            }
        });

        $('#testimonial-slider').owlCarousel({
            loop : true,
            dots : false,
            nav : false,
            autoplay : true,
            autoplayHoverPause : true,
            autoHeight : true,
            responsiveClass :true,
            responsive : {
                0 : {
                    items: 1
                },
                540 : {
                    items: 1,
                },
                720 : {
                    items: 1,
                },
                992 : {
                    items: 2,
                },
                1140 : {
                    items: 2,
                },
            }
        });

     
        //$('.counter-value').counterUp({
        //    delay: 10,
        //    time: 1000
        //});

       
        $(".card").on("show.bs.collapse hide.bs.collapse", function(e) {
            if (e.type=='show'){
                $(this).addClass('active');
            }
            else{
                $(this).removeClass('active');
            }
        });

       
        $(document).on("focusout",".form-control",function(){
            if($(this).val() != ""){
                $(this).addClass("has-content");
            }else{
                $(this).removeClass("has-content");
            }
        });


        $(window).on("scroll", function() {
            if ($(this).scrollTop() > 100) { 
                $('#back-to-top').fadeIn(); 
            } else { 
                $('#back-to-top').fadeOut(); 
            } 
        }); 
        $("#back-to-top").on("click", function(){
            $("html, body").animate({ scrollTop: 0 }, 1000); 
            return false; 
        });



        var wow = new WOW({
            boxClass:     'wow',      
            animateClass: 'animated', 
            offset:       100,          
            mobile:       true,      
            live:         true,      
        });
        wow.init();

    });

    
    
    jQuery(window).on('load', function() {
        $('body').imagesLoaded( function() {
            $('body').css({"overflow": "visible"});
        });

    });


}(jQuery));