if (!$('#pagearea').length) {
    var reposTimer;
    var checkWinWidth = 0;

    /*

        if ($('.item-info-wrap .description').length) {
            $('.item-info-wrap .description li').each(function(idx, elem) {
                $(this).addClass('ani-list');
            });
        }
    */

    $(window).on('resize', function() {
        if (($('.about-service').length) && (checkWinWidth !== $(window).width())) {
            $('.about-service').find('.popover').each(function(idx, elem) {
                $(elem).css('margin-left', '');
                $(elem).find('.arrow').css('margin-left', '');
            });
            clearTimeout(reposTimer);
            reposTimer = setTimeout(function() {
                reposPopover();

            }, 250);

            checkWinWidth = $(window).width();
        }


        if ($('.quality-sect').length) {
            clearTimeout(reposTimer);
            reposTimer = setTimeout(function() {
            if ($.inArray(currScrSize, ['xl', 'lg', 'md']) >= 0) {
                if ($('.quality-sect .list-wrap').children('.row').length > 7) {
                    $('.quality-slick').find('.items-block').css('height', $('.quality-sect .list-wrap').height() + 'px');
                    $('.quality-sect .list-wrap').children('.row').css('line-height', 'normal');

                } else if ($('.quality-sect .list-wrap').children('.row').length < 5) {
                    $('.quality-slick').find('.items-block').css('height', 'auto');
                    $('.quality-sect .list-wrap').children('.row').css('line-height', 'normal');
                } else {
                    $('.quality-slick').find('.items-block').css('height', 'auto');
              
                        $('.quality-sect .list-wrap').children('.row').css('line-height', ($('.quality-slick').height() / $('.quality-sect .list-wrap').children('.row').length) - 19 + 'px');
               

                }
            } else {
                $('.quality-slick').find('.items-block').css('height', 'auto');
                $('.quality-sect .list-wrap').children('.row').css('line-height', 'normal');
            }

            }, 250);

        }

    });



    $("figure.empty-hidden").each(function(idx, elem) {
        if ($(elem).text() == ' ') {
            $(elem).hide();
        }
    });





}

function reposPopover() {

    $('.about-service').find('.popover').each(function(idx, elem) {
        setTimeout(function() {
            var elemLeft = $(elem)[0].getBoundingClientRect().left;
            var elemRight = $(elem)[0].getBoundingClientRect().right;
            console.log(elemLeft);
            if (elemLeft < 0) {
                $(elem).css('margin-left', elemLeft * -1 + 'px');
                $(elem).find('.arrow').css('margin-left', elemLeft + 'px');
            } else if (elemRight > $(window).width()) {
                $(elem).css('margin-left', (elemRight - $(window).width()) * -1 + 'px');
                $(elem).find('.arrow').css('margin-left', (elemRight - $(window).width()) + 'px');
            }
        }, 100);

    });

}