<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
//
// Title: jpFaq.js
// Author: Jacco van der Post - www.id-webdesign.nl
// Date: feb 2018
//

var jpFaq = jpFaq || {};

(function ($) {

    var txJpfaq = '.tx-jpfaq';
    var jpFaqToggleTrigger = 'ul.jpfaqList .toggleTrigger';
    var jpFaqListItem = 'ul.jpfaqList li';
    var jpfaqShow = '.jpfaqShowAll';
    var jpfaqHide = '.jpfaqHideAll';
    var jpFaqToggleTriggerContainer = '.toggleTriggerContainer';
    var thisPlugin = '';
    var jpFaqSearch = '#jpfaqSearch';
    var jpFaqSearchForm = '#jpfaqSearch input';
    var jpFaqFilterCount = '#jpfaq-filter-count';
    var jpfaqQuestionCommentContainer = '.jpfaqQuestionCommentContainer';
    var jpfaqAddCommentForm = '.jpfaqAddCommentForm';
    var jpfaqQuestionHelpfulText = '.jpfaqQuestionHelpfulText';
    var jpfaqQuestionNotHelpful = '.jpfaqQuestionNotHelpful';
    var jpfaqQuestionHelpful = '.jpfaqQuestionHelpful';
    var jpfaqCommentFormClose = '.jpfaqCommentFormClose';
    var jpfaqQuestionCommentForm = '#jpfaqQuestionCommentForm';
    var jpfaqEmailField = '.jpfaqEmailField';
    var jpfaqRequiredField = '.jpfaqRequired';
    var jpfaqCommentFieldWarning = 'jpfaqCommentFieldWarning';
    var jpfaqSubmitComment = '.jpfaqSubmitComment';
    var jpfaqCommentPageType = '&amp;type=88188';
    var jpfaqSpinner = '.jpfaqSpinner';
    var jpfaqSpinnerHtml = '&lt;div class="jpfaqSpinner"&gt;&lt;/div&gt;';
    var jpfaqCatCommentContainerLink = '.jpfaqCatCommentContainerLink';
    var jpfaqCatCommentContainerIntro = '.jpfaqCatCommentContainerIntro';
    var jpfaqCatCommentContainer = '.jpfaqCatCommentContainer';
    var jpfaqCatCommentFormClose = '.jpfaqCatCommentFormClose';
    var jpfaqSubmitCatComment = '.jpfaqSubmitCatComment';
    var jpfaqCatCommentForm = '#jpfaqCatCommentForm';

    /**
     * Plugins
     *
     * @type object
     */
    jpFaq.Main = {

        /**
         * Initialize plugins
         *
         * @return void
         */
        initialize: function () {
            jpFaq.Main.openClose();
            jpFaq.Main.search();
            jpFaq.Main.preventSubmit();

            jpFaq.Main.questionIsHelpful();
            jpFaq.Main.questionIsNotHelpful();
            jpFaq.Main.closeQuestionCommentForm();
            jpFaq.Main.addQuestionComment();
            jpFaq.Main.closeThanks4QuestionComment();

            jpFaq.Main.addCategoryCommentForm();
            jpFaq.Main.closeCategoryCommentForm();
            jpFaq.Main.addCategoryComment();
            jpFaq.Main.closeThanks4CategoryComment();

            // For testing
            //$(jpfaqShow).click();
        },

        /**
         * Open and close questions with js
         *
         * @return void
         */
        openClose: function () {
            $(jpFaqToggleTrigger).click(function () {
                thisPlugin = $(this).closest(txJpfaq);
                $(this).next().toggleClass('active').slideToggle('fast');
                $(this).toggleClass('questionUnfolded');
                if ($(thisPlugin).find(jpFaqListItem).children(':first-child').length == $(thisPlugin).find(jpFaqListItem).children(':first-child.questionUnfolded').length) {
                    $(thisPlugin).find(jpfaqShow).hide();
                    $(thisPlugin).find(jpfaqHide).show();
                } else {
                    $(thisPlugin).find(jpfaqHide).hide();
                    $(thisPlugin).find(jpfaqShow).show();
                }
            });
            $(jpfaqShow).click(function () {
                thisPlugin = $(this).closest(txJpfaq);
                $(thisPlugin).find(jpFaqToggleTriggerContainer).removeClass('active');
                $(thisPlugin).find(jpFaqToggleTriggerContainer).addClass('active').slideDown('fast');
                $(thisPlugin).find(jpFaqToggleTrigger).removeClass('questionUnfolded');
                $(thisPlugin).find(jpFaqToggleTrigger).addClass('questionUnfolded');
                $(thisPlugin).find(jpfaqShow).hide();
                $(thisPlugin).find(jpfaqHide).show();
            });
            $(jpfaqHide).click(function () {
                thisPlugin = $(this).closest(txJpfaq);
                $(thisPlugin).find(jpFaqToggleTriggerContainer).removeClass('active').slideUp('fast');
                $(thisPlugin).find(jpFaqToggleTrigger).removeClass('questionUnfolded');
                $(thisPlugin).find(jpfaqHide).hide();
                $(thisPlugin).find(jpfaqShow).show();
            });
        },

        /**
         * Quick search faq's
         *
         * @return void
         */
        search: function () {
            $(jpFaqSearchForm).keyup(function () {
                var searchFilter = $(this).val(), count = 0;

                if (searchFilter.length &gt; 0) {
                    $(jpFaqFilterCount).show();
                } else {
                    $(jpFaqFilterCount).hide();
                }

                $(txJpfaq + ' .jpfaqList &gt; li').each(function () {
                    if ($(this).text().search(new RegExp(searchFilter, 'i')) &lt; 0) {
                        $(this).fadeOut('fast');
                    } else {
                        $(this).show();
                        count++;
                    }
                });

                $(jpFaqFilterCount + ' span').text(count);
            })
        },

        /**
         * Prevent reload page on submit search
         *
         * @return void
         */
        preventSubmit: function () {
            $(jpFaqSearch).submit(function (e) {
                e.preventDefault();
            });
        },

        /**
         * A question is found helpful
         *
         * Update 'helpful' in database
         * Send to Google event tracking
         *
         * Action: helpfulness
         *
         * @return void
         */
        questionIsHelpful: function () {
            $(jpfaqQuestionHelpful).click(function (event) {
                event.preventDefault();
                $(this).closest(jpfaqQuestionHelpfulText).hide();

                var loadUri = $(this).attr('href') + jpfaqCommentPageType;
                var contentContainer = $(this).closest(jpfaqQuestionCommentContainer);
                jpFaq.Main.ajaxPost(loadUri, contentContainer);

                var gtagData = $(this).data();
                if (gtagData['gtagevent']) {
                    jpFaq.Main.sendGtag(gtagData);
                }
            });
        },

        /**
         * A question is not found helpful
         *
         * Via Ajax, load comment form and update property 'nothelpful' in database
         * Send to Google event tracking
         *
         * Action: helpfulness
         *
         * @return void
         */
        questionIsNotHelpful: function () {
            $(jpfaqQuestionNotHelpful).click(function (event) {
                event.preventDefault();
                $(this).closest(jpfaqQuestionHelpfulText).hide();

                var loadUri = $(this).attr('href') + jpfaqCommentPageType;
                var contentContainer = $(this).closest(jpfaqQuestionCommentContainer).find(jpfaqAddCommentForm);

                jpFaq.Main.ajaxPost(loadUri, contentContainer);

                var gtagData = $(this).data();
                if (gtagData['gtagevent']) {
                    jpFaq.Main.sendGtag(gtagData);
                }
            })
        },

        /**
         * Send gtag to Google analytics events
         * Must be enabled in typoscript settings and gtag.js global tracking snippet must be present
         *
         * @param {array} gtagData
         *
         * @return void
         */
        sendGtag: function (gtagData) {
            gtag('event', gtagData['gtagevent'], {
                'event_category': gtagData['gtagcategory'],
                'event_label': gtagData['gtaglabel'],
                'value': gtagData['gtagvalue']
            });
        },

        /**
         * Close question comment form when clicked on close
         *
         * @return void
         */
        closeQuestionCommentForm: function () {
            $(txJpfaq).on('click', jpfaqCommentFormClose, function () {
                $(this).closest(jpfaqQuestionCommentContainer).find(jpfaqQuestionHelpfulText).show();

                var formContainer = $(this).closest(jpfaqQuestionCommentContainer).find(jpfaqAddCommentForm);
                formContainer.slideUp('fast', function () {
                    formContainer.empty();
                });
            })
        },

        /**
         * Add question comment after submit
         * validate, then send it to postComment
         *
         * @return void
         */
        addQuestionComment: function () {
            $(txJpfaq).on('click', jpfaqSubmitComment, function (event) {
                event.preventDefault();

                var submitButtonId = this.id;
                var questionNumber = submitButtonId.replace('jpfaqSubmitComment', '');
                // Get the correct plugin when multiple plugins with same questions on a page
                var pluginUid = $(this).closest(txJpfaq).attr('id');
                var commentContainer = '#' + pluginUid + ' ' + jpfaqQuestionCommentContainer + questionNumber;
                var form = $(jpfaqQuestionCommentForm + questionNumber);
                var formValidated = jpFaq.Main.validateForm(form);

                if (formValidated) {
                   jpFaq.Main.postComment(event, commentContainer, form);
                }
            });
        },

        /**
         * Close thank you message after posting a question comment
         *
         * @return void
         */
        closeThanks4QuestionComment: function () {
            $(jpfaqQuestionCommentContainer).on('click', '.jpfaqCommentClose', function () {
                $(this).closest('.jpfaqThanks').slideUp('fast', function () {
                    $(this).remove();
                });
            });
        },

        /**
         * Add Category comment form after click link
         *
         * @return void
         */
        addCategoryCommentForm: function () {
            $(jpfaqCatCommentContainerLink).click(function (event) {
                event.preventDefault();
                $(this).closest(jpfaqCatCommentContainerIntro).hide();

                var loadUri = $(this).attr('href') + jpfaqCommentPageType;
                var contentContainer = $(this).closest(jpfaqCatCommentContainer).find(jpfaqAddCommentForm);
                jpFaq.Main.ajaxPost(loadUri, contentContainer);
            })
        },

        /**
         * Close category comment form when clicked on close
         *
         * @return void
         */
        closeCategoryCommentForm: function () {
            $(txJpfaq).on('click', jpfaqCatCommentFormClose, function () {
                $(this).closest(jpfaqCatCommentContainer).find(jpfaqCatCommentContainerIntro).show();

                var formContainer = $(this).closest(jpfaqCatCommentContainer).find(jpfaqAddCommentForm);
                formContainer.slideUp('fast', function () {
                    formContainer.empty();
                });
            })
        },

        /**
         * Add category comment after submit
         * validate, then send it to postComment
         *
         * @return void
         */
        addCategoryComment: function () {
            $(txJpfaq).on('click', jpfaqSubmitCatComment, function (event) {
                event.preventDefault();

                var submitButtonId = this.id;
                var questionNumber = submitButtonId.replace('jpfaqSubmitCatComment', '');
                // Get the correct plugin when multiple plugins with same questions on a page
                var pluginId = $(this).closest(txJpfaq).attr('id');
                var commentContainer = '#' + pluginId + ' ' + jpfaqCatCommentContainer + questionNumber;
                var pluginUid = pluginId.replace('tx-jpfaq','');
                var form = $(jpfaqCatCommentForm + pluginUid);
                var formValidated = jpFaq.Main.validateForm(form);

                if (formValidated) {
                    jpFaq.Main.postComment(event, commentContainer, form);
                }
            });
        },

        /**
         * Close thank you message after posting a category comment
         *
         * @return void
         */
        closeThanks4CategoryComment: function () {
            $(jpfaqCatCommentContainer).on('click', '.jpfaqCommentClose', function () {
                $(this).closest('.jpfaqThanks').slideUp('fast', function () {
                    $(this).remove();
                });
            });
        },

        /**
         * Validate form on requiredfields and valid email
         *
         *
         * @param {object} form
         * @return {boolean}
         */
        validateForm: function (form) {
            var noFieldErrors = true;

            // Validate form required fields filled, add warning class
            $(form).find(jpfaqRequiredField).each(function () {
                if ($(this).val() === '') {
                    $(this).addClass(jpfaqCommentFieldWarning);
                    noFieldErrors = false;
                }
            });

            // Validate email if filled in, else add warning class
            $(form).find(jpfaqEmailField).each(function () {
                var email = $(this).val();
                if (email) {
                    if (!jpFaq.Main.validateEmail(email)) {
                        $(this).addClass(jpfaqCommentFieldWarning);
                        noFieldErrors = false;
                    }
                }
            });

            // Remove warning class (e.g. red border) on fields with errors
            $('.' + jpfaqCommentFieldWarning).focus(function () {
                $(this).removeClass(jpfaqCommentFieldWarning);
            });

            return noFieldErrors;
        },

        /**
         * Ajax POST
         * Used for helpful / not helpful
         *
         * @param {string} loadUri
         * @param {string} contentContainer
         *
         * @return void
         */
        ajaxPost: function (loadUri, contentContainer) {
            $.ajax({
                type: 'POST',
                url: loadUri,
                data: {},

                success: function (response) {
                    $(contentContainer).append(response);
                    contentContainer.slideDown('fast');
                },

                error: function (xhr, thrownError) {
                    $(contentContainer).append('fail');
                    //console.log(xhr.status + ' ' + xhr.responseText + ' ' + thrownError);
                }
            });
        },

        /**
         * Post comment with Ajax
         * show thank you text with the comment content
         *
         * Action: addComment
         *
         * @param {object} event
         * @param {string} commentContainer
         * @param {string} form
         *
         * @return void
         */
        postComment: function (event, commentContainer, form) {
            var loadUri = $(form).attr('action') + jpfaqCommentPageType;
            $(commentContainer + ' ' + jpfaqAddCommentForm).fadeOut();
            $(commentContainer).append(jpfaqSpinnerHtml);

            $.ajax({
                type: 'POST',
                url: loadUri,
                data: form.serialize(),

                success: function (response) {
                    $(commentContainer + ' ' + jpfaqAddCommentForm).empty();
                    $(jpfaqSpinner).remove();

                    $(commentContainer).append(response);
                },

                error: function (xhr, thrownError) {
                    $(jpfaqSpinner).remove();
                    $(commentContainer + ' ' + jpfaqAddCommentForm).fadeIn('fast');
                    //console.log(xhr.status + ' ' + xhr.responseText + ' ' + thrownError);
                }
            });
        },

        /**
         * Regex email validation
         *
         * @param email
         *
         * @return boolean
         */
        validateEmail: function (email) {
            var expr = /^((([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
            return expr.test(email);
        }
    }
})(jQuery);

/**
 * On ready event
 */
jQuery(document).ready(function () {
    jpFaq.Main.initialize();
});
/**
 *  Ajax Autocomplete for jQuery, version 1.4.11
 *  (c) 2017 Tomas Kirda
 *
 *  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
 *  For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
 */
!function(t){"use strict";"function"==typeof define&amp;&amp;define.amd?define(["jquery"],t):"object"==typeof exports&amp;&amp;"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&amp;")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e}},s=27,i=9,n=13,o=38,a=39,u=40,l=t.noop;function r(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.noSuggestionsContainer=null,this.options=t.extend(!0,{},r.defaults,s),this.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},this.hint=null,this.hintValue="",this.selection=null,this.initialize(),this.setOptions(s)}r.utils=e,t.Autocomplete=r,r.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,onHint:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(t,s){if(!s)return t.value;var i="("+e.escapeRegExChars(s)+")";return t.value.replace(new RegExp(i,"gi"),"&lt;strong&gt;$1&lt;/strong&gt;").replace(/&amp;/g,"&amp;amp;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/"/g,"&amp;quot;").replace(/&amp;lt;(\/?strong)&amp;gt;/g,"&lt;$1&gt;")},formatGroup:function(t,e){return'&lt;div class="autocomplete-group"&gt;'+e+"&lt;/div&gt;"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:l,onSearchComplete:l,onSearchError:l,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(e){return"string"==typeof e?t.parseJSON(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},r.prototype={initialize:function(){var e,s=this,i="."+s.classes.suggestion,n=s.classes.selected,o=s.options;s.element.setAttribute("autocomplete","off"),s.noSuggestionsContainer=t('&lt;div class="autocomplete-no-suggestion"&gt;&lt;/div&gt;').html(this.options.noSuggestionNotice).get(0),s.suggestionsContainer=r.utils.createNode(o.containerClass),(e=t(s.suggestionsContainer)).appendTo(o.appendTo||"body"),"auto"!==o.width&amp;&amp;e.css("width",o.width),e.on("mouseover.autocomplete",i,function(){s.activate(t(this).data("index"))}),e.on("mouseout.autocomplete",function(){s.selectedIndex=-1,e.children("."+n).removeClass(n)}),e.on("click.autocomplete",i,function(){s.select(t(this).data("index"))}),e.on("click.autocomplete",function(){clearTimeout(s.blurTimeoutId)}),s.fixPositionCapture=function(){s.visible&amp;&amp;s.fixPosition()},t(window).on("resize.autocomplete",s.fixPositionCapture),s.el.on("keydown.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},onFocus:function(){this.disabled||(this.fixPosition(),this.el.val().length&gt;=this.options.minChars&amp;&amp;this.onValueChange())},onBlur:function(){var e=this,s=e.options,i=e.el.val(),n=e.getQuery(i);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&amp;&amp;e.currentValue!==n&amp;&amp;(s.onInvalidateSelection||t.noop).call(e.element)},200)},abortAjax:function(){this.currentRequest&amp;&amp;(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=t.extend({},this.options,e);this.isLocal=Array.isArray(s.lookup),this.isLocal&amp;&amp;(s.lookup=this.verifySuggestionsFormat(s.lookup)),s.orientation=this.validateOrientation(s.orientation,"bottom"),t(this.suggestionsContainer).css({"max-height":s.maxHeight+"px",width:s.width+"px","z-index":s.zIndex}),this.options=s},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e=t(this.suggestionsContainer),s=e.parent().get(0);if(s===document.body||this.options.forceFixPosition){var i=this.options.orientation,n=e.outerHeight(),o=this.el.outerHeight(),a=this.el.offset(),u={top:a.top,left:a.left};if("auto"===i){var l=t(window).height(),r=t(window).scrollTop(),h=-r+a.top-n,c=r+l-(a.top+o+n);i=Math.max(h,c)===h?"top":"bottom"}if(u.top+="top"===i?-n:o,s!==document.body){var g,d=e.css("opacity");this.visible||e.css("opacity",0).show(),g=e.offsetParent().offset(),u.top-=g.top,u.top+=s.scrollTop,u.left-=g.left,this.visible||e.css("opacity",d).hide()}"auto"===this.options.width&amp;&amp;(u.width=this.el.outerWidth()+"px"),e.css(u)}},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==u||!this.currentValue){if(!this.disabled&amp;&amp;this.visible){switch(t.which){case s:this.el.val(this.currentValue),this.hide();break;case a:if(this.hint&amp;&amp;this.options.onHint&amp;&amp;this.isCursorAtEnd()){this.selectHint();break}return;case i:if(this.hint&amp;&amp;this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case n:if(-1===this.selectedIndex)return void this.hide();this.select(this.selectedIndex);break;case o:this.moveUp();break;case u:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case o:case u:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&amp;&amp;(e.findBestHint(),e.options.deferRequestBy&gt;0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&amp;&amp;this.currentValue!==i&amp;&amp;(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&amp;&amp;this.isExactMatch(i)?this.select(0):i.length&lt;e.minChars?this.hide():this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&amp;&amp;e[0].value.toLowerCase()===t.toLowerCase()},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e},getSuggestionsLocal:function(e){var s,i=this.options,n=e.toLowerCase(),o=i.lookupFilter,a=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return o(t,e,n)})},a&amp;&amp;s.suggestions.length&gt;a&amp;&amp;(s.suggestions=s.suggestions.slice(0,a)),s},getSuggestions:function(e){var s,i,n,o,a=this,u=a.options,l=u.serviceUrl;u.params[u.paramName]=e,!1!==u.onSearchStart.call(a.element,u.params)&amp;&amp;(i=u.ignoreParams?null:u.params,t.isFunction(u.lookup)?u.lookup(e,function(t){a.suggestions=t.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,t.suggestions)}):(a.isLocal?s=a.getSuggestionsLocal(e):(t.isFunction(l)&amp;&amp;(l=l.call(a.element,e)),n=l+"?"+t.param(i||{}),s=a.cachedResponse[n]),s&amp;&amp;Array.isArray(s.suggestions)?(a.suggestions=s.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,s.suggestions)):a.isBadQuery(e)?u.onSearchComplete.call(a.element,e,[]):(a.abortAjax(),o={url:l,data:i,type:u.type,dataType:u.dataType},t.extend(o,u.ajaxSettings),a.currentRequest=t.ajax(o).done(function(t){var s;a.currentRequest=null,s=u.transformResult(t,e),a.processResponse(s,e,n),u.onSearchComplete.call(a.element,e,s.suggestions)}).fail(function(t,s,i){u.onSearchError.call(a.element,e,t,s,i)}))))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(){var e=t(this.suggestionsContainer);t.isFunction(this.options.onHide)&amp;&amp;this.visible&amp;&amp;this.options.onHide.call(this.element,e),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),t(this.suggestionsContainer).hide(),this.onHint(null)},suggest:function(){if(this.suggestions.length){var e,s=this.options,i=s.groupBy,n=s.formatResult,o=this.getQuery(this.currentValue),a=this.classes.suggestion,u=this.classes.selected,l=t(this.suggestionsContainer),r=t(this.noSuggestionsContainer),h=s.beforeRender,c="";s.triggerSelectOnValidInput&amp;&amp;this.isExactMatch(o)?this.select(0):(t.each(this.suggestions,function(t,u){i&amp;&amp;(c+=function(t,n){var o=t.data[i];return e===o?"":(e=o,s.formatGroup(t,e))}(u,0)),c+='&lt;div class="'+a+'" data-index="'+t+'"&gt;'+n(u,o,t)+"&lt;/div&gt;"}),this.adjustContainerWidth(),r.detach(),l.html(c),t.isFunction(h)&amp;&amp;h.call(this.element,l,this.suggestions),this.fixPosition(),l.show(),s.autoSelectFirst&amp;&amp;(this.selectedIndex=0,l.scrollTop(0),l.children("."+a).first().addClass(u)),this.visible=!0,this.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var e=this.options.beforeRender,s=t(this.suggestionsContainer),i=t(this.noSuggestionsContainer);this.adjustContainerWidth(),i.detach(),s.empty(),s.append(i),t.isFunction(e)&amp;&amp;e.call(this.element,s,this.suggestions),this.fixPosition(),s.show(),this.visible=!0},adjustContainerWidth:function(){var e,s=this.options,i=t(this.suggestionsContainer);"auto"===s.width?(e=this.el.outerWidth(),i.css("width",e&gt;0?e:300)):"flex"===s.width&amp;&amp;i.css("width","")},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&amp;&amp;(t.each(this.suggestions,function(t,i){var n=0===i.value.toLowerCase().indexOf(e);return n&amp;&amp;(s=i),!n}),this.onHint(s))},onHint:function(e){var s=this.options.onHint,i="";e&amp;&amp;(i=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==i&amp;&amp;(this.hintValue=i,this.hint=e,t.isFunction(s)&amp;&amp;s.call(this.element,i))},verifySuggestionsFormat:function(e){return e.length&amp;&amp;"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&amp;&amp;(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&amp;&amp;!t.suggestions.length&amp;&amp;this.badQueries.push(e)),e===this.getQuery(this.currentValue)&amp;&amp;(this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,n=t(this.suggestionsContainer),o=n.find("."+this.classes.suggestion);return n.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&amp;&amp;o.length&gt;this.selectedIndex?(s=o.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.hide(),this.onSelect(t)},moveUp:function(){if(-1!==this.selectedIndex)return 0===this.selectedIndex?(t(this.suggestionsContainer).children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint()):void this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&amp;&amp;this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s=this.activate(e);if(s){var i,n,o,a=t(s).outerHeight();i=s.offsetTop,o=(n=t(this.suggestionsContainer).scrollTop())+this.options.maxHeight-a,i&lt;n?t(this.suggestionsContainer).scrollTop(i):i&gt;o&amp;&amp;t(this.suggestionsContainer).scrollTop(i-this.options.maxHeight+a),this.options.preserveInput||(this.ignoreValueChange=!0,this.el.val(this.getValue(this.suggestions[e].value))),this.onHint(null)}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue),this.onHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&amp;&amp;s.call(this.element,i)},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),t(this.suggestionsContainer).remove()}},t.fn.devbridgeAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),n=i.data("autocomplete");"string"==typeof e?n&amp;&amp;"function"==typeof n[e]&amp;&amp;n[e](s):(n&amp;&amp;n.dispose&amp;&amp;n.dispose(),n=new r(this,e),i.data("autocomplete",n))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.devbridgeAutocomplete)});

