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

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

function mobiletNavToggler() {
    if ($('.web-pulse-navigation-wps').length) {
        $('.web-pulse-navigation-wps .navbar button').on('click', function () {
            $('.web-pulse-navigation-wps .web-p-u-l-s-e-menu').slideToggle();
            return false;
        });



        $('.web-pulse-navigation-wps .cs-submenu').children('a').append(function () {
            return '<button class="dropdown-expander"><i class="fa fa-chevron-down"></i></button>';
        });
        $('.web-pulse-navigation-wps .web-p-u-l-s-e-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('.web-pulse-navigation-wps .navbar button').length) {
            $('.web-p-u-l-s-e-menu').stop(true).slideUp();
        }
    });
}

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

var sliderInit = $('.slick-slider-init');
$(document).ready(function () {
    sliderInit.slick({
        autoplay: true,
        autoplaySpeed: 2700,
        infinite: true
    });

    sliderInit.slickAnimation();
});

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


$(".results").slick({
    dots: true,
    infinite: true,
    autoplay: true,
    slidesToShow: 4,
    slidesToScroll: 1,
    responsive: [{
        breakpoint: 1024,
        settings: {
            slidesToShow: 4,
            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: true,
    autoplay: true,
    slidesToShow: 4,
    slidesToScroll: 1,
    responsive: [
        {
            breakpoint: 1024,
            settings: {
                slidesToShow: 4,
                slidesToScroll: 4,
                infinite: true,
                dots: true
            }
    },
        {
            breakpoint: 600,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
    },
        {
            breakpoint: 480,
            settings: {
                slidesToShow: 1,
                slidesToScroll: 1
            }
    }
  ]
});


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


$(".web-pulse-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;
});
/*
jQuery(document).ready(function ($) {
  $("#quick_form").validate({
    rules: {
      name: "required",
      message: "required",
      location: "required",
      email: {
        required: true,
        email: true
      },
      mobile: {
        required: true,
        number: true,
        minlength: 10,
      }
    },
    messages: {
      name: "Please enter your name",
      message: "Please enter message",
      email: {
        required: "Please enter your email address"
      },
      location: "Please enter your location",
      mobile: {
        required: "Please enter your mobile no.",
        number: "Mobile No. contains only numbers",
        minlength: "Your Mobile No. must be at least 10 characters long",
      }
    },
  })
});
jQuery(document).ready(function ($) {
  $("#quick_enquiry").validate({
    rules: {
      name: "required",
      message: "required",
      location: "required",
      email: {
        required: true,
        email: true
      },
      mobile: {
        required: true,
        number: true,
        minlength: 10,
      }
    },
    messages: {
      name: "Please enter your name",
      message: "Please enter message",
      email: {
        required: "Please enter your email address"
      },
      location: "Please enter your location",
      mobile: {
        required: "Please enter your mobile no.",
        number: "Mobile No. contains only numbers",
        minlength: "Your Mobile No. must be at least 10 characters long",
      }
    },
  })
});
*/
$(".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
});
