function mk_tab_slider() {

    $('.mk-tab-slider').each(function(i, val) {
        var $wrapper  = $(this),
            $pagination     = null, // created later, but we catch it
            $slides         = null,
            $contents       = null,
            pause           = $wrapper.data('pause'),
            speed           = $wrapper.data('speed'),
            sliderH         = $wrapper.data('height'),
            fullHeight      = $wrapper.data('fullheight'),
            pagination      = $wrapper.data('pagination'),
            paginationClass = (pagination) ? '#' + $wrapper.attr('id') + ' .swiper-pagination' : false;

        // remove viewport animations from slider
        $wrapper.find('.mk-animate-element')
                      .removeClass('mk-animate-element fade-in scale-up right-to-left left-to-right bottom-to-top top-to-bottom forthy-five-rotate');

        function sliderHeight() {
            var height = sliderH;

            // Check viewport Height if full height option is enabled
            if(fullHeight) {
                var winH =  global_window_height - global_admin_bar_height,
                    $header = $('#mk-header'),
                    hasHeader = ($header.length && !$header.hasClass('header-structure-vertical'));

                height = (hasHeader) ? winH - $header.data('sticky-height') : winH;
            }

            // Check highest content
            $contents.each(function() {
                var $content = $(this),
                    contentH = $content.find('.mk-grid').outerHeight();
                    
                height = Math.max(height, contentH);
            });

            // assignment logic here in separate loop 
            // (we need to finish first one to get all values).
            $contents.each(function() {
                var $content = $(this),
                    isRight  = $content.hasClass('mk-half-layout-right');

                if(!isRight && matchMedia('(max-width:960px)').matches) $content.height(500);
                else $content.height(height);
            });
        }

        var mkSwiper = $wrapper.swiper({
            mode                            : 'horizontal',
            loop                            : true,
            grabCursor                      : false,
            useCSS3Transforms               : true,
            mousewheelControl               : false,
            pagination                      : paginationClass, 
            paginationClickable             : true,
            freeModeFluid                   : true,
            calculateHeight                 : true, 
            speed                           : speed,
            autoplay                        : pause,
            simulateTouch                   : false,
            autoplayDisableOnInteraction    : false,

            onSwiperCreated: function(swiper) {
                var currentSkin = $wrapper.find('.swiper-slide').eq(1).attr("data-skin");
                $wrapper.find('.edge-slider-loading').fadeOut();

                // cache after duplicates are generated
                $slides = $wrapper.find('.swiper-slide');
                $contents = $slides.find('.mk-half-layout');
                sliderHeight();

                // Quit if pagination is disabled or create it and assign events
                if(!pagination) return;
                $pagination = $(paginationClass); // create and assign to var available in higher scope to cross cut access
                $pagination.find('span').append('<a href="#"></a>');
                $pagination.attr('data-skin', currentSkin);
                $pagination.on('click', 'span', function(e){
                  e.preventDefault();
                  mkSwiper.swipeTo($(this).index(), 500);
                });
            },

            onSlideChangeEnd: function() {
                var currentSlide = $(mkSwiper.activeSlide()),
                    currentSkin = currentSlide.attr("data-skin");

                if(pagination) $pagination.attr('data-skin', currentSkin);
            }
        });

        $(window).on('resize', function() {
            setTimeout(function() {
                sliderHeight();
                mkSwiper.reInit();
            }, 200);
        });

    });
}