function SuggestController() {

    this.init = function () {

        jQuery('form[data-suggest]').each(function () {
            var $form = $(this), $searchBox = $form.find('.tx-solr-suggest'), $formAutoComplete;

            if ($form.find('.tx-solr-autocomplete').length &gt; 0){
                $formAutoComplete = $form.find('.tx-solr-autocomplete');
            } else {
                $formAutoComplete = $('body');
            }

            $form.find('.tx-solr-suggest-focus').focus();

            // when no specific container found, use the form as container
            if ($searchBox.length === 0) {
                $searchBox = $form;
            }
            $searchBox.css('position', 'relative');

            // Prevent submit of empty search form
            $form.on('submit', function (e) {
                if ($form.find('.tx-solr-suggest').val() === '') {
                    e.preventDefault();
                    $form.find('.tx-solr-suggest').focus();
                }
            });

            $form.find('.tx-solr-suggest').devbridgeAutocomplete({
                serviceUrl: $form.data('suggest'),
                dataType: 'jsonp',
                ajaxSettings: {
                    jsonp: "tx_solr[callback]"
                },
                paramName: 'tx_solr[queryString]',
                groupBy: 'category',
                maxHeight: 1000,
                appendTo: $formAutoComplete,
                autoSelectFirst: false,
                triggerSelectOnValidInput: false,
                width: $searchBox.outerWidth() * 0.66,
                onSelect: function (suggestion) {
                    // go to link when selecting found result
                    if (suggestion.data.link) {
                        // Open youtube in overlay
                        if (suggestion.data.link.indexOf('https://www.youtube.com') === 0) {
                            openVideoOverlay(suggestion.data.link);
                        } else {
                            location.href = suggestion.data.link;
                        }
                        // else trigger form submit (do search)
                    } else {
                        $form.trigger('submit');
                    }
                },
                transformResult: function (response) {
                    if (!response.suggestions) return {suggestions: []};
                    var firstSuggestion, result = {
                        suggestions: $.map(response.suggestions, function (count, suggestion) {
                            if (!firstSuggestion) firstSuggestion = suggestion;
                            return {value: suggestion, data: {category: 'suggestion', count: count}};
                        })
                    };

                    $.each(response.documents, function (key, value) {
                        var dataObject = value;

                        var defaultGroup = $form.data('suggest-header') ? $form.data('suggest-header') : 'Top results';
                        dataObject.category = defaultGroup;

                        // if a group is set we try to get a label
                        if(dataObject.group) {
                            dataObject.category = $form.data('suggest-header-' + dataObject.group) ? $form.data('suggest-header-' + dataObject.group) : dataObject.group;
                        }

                        result.suggestions.push(
                            {
                                value: firstSuggestion,
                                data: dataObject
                            }
                        );
                    });

                    return result;
                },
                beforeRender: function (container) {
                    // remove first group header
                    container.find('.autocomplete-group:first').remove();
                    container.addClass('tx-solr-autosuggest');

                    // add active class to container
                    $searchBox.parent().addClass('autocomplete-active').fadeIn();
                },
                formatResult: function (suggestion, currentValue) {
                    // Do not replace anything if there current value is empty
                    if (!currentValue) {
                        return suggestion.value;
                    }
                    var pattern = '(' + $.Autocomplete.utils.escapeRegExChars(currentValue.trim()) + ')';
                    // normal suggestion
                    if (suggestion.data.category === 'suggestion') {
                        return suggestion.value
                            .replace(new RegExp(pattern, 'gi'), '&lt;strong&gt;$1&lt;\/strong&gt;')
                            .replace(/&amp;/g, '&amp;amp;')
                            .replace(/&lt;/g, '&amp;lt;')
                            .replace(/&gt;/g, '&amp;gt;')
                            .replace(/"/g, '&amp;quot;')
                            .replace(/&amp;lt;(\/?strong)&amp;gt;/g, '&lt;$1&gt;');

                        // results
                    } else {
                        var title = suggestion.data.title
                            .replace(new RegExp(pattern, 'gi'), '&lt;em&gt;$1&lt;\/em&gt;')
                            .replace(/&amp;/g, '&amp;amp;')
                            .replace(/&lt;/g, '&amp;lt;')
                            .replace(/&gt;/g, '&amp;gt;')
                            .replace(/"/g, '&amp;quot;')
                            .replace(/&amp;lt;(\/?em)&amp;gt;/g, '&lt;$1&gt;');

                        return '&lt;div class="' + suggestion.data.type + '"&gt;' +
                            (!!suggestion.data.previewImage ? '&lt;figure ' + (!!suggestion.data.hasVideo ? 'class="hasVideo"' : '') + '&gt;&lt;img src="' + suggestion.data.previewImage + '" /&gt;&lt;/figure&gt;' : '') +
                            '&lt;a href="' + suggestion.data.link + '" class="internal-link"&gt;' + title + '&lt;/a&gt;' +
                            '&lt;/div&gt;';
                    }

                }
            }).on('blur', function () {
                $searchBox.parent().removeClass('autocomplete-active');
                var $box = $(this);
                setTimeout(function () {
                    $box.devbridgeAutocomplete('hide');
                }, 200);
            });
        });
    };
}

jQuery(document).ready(function() {
    /** solr search autocomplete **/
    var solrSuggestController = new SuggestController();
    solrSuggestController.init();

    jQuery("body").on("tx_solr_updated", function() {
        solrSuggestController.init();
    });
});


/*
       (accessible)
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   &lt; _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

 Version: 1.8.1@accessible360.1
  Author: Jason Webb (Accessible360)
 Website: https://accessible360.com
    Docs: https://accessible360.github.io/accessible-slick
    Repo: https://github.com/Accessible360/accessible-slick
  Issues: https://github.com/Accessible360/accessible-slick/issues

 */
/* global window, document, define, jQuery, setInterval, clearInterval */
;(function (factory) {
  'use strict';
  if (typeof define === 'function' &amp;&amp; define.amd) {
    define(['jquery'], factory);
  } else if (typeof exports !== 'undefined') {
    module.exports = factory(require('jquery'));
  } else {
    factory(jQuery);
  }

}(function ($) {
  'use strict';
  var Slick = window.Slick || {};

  Slick = (function () {

    var instanceUid = 0;

    function Slick(element, settings) {

      var _ = this, dataSettings;

      _.defaults = {
        adaptiveHeight: false,
        appendArrows: $(element),
        appendDots: $(element),
        arrows: true,
        arrowsPlacement: null,
        asNavFor: null,
        prevArrow: '&lt;button class="slick-prev" type="button"&gt;'
          + '&lt;span class="slick-prev-icon" aria-hidden="true"&gt;&lt;/span&gt;'
          + '&lt;span class="slick-sr-only"&gt;Vorige&lt;/span&gt;'
          + '&lt;/button&gt;',
        nextArrow: '&lt;button class="slick-next" type="button"&gt;'
          + '&lt;span class="slick-next-icon" aria-hidden="true"&gt;&lt;/span&gt;'
          + '&lt;span class="slick-sr-only"&gt;Volgende&lt;/span&gt;'
          + '&lt;/button&gt;',
        autoplay: false,
        autoplaySpeed: 3000,
        centerMode: false,
        centerPadding: '50px',
        cssEase: 'ease',
        customPaging: function (slider, i) {
          return $('&lt;button type="button"&gt;'
            + '&lt;span class="slick-dot-icon" aria-hidden="true"&gt;&lt;/span&gt;'
            + '&lt;span class="slick-sr-only"&gt;Ga naar slide ' + (i + 1) + '&lt;/span&gt;'
            + '&lt;/button&gt;');
        },
        dots: false,
        dotsClass: 'slick-dots',
        draggable: true,
        easing: 'linear',
        edgeFriction: 0.35,
        fade: false,
        infinite: true,
        initialSlide: 0,
        instructionsText: null,
        lazyLoad: 'ondemand',
        mobileFirst: false,
        playIcon: '&lt;span class="slick-play-icon" aria-hidden="true"&gt;&lt;/span&gt;',
        pauseIcon: '&lt;span class="slick-pause-icon" aria-hidden="true"&gt;&lt;/span&gt;',
        pauseOnHover: true,
        pauseOnFocus: true,
        pauseOnDotsHover: false,
        regionLabel: 'carousel',
        respondTo: 'window',
        responsive: null,
        rows: 1,
        rtl: false,
        slide: '',
        slidesPerRow: 1,
        slidesToShow: 1,
        slidesToScroll: 1,
        speed: 500,
        swipe: true,
        swipeToSlide: false,
        touchMove: true,
        touchThreshold: 5,
        useAutoplayToggleButton: true,
        useCSS: true,
        useGroupRole: true,
        useTransform: true,
        variableWidth: false,
        vertical: false,
        verticalSwiping: false,
        waitForAnimate: true,
        zIndex: 1000
      };

      _.initials = {
        animating: false,
        dragging: false,
        autoPlayTimer: null,
        currentDirection: 0,
        currentLeft: null,
        currentSlide: 0,
        direction: 1,
        $dots: null,
        $instructionsText: null,
        listWidth: null,
        listHeight: null,
        loadIndex: 0,
        $nextArrow: null,
        $pauseButton: null,
        $pauseIcon: null,
        $playIcon: null,
        $prevArrow: null,
        scrolling: false,
        slideCount: null,
        slideWidth: null,
        $slideTrack: null,
        $slides: null,
        sliding: false,
        slideOffset: 0,
        swipeLeft: null,
        swiping: false,
        $list: null,
        touchObject: {},
        transformsEnabled: false,
        unslicked: false
      };

      $.extend(_, _.initials);

      _.activeBreakpoint = null;
      _.animType = null;
      _.animProp = null;
      _.breakpoints = [];
      _.breakpointSettings = [];
      _.cssTransitions = false;
      _.focussed = false;
      _.interrupted = false;
      _.hidden = 'hidden';
      _.paused = true;
      _.positionProp = null;
      _.respondTo = null;
      _.rowCount = 1;
      _.shouldClick = true;
      _.$slider = $(element);
      _.$slidesCache = null;
      _.transformType = null;
      _.transitionType = null;
      _.visibilityChange = 'visibilitychange';
      _.windowWidth = 0;
      _.windowTimer = null;

      dataSettings = $(element).data('slick') || {};

      _.options = $.extend({}, _.defaults, settings, dataSettings);

      _.currentSlide = _.options.initialSlide;

      _.originalSettings = _.options;

      if (typeof document.mozHidden !== 'undefined') {
        _.hidden = 'mozHidden';
        _.visibilityChange = 'mozvisibilitychange';
      } else if (typeof document.webkitHidden !== 'undefined') {
        _.hidden = 'webkitHidden';
        _.visibilityChange = 'webkitvisibilitychange';
      }

      _.autoPlay = $.proxy(_.autoPlay, _);
      _.autoPlayClear = $.proxy(_.autoPlayClear, _);
      _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
      _.autoPlayToggleHandler = $.proxy(_.autoPlayToggleHandler, _);
      _.changeSlide = $.proxy(_.changeSlide, _);
      _.clickHandler = $.proxy(_.clickHandler, _);
      _.selectHandler = $.proxy(_.selectHandler, _);
      _.setPosition = $.proxy(_.setPosition, _);
      _.swipeHandler = $.proxy(_.swipeHandler, _);
      _.dragHandler = $.proxy(_.dragHandler, _);

      _.instanceUid = instanceUid++;

      // A simple way to check for HTML strings
      // Strict HTML recognition (must start with &lt;)
      // Extracted from jQuery v1.11 source
      _.htmlExpr = /^(?:\s*(&lt;[\w\W]+&gt;)[^&gt;]*)$/;


      _.registerBreakpoints();
      _.init(true);

    }

    return Slick;

  }());

  Slick.prototype.addSlide = Slick.prototype.slickAdd = function (markup, index, addBefore) {

    var _ = this;

    if (typeof (index) === 'boolean') {
      addBefore = index;
      index = null;
    } else if (index &lt; 0 || (index &gt;= _.slideCount)) {
      return false;
    }

    _.unload();

    if (typeof (index) === 'number') {
      if (index === 0 &amp;&amp; _.$slides.length === 0) {
        $(markup).appendTo(_.$slideTrack);
      } else if (addBefore) {
        $(markup).insertBefore(_.$slides.eq(index));
      } else {
        $(markup).insertAfter(_.$slides.eq(index));
      }
    } else {
      if (addBefore === true) {
        $(markup).prependTo(_.$slideTrack);
      } else {
        $(markup).appendTo(_.$slideTrack);
      }
    }

    _.$slides = _.$slideTrack.children(this.options.slide);

    _.$slideTrack.children(this.options.slide).detach();

    _.$slideTrack.append(_.$slides);

    _.$slides.each(function (index, element) {
      $(element).attr('data-slick-index', index);
      $(element).attr('role', 'group');
      $(element).attr('aria-label', 'slide ' + index);
    });

    _.$slidesCache = _.$slides;

    _.reinit();

  };

  Slick.prototype.animateHeight = function () {
    var _ = this;
    if (_.options.slidesToShow === 1 &amp;&amp; _.options.adaptiveHeight === true &amp;&amp; _.options.vertical === false) {
      var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
      _.$list.animate({
        height: targetHeight
      }, _.options.speed);
    }
  };

  Slick.prototype.animateSlide = function (targetLeft, callback) {

    var animProps = {},
      _ = this;

    _.animateHeight();

    if (_.options.rtl === true &amp;&amp; _.options.vertical === false) {
      targetLeft = -targetLeft;
    }
    if (_.transformsEnabled === false) {
      if (_.options.vertical === false) {
        _.$slideTrack.animate({
          left: targetLeft
        }, _.options.speed, _.options.easing, callback);
      } else {
        _.$slideTrack.animate({
          top: targetLeft
        }, _.options.speed, _.options.easing, callback);
      }

    } else {

      if (_.cssTransitions === false) {
        if (_.options.rtl === true) {
          _.currentLeft = -(_.currentLeft);
        }
        $({
          animStart: _.currentLeft
        }).animate({
          animStart: targetLeft
        }, {
          duration: _.options.speed,
          easing: _.options.easing,
          step: function (now) {
            now = Math.ceil(now);
            if (_.options.vertical === false) {
              animProps[_.animType] = 'translate(' +
                now + 'px, 0px)';
              _.$slideTrack.css(animProps);
            } else {
              animProps[_.animType] = 'translate(0px,' +
                now + 'px)';
              _.$slideTrack.css(animProps);
            }
          },
          complete: function () {
            if (callback) {
              callback.call();
            }
          }
        });

      } else {

        _.applyTransition();
        targetLeft = Math.ceil(targetLeft);

        if (_.options.vertical === false) {
          animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
        } else {
          animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
        }
        _.$slideTrack.css(animProps);

        if (callback) {
          setTimeout(function () {

            _.disableTransition();

            callback.call();
          }, _.options.speed);
        }

      }

    }

  };

  Slick.prototype.getNavTarget = function () {

    var _ = this,
      asNavFor = _.options.asNavFor;

    if (asNavFor &amp;&amp; asNavFor !== null) {
      asNavFor = $(asNavFor).not(_.$slider);
    }

    return asNavFor;

  };

  Slick.prototype.asNavFor = function (index) {

    var _ = this,
      asNavFor = _.getNavTarget();

    if (asNavFor !== null &amp;&amp; typeof asNavFor === 'object') {
      asNavFor.each(function () {
        var target = $(this).slick('getSlick');
        if (!target.unslicked) {
          target.slideHandler(index, true);
        }
      });
    }

  };

  Slick.prototype.applyTransition = function (slide) {

    var _ = this,
      transition = {};

    if (_.options.fade === false) {
      transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
    } else {
      transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
    }

    if (_.options.fade === false) {
      _.$slideTrack.css(transition);
    } else {
      _.$slides.eq(slide).css(transition);
    }

  };

  Slick.prototype.autoPlay = function () {

    var _ = this;

    _.autoPlayClear();

    if (_.slideCount &gt; _.options.slidesToShow) {
      _.autoPlayTimer = setInterval(_.autoPlayIterator, _.options.autoplaySpeed);
    }

  };

  Slick.prototype.autoPlayClear = function () {

    var _ = this;

    if (_.autoPlayTimer) {
      clearInterval(_.autoPlayTimer);
    }

  };

  Slick.prototype.autoPlayIterator = function () {

    var _ = this,
      slideTo = _.currentSlide + _.options.slidesToScroll;

    if (!_.paused &amp;&amp; !_.interrupted &amp;&amp; !_.focussed) {

      if (_.options.infinite === false) {

        if (_.direction === 1 &amp;&amp; (_.currentSlide + 1) === (_.slideCount - 1)) {
          _.direction = 0;
        } else if (_.direction === 0) {

          slideTo = _.currentSlide - _.options.slidesToScroll;

          if (_.currentSlide - 1 === 0) {
            _.direction = 1;
          }

        }

      }

      _.slideHandler(slideTo);

    }

  };

  Slick.prototype.autoPlayToggleHandler = function () {
    var _ = this;

    if (_.paused) {
      _.$playIcon.css('display', 'none');
      _.$pauseIcon.css('display', 'inline');

      _.$pauseButton.find('.slick-play-text').attr('style', 'display: none');
      _.$pauseButton.find('.slick-pause-text').removeAttr('style');

      _.slickPlay();
    } else {
      _.$playIcon.css('display', 'inline');
      _.$pauseIcon.css('display', 'none');

      _.$pauseButton.find('.slick-play-text').removeAttr('style');
      _.$pauseButton.find('.slick-pause-text').attr('style', 'display: none');

      _.slickPause();
    }
  };

  Slick.prototype.buildArrows = function () {

    var _ = this;

    if (_.options.arrows === true) {

      _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
      _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');

      if (_.slideCount &gt; _.options.slidesToShow) {

        if (_.htmlExpr.test(_.options.prevArrow)) {
          if (_.options.arrowsPlacement != null) {
            switch (_.options.arrowsPlacement) {
              case 'beforeSlides':
              case 'split':
                console.log('test');
                _.$prevArrow.prependTo(_.options.appendArrows);
                break;

              case 'afterSlides':
                _.$prevArrow.appendTo(_.options.appendArrows);
                break;
            }

          } else {
            _.$prevArrow.prependTo(_.options.appendArrows);
          }
        }

        if (_.htmlExpr.test(_.options.nextArrow)) {
          if (_.options.arrowsPlacement != null) {
            switch (_.options.arrowsPlacement) {
              case 'beforeSlides':
                console.log('test2');
                _.$prevArrow.after(_.$nextArrow);
                break;

              case 'afterSlides':
              case 'split':
                _.$nextArrow.appendTo(_.options.appendArrows);
            }
          } else {
            _.$nextArrow.appendTo(_.options.appendArrows);
          }
        }

        if (_.options.infinite !== true) {
          _.$prevArrow
            .addClass('slick-disabled')
            .prop('disabled', true);
        }

      } else {

        _.$prevArrow.add(_.$nextArrow)

          .addClass('slick-hidden')
          .prop('disabled', true);
      }

    }

  };

  Slick.prototype.buildDots = function () {

    var _ = this,
      i, dot;

    if (_.options.dots === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      _.$slider.addClass('slick-dotted');

      dot = $('&lt;ul /&gt;').addClass(_.options.dotsClass);

      for (i = 0; i &lt;= _.getDotCount(); i += 1) {
        dot.append($('&lt;li /&gt;').append(_.options.customPaging.call(this, _, i)));
      }

      _.$dots = dot.appendTo(_.options.appendDots);

      _.$dots.find('li').first().addClass('slick-active');

    }

  };

  Slick.prototype.buildOut = function () {

    var _ = this;

    _.$slides =
      _.$slider
        .children(_.options.slide + ':not(.slick-cloned)')
        .addClass('slick-slide');

    _.slideCount = _.$slides.length;

    _.$slides.each(function (index, element) {
      $(element)
        .attr('data-slick-index', index)
        .data('originalStyling', $(element).attr('style') || '');

      if (_.options.useGroupRole) {
        $(element)
          .attr('role', 'group')
          .attr('aria-label', 'slide ' + (index + 1));
      }
    });

    _.$slider.addClass('slick-slider');

    _.$slider.attr('role', 'region');
    _.$slider.attr('aria-label', _.options.regionLabel);

    _.$slideTrack = (_.slideCount === 0) ?
      $('&lt;div class="slick-track"/&gt;').appendTo(_.$slider) :
      _.$slides.wrapAll('&lt;div class="slick-track"/&gt;').parent();

    _.$list = _.$slideTrack.wrap(
      '&lt;div class="slick-list"/&gt;').parent();
    _.$slideTrack.css('opacity', 0);

    if (_.options.centerMode === true || _.options.swipeToSlide === true) {
      _.options.slidesToScroll = 1;
    }

    $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');

    _.setupInfinite();

    _.buildArrows();

    _.buildDots();

    _.updateDots();


    _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);

    if (_.options.draggable === true) {
      _.$list.addClass('draggable');
    }

    if (_.options.autoplay &amp;&amp; _.options.useAutoplayToggleButton) {
      _.$pauseIcon = $(_.options.pauseIcon).attr('aria-hidden', true);
      _.$playIcon = $(_.options.playIcon).attr('aria-hidden', true);

      _.$pauseButton = $('&lt;button type="button" class="slick-autoplay-toggle-button"&gt;');
      _.$pauseButton.append(_.$pauseIcon);
      _.$pauseButton.append(_.$playIcon.css('display', 'none'));
      _.$pauseButton.append($('&lt;span class="slick-pause-text slick-sr-only"&gt;Pause&lt;/span&gt;'));
      _.$pauseButton.append($('&lt;span class="slick-play-text slick-sr-only" style="display: none"&gt;Play&lt;/span&gt;'));

      _.$pauseButton.prependTo(_.$slider);
    }

    if ((_.options.instructionsText != null &amp;&amp; _.options.instructionsText != '')) {
      _.$instructionsText = $('&lt;p class="slick-instructions slick-sr-only"&gt;' + _.options.instructionsText + '&lt;/p&gt;');
      _.$instructionsText.prependTo(_.$slider);
    }

  };

  Slick.prototype.buildRows = function () {

    var _ = this, a, b, c, newSlides, numOfSlides, originalSlides, slidesPerSection;

    newSlides = document.createDocumentFragment();
    originalSlides = _.$slider.children();

    if (_.options.rows &gt; 0) {

      slidesPerSection = _.options.slidesPerRow * _.options.rows;
      numOfSlides = Math.ceil(
        originalSlides.length / slidesPerSection
      );

      for (a = 0; a &lt; numOfSlides; a++) {
        var slide = document.createElement('div');
        for (b = 0; b &lt; _.options.rows; b++) {
          var row = document.createElement('div');
          for (c = 0; c &lt; _.options.slidesPerRow; c++) {
            var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
            if (originalSlides.get(target)) {
              row.appendChild(originalSlides.get(target));
            }
          }
          slide.appendChild(row);
        }
        newSlides.appendChild(slide);
      }

      _.$slider.empty().append(newSlides);
      _.$slider.children().children().children()
        .css({
          'width': (100 / _.options.slidesPerRow) + '%',
          'display': 'inline-block'
        });

    }

  };

  Slick.prototype.checkResponsive = function (initial, forceUpdate) {

    var _ = this,
      breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
    var sliderWidth = _.$slider.width();
    var windowWidth = window.innerWidth || $(window).width();

    if (_.respondTo === 'window') {
      respondToWidth = windowWidth;
    } else if (_.respondTo === 'slider') {
      respondToWidth = sliderWidth;
    } else if (_.respondTo === 'min') {
      respondToWidth = Math.min(windowWidth, sliderWidth);
    }

    if (_.options.responsive &amp;&amp;
      _.options.responsive.length &amp;&amp;
      _.options.responsive !== null) {

      targetBreakpoint = null;

      for (breakpoint in _.breakpoints) {
        if (_.breakpoints.hasOwnProperty(breakpoint)) {
          if (_.originalSettings.mobileFirst === false) {
            if (respondToWidth &lt; _.breakpoints[breakpoint]) {
              targetBreakpoint = _.breakpoints[breakpoint];
            }
          } else {
            if (respondToWidth &gt; _.breakpoints[breakpoint]) {
              targetBreakpoint = _.breakpoints[breakpoint];
            }
          }
        }
      }

      if (targetBreakpoint !== null) {
        if (_.activeBreakpoint !== null) {
          if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
            _.activeBreakpoint =
              targetBreakpoint;
            if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
              _.unslick(targetBreakpoint);
            } else {
              _.options = $.extend({}, _.originalSettings,
                _.breakpointSettings[
                  targetBreakpoint]);
              if (initial === true) {
                _.currentSlide = _.options.initialSlide;
              }
              _.refresh(initial);
            }
            triggerBreakpoint = targetBreakpoint;
          }
        } else {
          _.activeBreakpoint = targetBreakpoint;
          if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
            _.unslick(targetBreakpoint);
          } else {
            _.options = $.extend({}, _.originalSettings,
              _.breakpointSettings[
                targetBreakpoint]);
            if (initial === true) {
              _.currentSlide = _.options.initialSlide;
            }
            _.refresh(initial);
          }
          triggerBreakpoint = targetBreakpoint;
        }
      } else {
        if (_.activeBreakpoint !== null) {
          _.activeBreakpoint = null;
          _.options = _.originalSettings;
          if (initial === true) {
            _.currentSlide = _.options.initialSlide;
          }
          _.refresh(initial);
          triggerBreakpoint = targetBreakpoint;
        }
      }

      // only trigger breakpoints during an actual break. not on initialize.
      if (!initial &amp;&amp; triggerBreakpoint !== false) {
        _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
      }
    }

  };

  Slick.prototype.changeSlide = function (event, dontAnimate) {

    var _ = this,
      $target = $(event.currentTarget),
      indexOffset, slideOffset, unevenOffset;

    // If target is a link, prevent default action.
    if ($target.is('a')) {
      event.preventDefault();
    }

    // If target is not the &lt;li&gt; element (ie: a child), find the &lt;li&gt;.
    if (!$target.is('li')) {
      $target = $target.closest('li');
    }

    unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
    indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;

    switch (event.data.message) {

      case 'previous':
        slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
        if (_.slideCount &gt; _.options.slidesToShow) {
          _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
        }
        break;

      case 'next':
        slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
        if (_.slideCount &gt; _.options.slidesToShow) {
          _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
        }
        break;

      case 'index':
        var index = event.data.index === 0 ? 0 :
          event.data.index || $target.index() * _.options.slidesToScroll;

        _.slideHandler(_.checkNavigable(index), false, dontAnimate);
        $target.children().trigger('focus');
        break;

      default:
        return;
    }

  };

  Slick.prototype.checkNavigable = function (index) {

    var _ = this,
      navigables, prevNavigable;

    navigables = _.getNavigableIndexes();
    prevNavigable = 0;
    if (index &gt; navigables[navigables.length - 1]) {
      index = navigables[navigables.length - 1];
    } else {
      for (var n in navigables) {
        if (index &lt; navigables[n]) {
          index = prevNavigable;
          break;
        }
        prevNavigable = navigables[n];
      }
    }

    return index;
  };

  Slick.prototype.cleanUpEvents = function () {

    var _ = this;

    if (_.options.autoplay &amp;&amp; _.options.useAutoplayToggleButton) {
      _.$pauseButton.off('click.slick', _.autoPlayToggleHandler);
    }

    if (_.options.dots &amp;&amp; _.$dots !== null) {

      $('li', _.$dots)
        .off('click.slick', _.changeSlide)
        .off('mouseenter.slick', $.proxy(_.interrupt, _, true))
        .off('mouseleave.slick', $.proxy(_.interrupt, _, false));
    }

    _.$slider.off('focus.slick blur.slick');

    if (_.options.arrows === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
      _.$prevArrow &amp;&amp; _.$prevArrow.off('click.slick', _.changeSlide);
      _.$nextArrow &amp;&amp; _.$nextArrow.off('click.slick', _.changeSlide);
    }

    _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
    _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
    _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
    _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);

    _.$list.off('click.slick', _.clickHandler);

    $(document).off(_.visibilityChange, _.visibility);

    _.cleanUpSlideEvents();

    $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);

    $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);

    $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);

    $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);

  };

  Slick.prototype.cleanUpSlideEvents = function () {

    var _ = this;

    _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
    _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));

  };

  Slick.prototype.cleanUpRows = function () {

    var _ = this, originalSlides;

    if (_.options.rows &gt; 0) {
      originalSlides = _.$slides.children().children();
      originalSlides.removeAttr('style');
      _.$slider.empty().append(originalSlides);
    }

  };

  Slick.prototype.clickHandler = function (event) {

    var _ = this;

    if (_.shouldClick === false) {
      event.stopImmediatePropagation();
      event.stopPropagation();
      event.preventDefault();
    }

  };

  Slick.prototype.destroy = function (refresh) {

    var _ = this;

    _.autoPlayClear();

    _.touchObject = {};

    _.cleanUpEvents();

    $('.slick-cloned', _.$slider).detach();

    if (_.options.autoplay &amp;&amp; _.options.useAutoplayToggleButton) {
      _.$pauseButton.remove();
    }

    if (_.$dots) {
      _.$dots.remove();
    }

    if (_.$prevArrow &amp;&amp; _.$prevArrow.length) {

      _.$prevArrow
        .removeClass('slick-disabled slick-arrow slick-hidden')
        .prop('disabled', false)
        .css('display', '');

      if (_.htmlExpr.test(_.options.prevArrow)) {
        _.$prevArrow.remove();
      }
    }

    if (_.$nextArrow &amp;&amp; _.$nextArrow.length) {

      _.$nextArrow
        .removeClass('slick-disabled slick-arrow slick-hidden')
        .prop('disabled', false)
        .css('display', '');

      if (_.htmlExpr.test(_.options.nextArrow)) {
        _.$nextArrow.remove();
      }
    }


    if (_.$slides) {

      _.$slides
        .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
        .removeAttr('aria-hidden')
        .removeAttr('data-slick-index')
        .each(function () {
          $(this).attr('style', $(this).data('originalStyling'));
        });

      _.$slideTrack.children(this.options.slide).detach();

      _.$slideTrack.detach();

      _.$list.detach();

      _.$slider.append(_.$slides);
    }

    _.cleanUpRows();

    _.$slider.removeClass('slick-slider');
    _.$slider.removeClass('slick-initialized');
    _.$slider.removeClass('slick-dotted');

    _.unslicked = true;

    if (!refresh) {
      _.$slider.trigger('destroy', [_]);
    }

  };

  Slick.prototype.disableTransition = function (slide) {

    var _ = this,
      transition = {};

    transition[_.transitionType] = '';

    if (_.options.fade === false) {
      _.$slideTrack.css(transition);
    } else {
      _.$slides.eq(slide).css(transition);
    }

  };

  Slick.prototype.fadeSlide = function (slideIndex, callback) {

    var _ = this;

    if (_.cssTransitions === false) {

      _.$slides.eq(slideIndex).css({
        zIndex: _.options.zIndex
      });

      _.$slides.eq(slideIndex).animate({
        opacity: 1
      }, _.options.speed, _.options.easing, callback);

    } else {

      _.applyTransition(slideIndex);

      _.$slides.eq(slideIndex).css({
        opacity: 1,
        zIndex: _.options.zIndex
      });

      if (callback) {
        setTimeout(function () {

          _.disableTransition(slideIndex);

          callback.call();
        }, _.options.speed);
      }

    }

  };

  Slick.prototype.fadeSlideOut = function (slideIndex) {

    var _ = this;

    if (_.cssTransitions === false) {

      _.$slides.eq(slideIndex).animate({
        opacity: 0,
        zIndex: _.options.zIndex - 2
      }, _.options.speed, _.options.easing);

    } else {

      _.applyTransition(slideIndex);

      _.$slides.eq(slideIndex).css({
        opacity: 0,
        zIndex: _.options.zIndex - 2
      });

    }

  };

  Slick.prototype.filterSlides = Slick.prototype.slickFilter = function (filter) {

    var _ = this;

    if (filter !== null) {

      _.$slidesCache = _.$slides;

      _.unload();

      _.$slideTrack.children(this.options.slide).detach();

      _.$slidesCache.filter(filter).appendTo(_.$slideTrack);

      _.reinit();

    }

  };

  Slick.prototype.focusHandler = function () {

    var _ = this;

    // If any child element receives focus within the slider we need to pause the autoplay
    _.$slider
      .off('focus.slick blur.slick')
      .on(
        'focus.slick',
        '*',
        function (event) {
          var $sf = $(this);

          setTimeout(function () {
            if (_.options.pauseOnFocus) {
              if ($sf.is(':focus')) {
                _.focussed = true;
                _.autoPlay();
              }
            }
          }, 0);
        }
      ).on(
      'blur.slick',
      '*',
      function (event) {
        var $sf = $(this);

        // When a blur occurs on any elements within the slider we become unfocused
        if (_.options.pauseOnFocus) {
          _.focussed = false;
          _.autoPlay();
        }
      }
    );
  };

  Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function () {

    var _ = this;
    return _.currentSlide;

  };

  Slick.prototype.getDotCount = function () {

    var _ = this;

    var breakPoint = 0;
    var counter = 0;
    var pagerQty = 0;

    if (_.options.infinite === true) {
      if (_.slideCount &lt;= _.options.slidesToShow) {
        ++pagerQty;
      } else {
        while (breakPoint &lt; _.slideCount) {
          ++pagerQty;
          breakPoint = counter + _.options.slidesToScroll;
          counter += _.options.slidesToScroll &lt;= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
        }
      }
    } else if (_.options.centerMode === true) {
      pagerQty = _.slideCount;
    } else if (!_.options.asNavFor) {
      pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
    } else {
      while (breakPoint &lt; _.slideCount) {
        ++pagerQty;
        breakPoint = counter + _.options.slidesToScroll;
        counter += _.options.slidesToScroll &lt;= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
      }
    }

    return pagerQty - 1;

  };

  Slick.prototype.getLeft = function (slideIndex) {

    var _ = this,
      targetLeft,
      verticalHeight,
      verticalOffset = 0,
      targetSlide,
      coef;

    _.slideOffset = 0;
    verticalHeight = _.$slides.first().outerHeight(true);

    if (_.options.infinite === true) {
      if (_.slideCount &gt; _.options.slidesToShow) {
        _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
        coef = -1

        if (_.options.vertical === true &amp;&amp; _.options.centerMode === true) {
          if (_.options.slidesToShow === 2) {
            coef = -1.5;
          } else if (_.options.slidesToShow === 1) {
            coef = -2
          }
        }
        verticalOffset = (verticalHeight * _.options.slidesToShow) * coef;
      }
      if (_.slideCount % _.options.slidesToScroll !== 0) {
        if (slideIndex + _.options.slidesToScroll &gt; _.slideCount &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
          if (slideIndex &gt; _.slideCount) {
            _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
            verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
          } else {
            _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
            verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
          }
        }
      }
    } else {
      if (slideIndex + _.options.slidesToShow &gt; _.slideCount) {
        _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
        verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
      }
    }

    if (_.slideCount &lt;= _.options.slidesToShow) {
      _.slideOffset = 0;
      verticalOffset = 0;
    }

    if (_.options.centerMode === true &amp;&amp; _.slideCount &lt;= _.options.slidesToShow) {
      _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
    } else if (_.options.centerMode === true &amp;&amp; _.options.infinite === true) {
      _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
    } else if (_.options.centerMode === true) {
      _.slideOffset = 0;
      _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
    }

    if (_.options.vertical === false) {
      targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
    } else {
      targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
    }

    if (_.options.variableWidth === true) {

      if (_.slideCount &lt;= _.options.slidesToShow || _.options.infinite === false) {
        targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
      } else {
        targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
      }

      if (_.options.rtl === true) {
        if (targetSlide[0]) {
          targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
        } else {
          targetLeft = 0;
        }
      } else {
        targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
      }

      if (_.options.centerMode === true) {
        if (_.slideCount &lt;= _.options.slidesToShow || _.options.infinite === false) {
          targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
        } else {
          targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
        }

        if (_.options.rtl === true) {
          if (targetSlide[0]) {
            targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
          } else {
            targetLeft = 0;
          }
        } else {
          targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
        }

        targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
      }
    }

    return targetLeft;

  };

  Slick.prototype.getOption = Slick.prototype.slickGetOption = function (option) {

    var _ = this;

    return _.options[option];

  };

  Slick.prototype.getNavigableIndexes = function () {

    var _ = this,
      breakPoint = 0,
      counter = 0,
      indexes = [],
      max;

    if (_.options.infinite === false) {
      max = _.slideCount;
    } else {
      breakPoint = _.options.slidesToScroll * -1;
      counter = _.options.slidesToScroll * -1;
      max = _.slideCount * 2;
    }

    while (breakPoint &lt; max) {
      indexes.push(breakPoint);
      breakPoint = counter + _.options.slidesToScroll;
      counter += _.options.slidesToScroll &lt;= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
    }

    return indexes;

  };

  Slick.prototype.getSlick = function () {

    return this;

  };

  Slick.prototype.getSlideCount = function () {

    var _ = this,
      slidesTraversed, swipedSlide, swipeTarget, centerOffset;

    centerOffset = _.options.centerMode === true ? Math.floor(_.$list.width() / 2) : 0;
    swipeTarget = (_.swipeLeft * -1) + centerOffset;

    if (_.options.swipeToSlide === true) {

      _.$slideTrack.find('.slick-slide').each(function (index, slide) {

        var slideOuterWidth, slideOffset, slideRightBoundary;
        slideOuterWidth = $(slide).outerWidth();
        slideOffset = slide.offsetLeft;
        if (_.options.centerMode !== true) {
          slideOffset += (slideOuterWidth / 2);
        }

        slideRightBoundary = slideOffset + (slideOuterWidth);

        if (swipeTarget &lt; slideRightBoundary) {
          swipedSlide = slide;
          return false;
        }
      });

      slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;

      return slidesTraversed;

    } else {
      return _.options.slidesToScroll;
    }

  };

  Slick.prototype.goTo = Slick.prototype.slickGoTo = function (slide, dontAnimate) {

    var _ = this;

    _.changeSlide({
      data: {
        message: 'index',
        index: parseInt(slide)
      }
    }, dontAnimate);

  };

  Slick.prototype.init = function (creation) {

    var _ = this;

    if (!$(_.$slider).hasClass('slick-initialized')) {

      $(_.$slider).addClass('slick-initialized');

      _.buildRows();
      _.buildOut();
      _.setProps();
      _.startLoad();
      _.loadSlider();
      _.initializeEvents();
      _.updateArrows();
      _.updateDots();
      _.checkResponsive(true);
      _.focusHandler();

    }

    if (creation) {
      _.$slider.trigger('init', [_]);
    }

    if (_.options.autoplay) {

      _.paused = false;
      _.autoPlay();

    }

    _.updateSlideVisibility();

    if (_.options.accessibility != undefined) {
      console.warn('accessibility setting is no longer supported.')
    }

    if (_.options.focusOnChange != undefined) {
      console.warn('focusOnChange is no longer supported.');
    }

    if (_.options.focusOnSelect != undefined) {
      console.warn('focusOnSelect is no longer supported.');
    }

  };

  Slick.prototype.initArrowEvents = function () {

    var _ = this;

    if (_.options.arrows === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
      _.$prevArrow
        .off('click.slick')
        .on('click.slick', {
          message: 'previous'
        }, _.changeSlide);
      _.$nextArrow
        .off('click.slick')
        .on('click.slick', {
          message: 'next'
        }, _.changeSlide);
    }

  };

  Slick.prototype.initDotEvents = function () {

    var _ = this;

    if (_.options.dots === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
      $('li', _.$dots).on('click.slick', {
        message: 'index'
      }, _.changeSlide);
    }

    if (_.options.dots === true &amp;&amp; _.options.pauseOnDotsHover === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      $('li', _.$dots)
        .on('mouseenter.slick', $.proxy(_.interrupt, _, true))
        .on('mouseleave.slick', $.proxy(_.interrupt, _, false));

    }

  };

  Slick.prototype.initSlideEvents = function () {

    var _ = this;

    if (_.options.pauseOnHover) {

      _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
      _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));

    }

  };

  Slick.prototype.initializeEvents = function () {

    var _ = this;

    _.initArrowEvents();

    _.initDotEvents();
    _.initSlideEvents();

    if (_.options.autoplay &amp;&amp; _.options.useAutoplayToggleButton) {
      _.$pauseButton.on('click.slick', _.autoPlayToggleHandler);
    }

    _.$list.on('touchstart.slick mousedown.slick', {
      action: 'start'
    }, _.swipeHandler);
    _.$list.on('touchmove.slick mousemove.slick', {
      action: 'move'
    }, _.swipeHandler);
    _.$list.on('touchend.slick mouseup.slick', {
      action: 'end'
    }, _.swipeHandler);
    _.$list.on('touchcancel.slick mouseleave.slick', {
      action: 'end'
    }, _.swipeHandler);

    _.$list.on('click.slick', _.clickHandler);

    $(document).on(_.visibilityChange, $.proxy(_.visibility, _));

    $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));

    $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));

    $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);

    $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
    $(_.setPosition);

  };

  Slick.prototype.initUI = function () {

    var _ = this;

    if (_.options.arrows === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      _.$prevArrow.show();
      _.$nextArrow.show();

    }

    if (_.options.dots === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      _.$dots.show();

    }

  };

  Slick.prototype.lazyLoad = function () {

    var _ = this,
      loadRange, cloneRange, rangeStart, rangeEnd;

    function loadImages(imagesScope) {

      $('img[data-lazy]', imagesScope).each(function () {

        var image = $(this),
          imageSource = $(this).attr('data-lazy'),
          imageSrcSet = $(this).attr('data-srcset'),
          imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
          imageToLoad = document.createElement('img');

        imageToLoad.onload = function () {

          image
            .animate({opacity: 0}, 100, function () {

              if (imageSrcSet) {
                image
                  .attr('srcset', imageSrcSet);

                if (imageSizes) {
                  image
                    .attr('sizes', imageSizes);
                }
              }

              image
                .attr('src', imageSource)
                .animate({opacity: 1}, 200, function () {
                  image
                    .removeAttr('data-lazy data-srcset data-sizes')
                    .removeClass('slick-loading');
                });
              _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
            });

        };

        imageToLoad.onerror = function () {

          image
            .removeAttr('data-lazy')
            .removeClass('slick-loading')
            .addClass('slick-lazyload-error');

          _.$slider.trigger('lazyLoadError', [_, image, imageSource]);

        };

        imageToLoad.src = imageSource;

      });

    }

    if (_.options.centerMode === true) {
      if (_.options.infinite === true) {
        rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
        rangeEnd = rangeStart + _.options.slidesToShow + 2;
      } else {
        rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
        rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
      }
    } else {
      rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
      rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
      if (_.options.fade === true) {
        if (rangeStart &gt; 0) rangeStart--;
        if (rangeEnd &lt;= _.slideCount) rangeEnd++;
      }
    }

    loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);

    if (_.options.lazyLoad === 'anticipated') {
      var prevSlide = rangeStart - 1,
        nextSlide = rangeEnd,
        $slides = _.$slider.find('.slick-slide');

      for (var i = 0; i &lt; _.options.slidesToScroll; i++) {
        if (prevSlide &lt; 0) prevSlide = _.slideCount - 1;
        loadRange = loadRange.add($slides.eq(prevSlide));
        loadRange = loadRange.add($slides.eq(nextSlide));
        prevSlide--;
        nextSlide++;
      }
    }

    loadImages(loadRange);

    if (_.slideCount &lt;= _.options.slidesToShow) {
      cloneRange = _.$slider.find('.slick-slide');
      loadImages(cloneRange);
    } else if (_.currentSlide &gt;= _.slideCount - _.options.slidesToShow) {
      cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
      loadImages(cloneRange);
    } else if (_.currentSlide === 0) {
      cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
      loadImages(cloneRange);
    }

  };

  Slick.prototype.loadSlider = function () {

    var _ = this;

    _.setPosition();

    _.$slideTrack.css({
      opacity: 1
    });

    _.$slider.removeClass('slick-loading');

    _.initUI();

    if (_.options.lazyLoad === 'progressive') {
      _.progressiveLazyLoad();
    }

  };

  Slick.prototype.next = Slick.prototype.slickNext = function () {

    var _ = this;

    _.changeSlide({
      data: {
        message: 'next'
      }
    });

  };

  Slick.prototype.orientationChange = function () {

    var _ = this;

    _.checkResponsive();
    _.setPosition();

  };

  Slick.prototype.pause = Slick.prototype.slickPause = function () {

    var _ = this;

    _.autoPlayClear();
    _.paused = true;

  };

  Slick.prototype.play = Slick.prototype.slickPlay = function () {

    var _ = this;

    _.autoPlay();
    _.options.autoplay = true;
    _.paused = false;
    _.focussed = false;
    _.interrupted = false;

  };

  Slick.prototype.postSlide = function (index) {

    var _ = this;

    if (!_.unslicked) {

      _.$slider.trigger('afterChange', [_, index]);

      _.animating = false;

      if (_.slideCount &gt; _.options.slidesToShow) {
        _.setPosition();
      }

      _.swipeLeft = null;

      if (_.options.autoplay) {
        _.autoPlay();
      }

      _.updateSlideVisibility();

    }

  };

  Slick.prototype.prev = Slick.prototype.slickPrev = function () {

    var _ = this;

    _.changeSlide({
      data: {
        message: 'previous'
      }
    });

  };

  Slick.prototype.preventDefault = function (event) {

    event.preventDefault();

  };

  Slick.prototype.progressiveLazyLoad = function (tryCount) {

    tryCount = tryCount || 1;

    var _ = this,
      $imgsToLoad = $('img[data-lazy]', _.$slider),
      image,
      imageSource,
      imageSrcSet,
      imageSizes,
      imageToLoad;

    if ($imgsToLoad.length) {

      image = $imgsToLoad.first();
      imageSource = image.attr('data-lazy');
      imageSrcSet = image.attr('data-srcset');
      imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes');
      imageToLoad = document.createElement('img');

      imageToLoad.onload = function () {

        if (imageSrcSet) {
          image
            .attr('srcset', imageSrcSet);

          if (imageSizes) {
            image
              .attr('sizes', imageSizes);
          }
        }

        image
          .attr('src', imageSource)
          .removeAttr('data-lazy data-srcset data-sizes')
          .removeClass('slick-loading');

        if (_.options.adaptiveHeight === true) {
          _.setPosition();
        }

        _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
        _.progressiveLazyLoad();

      };

      imageToLoad.onerror = function () {

        if (tryCount &lt; 3) {

          /**
           * try to load the image 3 times,
           * leave a slight delay so we don't get
           * servers blocking the request.
           */
          setTimeout(function () {
            _.progressiveLazyLoad(tryCount + 1);
          }, 500);

        } else {

          image
            .removeAttr('data-lazy')
            .removeClass('slick-loading')
            .addClass('slick-lazyload-error');

          _.$slider.trigger('lazyLoadError', [_, image, imageSource]);

          _.progressiveLazyLoad();

        }

      };

      imageToLoad.src = imageSource;

    } else {

      _.$slider.trigger('allImagesLoaded', [_]);

    }

  };

  Slick.prototype.refresh = function (initializing) {

    var _ = this, currentSlide, lastVisibleIndex;

    lastVisibleIndex = _.slideCount - _.options.slidesToShow;

    // in non-infinite sliders, we don't want to go past the
    // last visible index.
    if (!_.options.infinite &amp;&amp; (_.currentSlide &gt; lastVisibleIndex)) {
      _.currentSlide = lastVisibleIndex;
    }

    // if less slides than to show, go to start.
    if (_.slideCount &lt;= _.options.slidesToShow) {
      _.currentSlide = 0;

    }

    currentSlide = _.currentSlide;

    _.destroy(true);

    $.extend(_, _.initials, {currentSlide: currentSlide});

    _.init();

    if (!initializing) {

      _.changeSlide({
        data: {
          message: 'index',
          index: currentSlide
        }
      }, false);

    }

  };

  Slick.prototype.registerBreakpoints = function () {

    var _ = this, breakpoint, currentBreakpoint, l,
      responsiveSettings = _.options.responsive || null;

    if ($.type(responsiveSettings) === 'array' &amp;&amp; responsiveSettings.length) {

      _.respondTo = _.options.respondTo || 'window';

      for (breakpoint in responsiveSettings) {

        l = _.breakpoints.length - 1;

        if (responsiveSettings.hasOwnProperty(breakpoint)) {
          currentBreakpoint = responsiveSettings[breakpoint].breakpoint;

          // loop through the breakpoints and cut out any existing
          // ones with the same breakpoint number, we don't want dupes.
          while (l &gt;= 0) {
            if (_.breakpoints[l] &amp;&amp; _.breakpoints[l] === currentBreakpoint) {
              _.breakpoints.splice(l, 1);
            }
            l--;
          }

          _.breakpoints.push(currentBreakpoint);
          _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;

        }

      }

      _.breakpoints.sort(function (a, b) {
        return (_.options.mobileFirst) ? a - b : b - a;
      });

    }

  };

  Slick.prototype.reinit = function () {

    var _ = this;

    _.$slides =
      _.$slideTrack
        .children(_.options.slide)
        .addClass('slick-slide');

    _.slideCount = _.$slides.length;

    if (_.currentSlide &gt;= _.slideCount &amp;&amp; _.currentSlide !== 0) {
      _.currentSlide = _.currentSlide - _.options.slidesToScroll;
    }

    if (_.slideCount &lt;= _.options.slidesToShow) {
      _.currentSlide = 0;
    }

    _.registerBreakpoints();

    _.setProps();
    _.setupInfinite();
    _.buildArrows();
    _.updateArrows();
    _.initArrowEvents();
    _.buildDots();
    _.updateDots();
    _.initDotEvents();
    _.cleanUpSlideEvents();
    _.initSlideEvents();

    _.checkResponsive(false, true);

    _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);

    _.setPosition();
    _.focusHandler();

    _.paused = !_.options.autoplay;
    _.autoPlay();

    _.$slider.trigger('reInit', [_]);

  };

  Slick.prototype.resize = function () {

    var _ = this;

    if ($(window).width() !== _.windowWidth) {
      clearTimeout(_.windowDelay);
      _.windowDelay = window.setTimeout(function () {
        _.windowWidth = $(window).width();
        _.checkResponsive();
        if (!_.unslicked) {
          _.setPosition();
        }
      }, 50);
    }
  };

  Slick.prototype.removeSlide = Slick.prototype.slickRemove = function (index, removeBefore, removeAll) {

    var _ = this;

    if (typeof (index) === 'boolean') {
      removeBefore = index;
      index = removeBefore === true ? 0 : _.slideCount - 1;
    } else {
      index = removeBefore === true ? --index : index;
    }

    if (_.slideCount &lt; 1 || index &lt; 0 || index &gt; _.slideCount - 1) {
      return false;
    }

    _.unload();

    if (removeAll === true) {
      _.$slideTrack.children().remove();
    } else {
      _.$slideTrack.children(this.options.slide).eq(index).remove();
    }

    _.$slides = _.$slideTrack.children(this.options.slide);

    _.$slideTrack.children(this.options.slide).detach();

    _.$slideTrack.append(_.$slides);

    _.$slidesCache = _.$slides;

    _.reinit();

  };

  Slick.prototype.setCSS = function (position) {

    var _ = this,
      positionProps = {},
      x, y;

    if (_.options.rtl === true) {
      position = -position;
    }
    x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
    y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';

    positionProps[_.positionProp] = position;

    if (_.transformsEnabled === false) {
      _.$slideTrack.css(positionProps);
    } else {
      positionProps = {};
      if (_.cssTransitions === false) {
        positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
        _.$slideTrack.css(positionProps);
      } else {
        positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
        _.$slideTrack.css(positionProps);
      }
    }

  };

  Slick.prototype.setDimensions = function () {

    var _ = this;

    if (_.options.vertical === false) {
      if (_.options.centerMode === true) {
        _.$list.css({
          padding: ('0px ' + _.options.centerPadding)
        });
      }
    } else {
      _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
      if (_.options.centerMode === true) {
        _.$list.css({
          padding: (_.options.centerPadding + ' 0px')
        });
      }
    }

    _.listWidth = _.$list.width();
    _.listHeight = _.$list.height();


    if (_.options.vertical === false &amp;&amp; _.options.variableWidth === false) {
      _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
      _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));

    } else if (_.options.variableWidth === true) {
      _.$slideTrack.width(5000 * _.slideCount);
    } else {
      _.slideWidth = Math.ceil(_.listWidth);
      _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
    }

    var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
    if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);

  };

  Slick.prototype.setFade = function () {

    var _ = this,
      targetLeft;

    _.$slides.each(function (index, element) {
      targetLeft = (_.slideWidth * index) * -1;
      if (_.options.rtl === true) {
        $(element).css({
          position: 'relative',
          right: targetLeft,
          top: 0,
          zIndex: _.options.zIndex - 2,
          opacity: 0
        });
      } else {
        $(element).css({
          position: 'relative',
          left: targetLeft,
          top: 0,
          zIndex: _.options.zIndex - 2,
          opacity: 0
        });
      }
    });

    _.$slides.eq(_.currentSlide).css({
      zIndex: _.options.zIndex - 1,
      opacity: 1
    });

  };

  Slick.prototype.setHeight = function () {

    var _ = this;

    if (_.options.slidesToShow === 1 &amp;&amp; _.options.adaptiveHeight === true &amp;&amp; _.options.vertical === false) {
      var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
      _.$list.css('height', targetHeight);
    }

  };

  Slick.prototype.setOption =
    Slick.prototype.slickSetOption = function () {

      /**
       * accepts arguments in format of:
       *
       *  - for changing a single option's value:
       *     .slick("setOption", option, value, refresh )
       *
       *  - for changing a set of responsive options:
       *     .slick("setOption", 'responsive', [{}, ...], refresh )
       *
       *  - for updating multiple values at once (not responsive)
       *     .slick("setOption", { 'option': value, ... }, refresh )
       */

      var _ = this, l, item, option, value, refresh = false, type;

      if ($.type(arguments[0]) === 'object') {

        option = arguments[0];
        refresh = arguments[1];
        type = 'multiple';

      } else if ($.type(arguments[0]) === 'string') {

        option = arguments[0];
        value = arguments[1];
        refresh = arguments[2];

        if (arguments[0] === 'responsive' &amp;&amp; $.type(arguments[1]) === 'array') {

          type = 'responsive';

        } else if (typeof arguments[1] !== 'undefined') {

          type = 'single';

        }

      }

      if (type === 'single') {

        _.options[option] = value;


      } else if (type === 'multiple') {

        $.each(option, function (opt, val) {

          _.options[opt] = val;

        });


      } else if (type === 'responsive') {

        for (item in value) {

          if ($.type(_.options.responsive) !== 'array') {

            _.options.responsive = [value[item]];

          } else {

            l = _.options.responsive.length - 1;

            // loop through the responsive object and splice out duplicates.
            while (l &gt;= 0) {

              if (_.options.responsive[l].breakpoint === value[item].breakpoint) {

                _.options.responsive.splice(l, 1);

              }

              l--;

            }

            _.options.responsive.push(value[item]);

          }

        }

      }

      if (refresh) {

        _.unload();
        _.reinit();

      }

    };

  Slick.prototype.setPosition = function () {

    var _ = this;

    _.setDimensions();

    _.setHeight();

    if (_.options.fade === false) {
      _.setCSS(_.getLeft(_.currentSlide));
    } else {
      _.setFade();
    }

    _.$slider.trigger('setPosition', [_]);

  };

  Slick.prototype.setProps = function () {

    var _ = this,
      bodyStyle = document.body.style;

    _.positionProp = _.options.vertical === true ? 'top' : 'left';

    if (_.positionProp === 'top') {
      _.$slider.addClass('slick-vertical');
    } else {
      _.$slider.removeClass('slick-vertical');
    }

    if (bodyStyle.WebkitTransition !== undefined ||
      bodyStyle.MozTransition !== undefined ||
      bodyStyle.msTransition !== undefined) {
      if (_.options.useCSS === true) {
        _.cssTransitions = true;
      }
    }

    if (_.options.fade) {
      if (typeof _.options.zIndex === 'number') {
        if (_.options.zIndex &lt; 3) {
          _.options.zIndex = 3;
        }
      } else {
        _.options.zIndex = _.defaults.zIndex;
      }
    }

    if (bodyStyle.OTransform !== undefined) {
      _.animType = 'OTransform';
      _.transformType = '-o-transform';
      _.transitionType = 'OTransition';
      if (bodyStyle.perspectiveProperty === undefined &amp;&amp; bodyStyle.webkitPerspective === undefined) _.animType = false;
    }
    if (bodyStyle.MozTransform !== undefined) {
      _.animType = 'MozTransform';
      _.transformType = '-moz-transform';
      _.transitionType = 'MozTransition';
      if (bodyStyle.perspectiveProperty === undefined &amp;&amp; bodyStyle.MozPerspective === undefined) _.animType = false;
    }
    if (bodyStyle.webkitTransform !== undefined) {
      _.animType = 'webkitTransform';
      _.transformType = '-webkit-transform';
      _.transitionType = 'webkitTransition';
      if (bodyStyle.perspectiveProperty === undefined &amp;&amp; bodyStyle.webkitPerspective === undefined) _.animType = false;
    }
    if (bodyStyle.msTransform !== undefined) {
      _.animType = 'msTransform';
      _.transformType = '-ms-transform';
      _.transitionType = 'msTransition';
      if (bodyStyle.msTransform === undefined) _.animType = false;
    }
    if (bodyStyle.transform !== undefined &amp;&amp; _.animType !== false) {
      _.animType = 'transform';
      _.transformType = 'transform';
      _.transitionType = 'transition';
    }
    _.transformsEnabled = _.options.useTransform &amp;&amp; (_.animType !== null &amp;&amp; _.animType !== false);
  };


  Slick.prototype.setSlideClasses = function (index) {

    var _ = this,
      centerOffset, allSlides, indexOffset, remainder;

    allSlides = _.$slider
      .find('.slick-slide')
      .removeClass('slick-active slick-center slick-current')
      .attr('aria-hidden', 'true')
      .attr('aria-label', function () {
        return $(this).attr('aria-label').replace(' (centered)', '');
      });

    _.$slides
      .eq(index)
      .addClass('slick-current');

    if (_.options.centerMode === true) {

      var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;

      centerOffset = Math.floor(_.options.slidesToShow / 2);

      if (_.options.infinite === true) {

        if (index &gt;= centerOffset &amp;&amp; index &lt;= (_.slideCount - 1) - centerOffset) {
          _.$slides
            .slice(index - centerOffset + evenCoef, index + centerOffset + 1)
            .addClass('slick-active')
            .removeAttr('aria-hidden');

        } else {

          indexOffset = _.options.slidesToShow + index;
          allSlides
            .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2)
            .addClass('slick-active')
            .removeAttr('aria-hidden');

        }

        if (index === 0) {

          allSlides
            .eq(_.options.slidesToShow + _.slideCount + 1)
            .addClass('slick-center')
            .attr('aria-label', function () {
              return $(this).attr('aria-label') + ' (centered)';
            });

        } else if (index === _.slideCount - 1) {

          allSlides
            .eq(_.options.slidesToShow)
            .addClass('slick-center')
            .attr('aria-label', function () {
              return $(this).attr('aria-label') + ' (centered)';
            });

        }

      }

      _.$slides
        .eq(index)
        .addClass('slick-center')
        .attr('aria-label', function () {
          return $(this).attr('aria-label') + ' (centered)';
        });

    } else {

      if (index &gt;= 0 &amp;&amp; index &lt;= (_.slideCount - _.options.slidesToShow)) {

        _.$slides
          .slice(index, index + _.options.slidesToShow)
          .addClass('slick-active')
          .removeAttr('aria-hidden');

      } else if (allSlides.length &lt;= _.options.slidesToShow) {

        allSlides
          .addClass('slick-active')
          .removeAttr('aria-hidden');

      } else {

        remainder = _.slideCount % _.options.slidesToShow;
        indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;

        if (_.options.slidesToShow == _.options.slidesToScroll &amp;&amp; (_.slideCount - index) &lt; _.options.slidesToShow) {

          allSlides
            .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
            .addClass('slick-active')
            .removeAttr('aria-hidden');

        } else {

          allSlides
            .slice(indexOffset, indexOffset + _.options.slidesToShow)
            .addClass('slick-active')
            .removeAttr('aria-hidden');

        }

      }

    }

    if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') {
      _.lazyLoad();
    }
  };

  Slick.prototype.setupInfinite = function () {

    var _ = this,
      i, slideIndex, infiniteCount;

    if (_.options.fade === true) {
      _.options.centerMode = false;
    }

    if (_.options.infinite === true &amp;&amp; _.options.fade === false) {

      slideIndex = null;

      if (_.slideCount &gt; _.options.slidesToShow) {

        if (_.options.centerMode === true) {
          infiniteCount = _.options.slidesToShow + 1;
        } else {
          infiniteCount = _.options.slidesToShow;
        }

        for (i = _.slideCount; i &gt; (_.slideCount -
          infiniteCount); i -= 1) {
          slideIndex = i - 1;
          $(_.$slides[slideIndex]).clone(true).attr('id', '')
            .attr('data-slick-index', slideIndex - _.slideCount)
            .prependTo(_.$slideTrack).addClass('slick-cloned');
        }
        for (i = 0; i &lt; infiniteCount + _.slideCount; i += 1) {
          slideIndex = i;
          $(_.$slides[slideIndex]).clone(true).attr('id', '')
            .attr('data-slick-index', slideIndex + _.slideCount)
            .appendTo(_.$slideTrack).addClass('slick-cloned');
        }
        _.$slideTrack.find('.slick-cloned').find('[id]').each(function () {
          $(this).attr('id', '');
        });

      }

    }

  };

  Slick.prototype.interrupt = function (toggle) {

    var _ = this;

    if (!toggle) {
      _.autoPlay();
    }
    _.interrupted = toggle;

  };

  Slick.prototype.selectHandler = function (event) {

    var _ = this;

    var targetElement =
      $(event.target).is('.slick-slide') ?
        $(event.target) :
        $(event.target).parents('.slick-slide');

    var index = parseInt(targetElement.attr('data-slick-index'));

    if (!index) index = 0;

    if (_.slideCount &lt;= _.options.slidesToShow) {

      _.slideHandler(index, false, true);
      return;

    }

    _.slideHandler(index);

  };

  Slick.prototype.slideHandler = function (index, sync, dontAnimate) {

    var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
      _ = this, navTarget;

    sync = sync || false;

    if (_.animating === true &amp;&amp; _.options.waitForAnimate === true) {
      return;
    }

    if (_.options.fade === true &amp;&amp; _.currentSlide === index) {
      return;
    }

    if (sync === false) {
      _.asNavFor(index);
    }

    targetSlide = index;
    targetLeft = _.getLeft(targetSlide);
    slideLeft = _.getLeft(_.currentSlide);

    _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;

    if (_.options.infinite === false &amp;&amp; _.options.centerMode === false &amp;&amp; (index &lt; 0 || index &gt; _.getDotCount() * _.options.slidesToScroll)) {
      if (_.options.fade === false) {
        targetSlide = _.currentSlide;
        if (dontAnimate !== true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
          _.animateSlide(slideLeft, function () {
            _.postSlide(targetSlide);
          });
        } else {
          _.postSlide(targetSlide);
        }
      }
      return;
    } else if (_.options.infinite === false &amp;&amp; _.options.centerMode === true &amp;&amp; (index &lt; 0 || index &gt; (_.slideCount - _.options.slidesToScroll))) {
      if (_.options.fade === false) {
        targetSlide = _.currentSlide;
        if (dontAnimate !== true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
          _.animateSlide(slideLeft, function () {
            _.postSlide(targetSlide);
          });
        } else {
          _.postSlide(targetSlide);
        }
      }
      return;
    }

    if (_.options.autoplay) {
      clearInterval(_.autoPlayTimer);
    }

    if (targetSlide &lt; 0) {
      if (_.slideCount % _.options.slidesToScroll !== 0) {
        animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
      } else {
        animSlide = _.slideCount + targetSlide;
      }
    } else if (targetSlide &gt;= _.slideCount) {
      if (_.slideCount % _.options.slidesToScroll !== 0) {
        animSlide = 0;
      } else {
        animSlide = targetSlide - _.slideCount;
      }
    } else {
      animSlide = targetSlide;
    }

    _.animating = true;

    _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);

    oldSlide = _.currentSlide;
    _.currentSlide = animSlide;

    _.setSlideClasses(_.currentSlide);

    if (_.options.asNavFor) {

      navTarget = _.getNavTarget();
      navTarget = navTarget.slick('getSlick');

      if (navTarget.slideCount &lt;= navTarget.options.slidesToShow) {
        navTarget.setSlideClasses(_.currentSlide);
      }

    }

    _.updateDots();
    _.updateArrows();

    if (_.options.fade === true) {
      if (dontAnimate !== true) {

        _.fadeSlideOut(oldSlide);

        _.fadeSlide(animSlide, function () {
          _.postSlide(animSlide);
        });

      } else {
        _.postSlide(animSlide);
      }
      _.animateHeight();
      return;
    }

    if (dontAnimate !== true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {
      _.animateSlide(targetLeft, function () {
        _.postSlide(animSlide);
      });
    } else {
      _.postSlide(animSlide);
    }

  };

  Slick.prototype.startLoad = function () {

    var _ = this;

    if (_.options.arrows === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      _.$prevArrow.hide();
      _.$nextArrow.hide();

    }

    if (_.options.dots === true &amp;&amp; _.slideCount &gt; _.options.slidesToShow) {

      _.$dots.hide();

    }

    _.$slider.addClass('slick-loading');

  };

  Slick.prototype.swipeDirection = function () {

    var xDist, yDist, r, swipeAngle, _ = this;

    xDist = _.touchObject.startX - _.touchObject.curX;
    yDist = _.touchObject.startY - _.touchObject.curY;
    r = Math.atan2(yDist, xDist);

    swipeAngle = Math.round(r * 180 / Math.PI);
    if (swipeAngle &lt; 0) {
      swipeAngle = 360 - Math.abs(swipeAngle);
    }

    if ((swipeAngle &lt;= 45) &amp;&amp; (swipeAngle &gt;= 0)) {
      return (_.options.rtl === false ? 'left' : 'right');
    }
    if ((swipeAngle &lt;= 360) &amp;&amp; (swipeAngle &gt;= 315)) {
      return (_.options.rtl === false ? 'left' : 'right');
    }
    if ((swipeAngle &gt;= 135) &amp;&amp; (swipeAngle &lt;= 225)) {
      return (_.options.rtl === false ? 'right' : 'left');
    }
    if (_.options.verticalSwiping === true) {
      if ((swipeAngle &gt;= 35) &amp;&amp; (swipeAngle &lt;= 135)) {
        return 'down';
      } else {
        return 'up';
      }
    }

    return 'vertical';

  };

  Slick.prototype.swipeEnd = function (event) {

    var _ = this,
      slideCount,
      direction;

    _.dragging = false;
    _.swiping = false;

    if (_.scrolling) {
      _.scrolling = false;
      return false;
    }

    _.interrupted = false;
    _.shouldClick = (_.touchObject.swipeLength &gt; 10) ? false : true;

    if (_.touchObject.curX === undefined) {
      return false;
    }

    if (_.touchObject.edgeHit === true) {
      _.$slider.trigger('edge', [_, _.swipeDirection()]);
    }

    if (_.touchObject.swipeLength &gt;= _.touchObject.minSwipe) {

      direction = _.swipeDirection();

      switch (direction) {

        case 'left':
        case 'down':

          slideCount =
            _.options.swipeToSlide ?
              _.checkNavigable(_.currentSlide + _.getSlideCount()) :
              _.currentSlide + _.getSlideCount();

          _.currentDirection = 0;

          break;

        case 'right':
        case 'up':

          slideCount =
            _.options.swipeToSlide ?
              _.checkNavigable(_.currentSlide - _.getSlideCount()) :
              _.currentSlide - _.getSlideCount();

          _.currentDirection = 1;

          break;

        default:


      }

      if (direction != 'vertical') {

        _.slideHandler(slideCount);
        _.touchObject = {};
        _.$slider.trigger('swipe', [_, direction]);

      }

    } else {

      if (_.touchObject.startX !== _.touchObject.curX) {

        _.slideHandler(_.currentSlide);
        _.touchObject = {};

      }

    }

  };

  Slick.prototype.swipeHandler = function (event) {

    var _ = this;

    if ((_.options.swipe === false) || ('ontouchend' in document &amp;&amp; _.options.swipe === false)) {
      return;
    } else if (_.options.draggable === false &amp;&amp; event.type.indexOf('mouse') !== -1) {
      return;
    }

    _.touchObject.fingerCount = event.originalEvent &amp;&amp; event.originalEvent.touches !== undefined ?
      event.originalEvent.touches.length : 1;

    _.touchObject.minSwipe = _.listWidth / _.options
      .touchThreshold;

    if (_.options.verticalSwiping === true) {
      _.touchObject.minSwipe = _.listHeight / _.options
        .touchThreshold;
    }

    switch (event.data.action) {

      case 'start':
        _.swipeStart(event);
        break;

      case 'move':
        _.swipeMove(event);
        break;

      case 'end':
        _.swipeEnd(event);
        break;

    }

  };

  Slick.prototype.swipeMove = function (event) {

    var _ = this,
      edgeWasHit = false,
      curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength;

    touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;

    if (!_.dragging || _.scrolling || touches &amp;&amp; touches.length !== 1) {
      return false;
    }

    curLeft = _.getLeft(_.currentSlide);

    _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
    _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;

    _.touchObject.swipeLength = Math.round(Math.sqrt(
      Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));

    verticalSwipeLength = Math.round(Math.sqrt(
      Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));

    if (!_.options.verticalSwiping &amp;&amp; !_.swiping &amp;&amp; verticalSwipeLength &gt; 4) {
      _.scrolling = true;
      return false;
    }

    if (_.options.verticalSwiping === true) {
      _.touchObject.swipeLength = verticalSwipeLength;
    }

    swipeDirection = _.swipeDirection();

    if (event.originalEvent !== undefined &amp;&amp; _.touchObject.swipeLength &gt; 4) {
      _.swiping = true;
      // https://stackoverflow.com/questions/73239325/unable-to-preventdefault-inside-passive-event-listener-invocation
      // event.preventDefault();
    }

    positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX &gt; _.touchObject.startX ? 1 : -1);
    if (_.options.verticalSwiping === true) {
      positionOffset = _.touchObject.curY &gt; _.touchObject.startY ? 1 : -1;
    }


    swipeLength = _.touchObject.swipeLength;

    _.touchObject.edgeHit = false;

    if (_.options.infinite === false) {
      if ((_.currentSlide === 0 &amp;&amp; swipeDirection === 'right') || (_.currentSlide &gt;= _.getDotCount() &amp;&amp; swipeDirection === 'left')) {
        swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
        _.touchObject.edgeHit = true;
      }
    }

    if (_.options.vertical === false) {
      _.swipeLeft = curLeft + swipeLength * positionOffset;
    } else {
      _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
    }
    if (_.options.verticalSwiping === true) {
      _.swipeLeft = curLeft + swipeLength * positionOffset;
    }

    if (_.options.fade === true || _.options.touchMove === false) {
      return false;
    }

    if (_.animating === true) {
      _.swipeLeft = null;
      return false;
    }

    _.setCSS(_.swipeLeft);

  };

  Slick.prototype.swipeStart = function (event) {

    var _ = this,
      touches;

    _.interrupted = true;

    if (_.touchObject.fingerCount !== 1 || _.slideCount &lt;= _.options.slidesToShow) {
      _.touchObject = {};
      return false;
    }

    if (event.originalEvent !== undefined &amp;&amp; event.originalEvent.touches !== undefined) {
      touches = event.originalEvent.touches[0];
    }

    _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
    _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;

    _.dragging = true;

  };

  Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function () {

    var _ = this;

    if (_.$slidesCache !== null) {

      _.unload();

      _.$slideTrack.children(this.options.slide).detach();

      _.$slidesCache.appendTo(_.$slideTrack);

      _.reinit();

    }

  };

  Slick.prototype.unload = function () {

    var _ = this;

    $('.slick-cloned', _.$slider).remove();

    if (_.$dots) {
      _.$dots.remove();
    }

    if (_.$prevArrow &amp;&amp; _.htmlExpr.test(_.options.prevArrow)) {
      _.$prevArrow.remove();
    }

    if (_.$nextArrow &amp;&amp; _.htmlExpr.test(_.options.nextArrow)) {
      _.$nextArrow.remove();
    }

    _.$slides
      .removeClass('slick-slide slick-active slick-visible slick-current')
      .attr('aria-hidden', 'true')
      .css('width', '');

  };

  Slick.prototype.unslick = function (fromBreakpoint) {

    var _ = this;
    _.$slider.trigger('unslick', [_, fromBreakpoint]);
    _.destroy();

  };

  Slick.prototype.updateArrows = function () {

    var _ = this,
      centerOffset;

    centerOffset = Math.floor(_.options.slidesToShow / 2);

    if (_.options.arrows === true &amp;&amp;
      _.slideCount &gt; _.options.slidesToShow &amp;&amp;
      !_.options.infinite) {

      _.$prevArrow.removeClass('slick-disabled').prop('disabled', false);
      _.$nextArrow.removeClass('slick-disabled').prop('disabled', false);

      if (_.currentSlide === 0) {

        _.$prevArrow.addClass('slick-disabled').prop('disabled', true);
        _.$nextArrow.removeClass('slick-disabled').prop('disabled', false);

      } else if (_.currentSlide &gt;= _.slideCount - _.options.slidesToShow &amp;&amp; _.options.centerMode === false) {

        _.$nextArrow.addClass('slick-disabled').prop('disabled', true);
        _.$prevArrow.removeClass('slick-disabled').prop('disabled', false);

      } else if (_.currentSlide &gt;= _.slideCount - 1 &amp;&amp; _.options.centerMode === true) {

        _.$nextArrow.addClass('slick-disabled').prop('disabled', true);
        _.$prevArrow.removeClass('slick-disabled').prop('disabled', false);

      }

    }

  };

  Slick.prototype.updateDots = function () {

    var _ = this;

    if (_.$dots !== null) {

      _.$dots
        .find('li')
        .removeClass('slick-active')
        .find('button')
        .removeAttr('aria-current')
        .end()
        .end();

      _.$dots
        .find('li')
        .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
        .addClass('slick-active')
        .find('button')
        .attr('aria-current', true)
        .end()
        .end();

    }

  };

  Slick.prototype.updateSlideVisibility = function () {
    var _ = this;

    _.$slideTrack
      .find('.slick-slide')
      .attr('aria-hidden', 'true')
      .find('a, input, button, select')
      .attr('tabindex', '-1');

    _.$slideTrack
      .find('.slick-active')
      .removeAttr('aria-hidden')
      .find('a, input, button, select')
      .removeAttr('tabindex');
  }

  Slick.prototype.visibility = function () {

    var _ = this;

    if (_.options.autoplay) {

      if (document[_.hidden]) {

        _.interrupted = true;

      } else {

        _.interrupted = false;

      }

    }

  };

  $.fn.slick = function () {
    var _ = this,
      opt = arguments[0],
      args = Array.prototype.slice.call(arguments, 1),
      l = _.length,
      i,
      ret;
    for (i = 0; i &lt; l; i++) {
      if (typeof opt == 'object' || typeof opt == 'undefined')
        _[i].slick = new Slick(_[i], opt);
      else
        ret = _[i].slick[opt].apply(_[i].slick, args);
      if (typeof ret != 'undefined') return ret;
    }
    return _;
  };

}));

