function stickyHeader () {
	if ($('.menubar').length) {
		var strickyScrollPos = 100;
		if($(window).scrollTop() > strickyScrollPos) {
			$('.menubar').removeClass('fadeIn animated');
	      	$('.menubar').addClass('stricky-fixed fadeInDown animated');
		}
		else if($(this).scrollTop() <= strickyScrollPos) {
			$('.menubar').removeClass('stricky-fixed fadeInDown animated');
	      	$('.menubar').addClass('slideIn animated');
		}
	};
} 

jQuery(window).on('scroll', function () {
	(function ($) {
		stickyHeader();
	})(jQuery);
});

function mobiletNavToggler() {
    if ($('.navigation').length) {
        $('.navigation .navbar button').on('click', function () {
            $('.navigation .menu').slideToggle();
            $(this).toggleClass('open');            
            return false;
        });
        
    
        
        $('.navigation .cs-submenu').children('a').append(function () {
            return '<button class="dropdown-expander"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg></button>';
        });
        $('.navigation .menu .dropdown-expander').on('click', function () {
            $(this).parent().parent().children('.cs-dropdown').slideToggle();
            console.log($(this).parents('li'));
            return false;
        });
    }
}

if (document.documentElement.clientWidth < 980) {
$(document).click(function (e) {
        if (!$(e.target).closest('.navigation .navbar button').length) {
            $('.menu').stop(true).slideUp();
            $(".navigation .navbar button").removeClass('open');
        }
    });
}



$(document).ready(function(){
    (function ($) {
        mobiletNavToggler();
    })(jQuery);
  });


$(".results").slick({
    dots: false,
    infinite: true,
    autoplay: true,
    arrows:false,
    slidesToShow: 4,
    slidesToScroll: 1,
    responsive: [{
        breakpoint: 1023,
        settings: {
            slidesToShow: 3,
            slidesToScroll: 1,
            infinite: true,
            dots: true
        }
    }, {
        breakpoint: 600,
        settings: {
            slidesToShow: 2,
            slidesToScroll: 1
        }
    }, {
        breakpoint: 480,
        settings: {
            slidesToShow: 1,
            slidesToScroll: 1
        }
    }]
});


$(".wps_featured").slick({
    dots: false,
    infinite: false,
    autoplay: true,
    slidesToShow: 3,
    slidesToScroll: 1,
    responsive: [
    {
      breakpoint: 1023,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 1,
        infinite: true,
        dots: true
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1
      }
    }
  ]
});


$(".testimonials").slick({
    dots: false,
    infinite: true,
    autoplay: true,
    arrows: false,
    slidesToShow: 1,
    slidesToScroll: 1
});


$(".trade_partner").slick({
    dots: true,
    infinite: true,
    arrows: false,
    autoplay: true,
    slidesToShow: 5,
    slidesToScroll: 5,
    responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 5,
        infinite: true,
        dots: true
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1
      }
    }
  ]
});


wow = new WOW({
    animateClass: 'animated',
    offset: 100,
    mobile: false
});
wow.init();
$(window).on('scroll', function () {
    if ($(this).scrollTop() > 100) {
        $('#web-pulse-scroll-up').fadeIn();
    } else {
        $('#web-pulse-scroll-up').fadeOut();
    }
});
$('#web-pulse-scroll-up').on('click', function () {
    $("html, body").animate({
        scrollTop: 0
    }, 600);
    return false;
});


$(".product_slide").slick({
    dots: false,
    infinite: true,
    autoplay: false,
    arrows: true,
    slidesToShow: 1,
    slidesToScroll: 1
});

$(".feature_blog").slick({
    dots: true,
    infinite: true,
    autoplay: true,
    arrows: false,
    slidesToShow: 1,
    slidesToScroll: 1
});
function ValidateAlpha(evt) {
    var keyCode = (evt.which) ? evt.which : evt.keyCode
    if ((keyCode < 65 || keyCode > 90) && (keyCode < 97 || keyCode > 123) && keyCode != 32)
        return false;
    return true;
}
function isNumberKey(evt) {
    //var e = evt || window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode != 46 && charCode > 31 &&
        (charCode < 48 || charCode > 57))
        return false;
    return true;
}
function validateOnlyTextField(element) {
    var str = element.value;
    if (str == ' ') {
        element.value = "";
    }
    if (!(/^[a-zA-Z\s]+$/.test(str))) {
        // console.log('String contain number characters');
        str = str.substr(0, str.length - 1);
        element.value = "";
    }
}


