(function ($) {
    'use strict';
    $(window).on('load', function () {
        $('.loading').fadeOut();
    });
    if($('.scroll-top').length){
		$(".scroll-to-target").on('click', function() {
			var target = $(this).attr('data-target');
		   // animate
		   $('html, body').animate({
			   scrollTop: $(target).offset().top
			 }, 1000);
	
        });
    }
    function onScrollFun() {
        if($('.scroll-top').length){
            var windowpos = $(window).scrollTop();
            var scrollLink = $('.scroll-top');
            if (windowpos >= 110) {
                scrollLink.addClass('open');
            } else {
                scrollLink.removeClass('open');
            }
        }
    }
    
 
    $(window).on('scroll', function() {
		onScrollFun();
	});
    

})(jQuery);