// Slick Inits
jQuery(function ($) {

  // Required for WCAG 2.1 issues
  function changeElementType() {
    $.fn.changeElementType = function (newType) {
      var attrs = {};

      $.each(this[0].attributes, function (idx, attr) {
        attrs[attr.nodeName] = attr.nodeValue;
      });

      this.replaceWith(function () {
        return $("&lt;" + newType + "/&gt;", attrs).append($(this).contents());
      });
    }
  }

  changeElementType();

  $(".regular").slick({
    dots: true,
    infinite: true,
    speed: 700,
    autoplay: false,
    autoplaySpeed: 2000,
    arrows: true,
    adaptiveHeight: false,
    slidesToShow: 1,
    slidesToScroll: 1
  });

  $('.catlist').slick({
    arrows: true,
    dots: false,
    infinite: false,
    slidesPerRow: 5,
    rows: 2,
    responsive: [
      {
        breakpoint: 580,
        settings: {
          slidesPerRow: 2,
          rows: 3,
          infinite: true,
          arrows: false,
          dots: true
        }
      }
    ]
  });

  if ($("div").hasClass("catlist")) {
    $(".catlist .slick-slide &gt; div").changeElementType("ul");
  }

  if (window.matchMedia("(max-width: 580px)").matches) {
    $('.responsive').slick({
      arrows: false,
      dots: false,
      infinite: false,
      slidesToShow: 1.25,
      slidesToScroll: 1
    });
  }

  $('.fade').slick({
    dots: true,
    infinite: true,
    speed: 500,
    fade: true,
    cssEase: 'linear'
  });

  // slider synching
  $('.slider-for').slick({
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: true,
    dots: true,
    fade: true,
    // asNavFor: '.slider-nav',
    instructionsText: 'Changing this current slide of this carousel will change the current slide of the thumbnail carousel that follows.',
    regionLabel: 'main image carousel'
  });
  $('.slider-nav').slick({
    slidesToShow: 7,
    slidesToScroll: 1,
    asNavFor: '.slider-for',
    arrows: true,
    dots: false,
    centerMode: true,
    // focusOnSelect: true, // no longer supported
    variableWidth: true,
    instructionsText: 'Changing the current slide of this carousel will change the current slide of the preceding main image carousel.',
    regionLabel: 'thumbnail carousel'
  });

  $('.single-item').slick({
    centerMode: true,
    centerPadding: '60px',
  });

  $(".variable").slick({
    dots: true,
    infinite: true,
    variableWidth: true
  });

  $(".lazy").slick({
    lazyLoad: 'ondemand', // ondemand progressive anticipated
    slidesToShow: 3,
    slidesToScroll: 1,
    infinite: true
  });
});

// to consider: https://www.w3.org/WAI/ARIA/apg/patterns/carousel/

/**
 * stacktable.js
 * Author &amp; copyright (c) 2012: John Polacek
 * Dual MIT &amp; GPL license
 *
 * Page: http://johnpolacek.github.com/stacktable.js
 * Repo: https://github.com/johnpolacek/stacktable.js/
 *
 * jQuery plugin for stacking tables on small screens
 *
 */
;(function ($) {

  $.fn.stacktable = function (options) {
    var $tables = this,
      defaults = {id: 'stacktable small-only', hideOriginal: true},
      settings = $.extend({}, defaults, options);

    return $tables.each(function () {
      var $stacktable = $('&lt;table class="' + settings.id + '"&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;');
      if (typeof settings.myClass !== undefined) $stacktable.addClass(settings.myClass);
      var markup = '';
      $table = $(this);
      $table.addClass('stacktable large-only');
      $topRow = $table.find('tr').eq(0);
      $table.find('tr').each(function (index, value) {
        markup += '&lt;tr&gt;';
        // for the first row, top left table cell is the head of the table
        if (index === 0) {
          markup += '&lt;tr&gt;&lt;th class="st-head-row st-head-row-main" colspan="2"&gt;' + $(this).find('th,td').eq(0).html() + '&lt;/th&gt;&lt;/tr&gt;';
        }
          // for the other rows, put the left table cell as the head for that row
        // then iterate through the key/values
        else {
          $(this).find('td,th').each(function (index, value) {
            if (index === 0) {
              markup += '&lt;tr&gt;&lt;th class="st-head-row" colspan="2"&gt;' + $(this).html() + '&lt;/th&gt;&lt;/tr&gt;';
            } else {
              if ($(this).html() !== '') {
                markup += '&lt;tr&gt;';
                if ($topRow.find('td,th').eq(index).html()) {
                  markup += '&lt;td class="st-key"&gt;' + $topRow.find('td,th').eq(index).html() + '&lt;/td&gt;';
                } else {
                  markup += '&lt;td class="st-key"&gt;&lt;/td&gt;';
                }
                markup += '&lt;td class="st-val"&gt;' + $(this).html() + '&lt;/td&gt;';
                markup += '&lt;/tr&gt;';
              }
            }
          });
        }
      });
      $stacktable.append($(markup));
      $table.before($stacktable);
      if (!settings.hideOriginal) $table.show();
    });
  };


  $.fn.stackcolumns = function (options) {
    var $tables = this,
      defaults = {id: 'stacktable small-only', hideOriginal: true},
      settings = $.extend({}, defaults, options);

    return $tables.each(function () {
      $table = $(this);
      var num_cols = $table.find('tr').eq(0).find('td,th').length; //first table &lt;tr&gt; must not contain colspans, or add sum(colspan-1) here.
      if (num_cols &lt; 3) //stackcolumns has no effect on tables with less than 3 columns
        return;

      var $stackcolumns = $('&lt;table class="' + settings.id + '"&gt;&lt;/table&gt;');
      if (typeof settings.myClass !== undefined) $stackcolumns.addClass(settings.myClass);
      $table.addClass('stacktable large-only');
      var tb = $('&lt;tbody&gt;&lt;/tbody&gt;');
      var col_i = 1; //col index starts at 0 -&gt; start copy at second column.

      while (col_i &lt; num_cols) {
        $table.find('tr').each(function (index, value) {
          var tem = $('&lt;tr&gt;&lt;/tr&gt;'); // todo opt. copy styles of $this; todo check if parent is thead or tfoot to handle accordingly
          if (index == 0) tem.addClass("st-head-row st-head-row-main");
          first = $(this).find('td,th').eq(0).clone().addClass("st-key");
          var target = col_i;
          // if colspan apply, recompute target for second cell.
          if ($(this).find("*[colspan]").length) {
            var i = 0;
            $(this).find('td,th').each(function (index, value) {
              var cs = $(this).attr("colspan");
              if (cs) {
                cs = parseInt(cs, 10);
                target -= cs - 1;
                if ((i + cs) &gt; (col_i)) //out of current bounds
                  target += i + cs - col_i - 1;
                i += cs;
              } else
                i++;

              if (i &gt; col_i)
                return false; //target is set; break.
            });
          }
          second = $(this).find('td,th').eq(target).clone().addClass("st-val").removeAttr("colspan");
          tem.append(first, second);
          tb.append(tem);
        });
        ++col_i;
      }

      $stackcolumns.append($(tb));
      $table.before($stackcolumns);
      if (!(settings.hideOriginal)) {
        $table.show();
      }
    });
  };

}(jQuery));

window.addEventListener("DOMContentLoaded", () =&gt; {

  if (document.querySelector('[role="tablist"]')) {
  // Only handle one particular tablist; if you have multiple tab
  // lists (might even be nested), you have to apply this code for each one
  const tabList = document.querySelector('[role="tablist"]');
  const tabs = tabList.querySelectorAll(':scope &gt; [role="tab"]');

  // Add a click event handler to each tab
  tabs.forEach((tab) =&gt; {
    tab.addEventListener("click", changeTabs);
  });

  // Enable arrow navigation between tabs in the tab list
  let tabFocus = 0;

  tabList.addEventListener("keydown", (e) =&gt; {
    // Move right
    if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
      tabs[tabFocus].setAttribute("tabindex", -1);
      if (e.key === "ArrowRight") {
        tabFocus++;
        // If we're at the end, go to the start
        if (tabFocus &gt;= tabs.length) {
          tabFocus = 0;
        }
        // Move left
      } else if (e.key === "ArrowLeft") {
        tabFocus--;
        // If we're at the start, move to the end
        if (tabFocus &lt; 0) {
          tabFocus = tabs.length - 1;
        }
      }

      tabs[tabFocus].setAttribute("tabindex", 0);
      tabs[tabFocus].focus();
    }
  });

  }
});

function changeTabs(e) {
  const targetTab = e.target;
  const tabList = targetTab.parentNode;
  const tabGroup = tabList.parentNode;

  // Remove all current selected tabs
  tabList
    .querySelectorAll(':scope &gt; [aria-selected="true"]')
    .forEach((t) =&gt; t.setAttribute("aria-selected", false));

  // Set this tab as selected
  targetTab.setAttribute("aria-selected", true);

  // Hide all tab panels
  tabGroup
    .querySelectorAll(':scope &gt; [role="tabpanel"]')
    .forEach((p) =&gt; p.setAttribute("hidden", true));

  // Show the selected panel
  tabGroup
    .querySelector(`#${targetTab.getAttribute("aria-controls")}`)
    .removeAttribute("hidden");
}

// Put all your code in your document ready area
jQuery(document).ready(function ($) {
  // let show = 0;

  // Scroll adds class
  function scrollClass() {
    const header = $(".header-outer");

    $(window).scroll(function () {
      if ($(this).scrollTop() &gt; 100) {
        header.addClass('outer-small');
      } else {
        //back to default styles
        header.removeClass("outer-small");
      }
    });
  }

  scrollClass();

  // Overlays
  function overlay() {
    $('.button-group.default button, .searchLink').click(function (event) {

      event.preventDefault();
      const el = $(this);
      const data = $(this).data('target');
      target = el.attr('href');

      // Open target
      // $('html').toggleClass('show-' + data);
      $('body').toggleClass('fixed');

      // Focus trap
      $('body *').not('body .overlay, body .overlay *').attr('tabindex', '-1');

      // Condition navigation
      if (data === 'navigation') {
        $('html').removeClass('show-search, .show-login');
        $('.overlay.search, .overlay.login').removeClass('show');
        $('.overlay.navigation').addClass('show');
      }

      // Condition login
      if (data === 'login') {
        $('html').removeClass('show-search, .show-navigation');
        $('.overlay.search, .overlay.navigation').removeClass('show');
        $('.button.navigation, .button.search').removeClass('active');
        $('.overlay.login').addClass('show');
      }

      // Condition search
      if (data === 'search') {
        $('html').removeClass('show-navigation, .show-login');
        $('.overlay.navigation, .overlay.login').removeClass('show');
        $('.button.navigation, .button.login').removeClass('active');
        $('.overlay.search').addClass('show');

        setTimeout(function () {
          $('.' + data).find('#tx-solr-q').focus();
        }, 250);
      }
    });
  }

  overlay();

  // Close overlays
  function closeOverlay() {
    $('.overlay button.close').click(function () {

      $('html').removeClass('show-search, .show-navigation, .show-login');
      $('body').removeClass('fixed');
      $('body *').removeAttr('tabindex');
      $('.overlay').removeClass('show');

    });
  }

  closeOverlay();

  // Foldables footer
  function foldableFooter() {
    // Cache the selectors
    const $footerFoldable = $('.footer-foldable');
    const $flexElements = $footerFoldable.next('.flex');

    // Add 'foldout' class to the next sibling flex elements
    $flexElements.addClass('foldout');

    // Toggle visibility of flex elements that do not have the 'foldout' class
    $footerFoldable.find('.flex').not('.foldout').toggle();

    // Delegate the click event to handle dynamically added elements
    $(document).on('click', '.footer-foldable', function () {
      const $this = $(this);
      $this.next('.foldout').toggleClass('active');
      $this.toggleClass('open');
    });
  }

  foldableFooter();

  // Alertbox
  function alertBox() {
    $('.alertbox .close').click(function () {
      $('#alert').remove();

      localStorage.setItem('alert', true);
      return false;
    });

    if (localStorage.getItem('alert') === null) {
      $('#alert').addClass('active');
      $('body').addClass('hasAlert');
    }

    if (localStorage.hasOwnProperty('alert')) {
      $('#alert').remove();
    }
  }

  alertBox();

  // FAQ
  function faq() {
    $('.jpfaqList .toggleTrigger').click(function () {

      $(this).parent('dt').next('.toggleTriggerContainer').toggle();
      $(this).toggleClass('active');

      return false;
    });

  }

  faq();


  //:: CONTRAST
  function setContrast() {

    let toggle = document.querySelector('.toggle-contrast');

    $('&lt;span class="label"&gt;Contrast&lt;/span&gt;').appendTo('.toggle-contrast');

    // Turn the theme off if the 'contrast' key exists in localStorage
    if (localStorage.getItem('contrast')) {
      document.body.classList.add('contrast');
      // toggle.inner = 'Contrast uit';
      // $('.toggle-contrast span').html("uit");
    }

    toggle.addEventListener('click', function (e) {
      e.preventDefault();

      if (document.body.classList.contains('contrast')) {
        document.body.classList.remove('contrast');
        localStorage.removeItem('contrast');
        // $('.toggle-theme span').html("aan");

      } else {
        document.body.classList.add('contrast');
        localStorage.setItem('contrast', true);
        // $('.toggle-theme span').html("uit");
      }
    });

  }

  setContrast();

  // :: NAVIGATION
  // Open menu //////////////////////////////
  function openMenu() {
    $(".button-menu, .button-search").on('click', function () {
      // Toggle the 'fixed' class on the body element
      $('body').toggleClass('fixed');

      // Toggle the 'open' class on the button-menu element
      $('.button-menu').toggleClass('open');

      // Update the text within the clicked element's span
      $(this).children('span').text(function (i, text) {
        return text === "Navigatie is geopend" ? "Navigatie is gesloten" : "Navigatie is geopend";
      });

      // Toggle visibility and 'open' class on the nav-main element
      $('.nav-main').toggle().toggleClass('open');

      // Prevent default action
      return false;
    });
  }

  openMenu();


  // Scroll to target

  // $('html, body').animate({
  //   scrollTop: $("#content").offset().top - 100 // Means Less header height
  // }, 400);

  function targetScroll() {
    // Select all links with hashes except those with data-toggle="collapse"
    $('a[href*="#"]:not([data-toggle="collapse"])')
      // Remove links that don't actually link to anything
      .not('[href="#"], [href="#0"]')
      .on('click', function (event) {
        // Check if the link is an on-page link
        if (
          location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') &amp;&amp;
          location.hostname === this.hostname
        ) {
          // Determine the target element to scroll to
          let target = $(this.hash);
          target = target.length ? target : $(`[name=${this.hash.slice(1)}]`);

          // Check if the target exists
          if (target.length) {
            // Prevent default if the animation is going to happen
            event.preventDefault();

            // Animate scrolling to the target element
            $('html, body').animate({
              scrollTop: target.offset().top - 195
            }, 100, function () {
              // Callback after animation, ensure focus on target element
              const $target = $(target);
              $target.focus();

              if (!$target.is(":focus")) { // Checking if the target was focused
                $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
                $target.focus(); // Set focus again
              }
            });
          }
        }
      });
  }

  targetScroll();


  //:: TABLES
  function tables() {
    // Cache the selectors
    const $tables = $('table');
    const $tableRows = $('tr');

    // Remove obsolete table classes
    $tables.removeClass('ce-table');

    // Add zebra style to odd table rows
    $tableRows.filter(':odd').addClass('odd');

    // Add class mobilized to tables with more than 4 columns
    $tableRows.each(function () {
      if ($(this).find('td').length &gt;= 4) {
        $(this).addClass('large-row');
      }
    });

    // Add mobilized class to tables containing rows with more than 4 columns
    $('tr.large-row').closest('table').addClass('mobilized');

    // Make tables responsive
    $tables.each(function () {
      const $table = $(this);

      // Replace non-breaking spaces with regular spaces in table headers and data cells
      $table.find('th, td').html(function (_, html) {
        return html.replace(/&amp;nbsp;/g, ' ');
      });

      // Get table headings
      const headings = $table.find('thead th').map(function () {
        return $(this).text();
      }).get();

      // Add data-title attributes to table data cells based on the headings
      if (headings.length &gt; 0) {
        $table.find('tbody td, tfoot td').each(function (index) {
          $(this).attr('data-title', headings[index % headings.length]);
        });
      }
    });
  }

  tables();

  // Open / Close filters
  function jobFair() {
    $('.tx_jobfair_filter_item .control-label').click(function () {
      $(this).toggleClass('active');
      $(this).next('.tx_jobfair-filter-content').toggleClass('active');
    });
  }

  jobFair();


  // MIXED BAG

  // open - close sub nav
  $('li span.fa').click(function () {
    $(this).toggleClass('fa-caret-up');
    $(this).prev('ul.dropdown-menu.multi-level').toggle();
    return false;
  });

  // Specialists
  $('.tx-pn-listfeusers').prev('h2').addClass('special');

  // open PDF in new window /////////////////
  $('a[href*=".pdf"]').attr('target', 'new window');
});
</pre></body></html>