PageSourceSearch

https://www.pref.cz/assets/theme/js/script.js

js pref.cz collected 2026-10-08 12:06:00 UTC 49,698 bytes, 1,117 lines download raw bytes

1(function($) {
2        var isBuilder = $('html').hasClass('is-builder');
3
4        $.extend($.easing, {
5            easeInOutCubic: function(x, t, b, c, d) {
6                if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
7                return c / 2 * ((t -= 2) * t * t + 2) + b;
8            }
9        });
10
11        $.fn.outerFind = function(selector) {
12            return this.find(selector).addBack(selector);
13        };
14
15        $.fn.scrollEnd = function(callback, timeout) {
16            $(this).scroll(function(){
17                var $this = $(this);
18                if ($this.data('scrollTimeout')) {
19                    clearTimeout($this.data('scrollTimeout'));
20                }
21                $this.data('scrollTimeout', setTimeout(callback,timeout));
22            });
23        };
24
25        $.fn.footerReveal = function() {
26            var $this = $(this);
27            var $prev = $this.prev();
28            var $win = $(window);
29            var isIE = !!document.documentMode;
30
31            function initReveal() {
32                if (!isIE && $this.outerHeight() <= $win.outerHeight()) {
33                    $this.css({
34                        'z-index': -999,
35                        position: 'fixed',
36                        bottom: 0
37                    });
38
39                    $this.css({
40                        'width': $prev.outerWidth()
41                    });
42
43                    $prev.css({
44                        'margin-bottom': $this.outerHeight()
45                    });
46                } else {
47                    $this.css({
48                        'z-index': '',
49                        position: '',
50                        bottom: ''
51                    });
52
53                    $this.css({
54                        'width': ''
55                    });
56
57                    $prev.css({
58                        'margin-bottom': ''
59                    });
60                }
61            }
62
63            initReveal();
64
65            $win.on('load resize', function() {
66                initReveal();
67            });
68
69            return this;
70        };
71
72        (function($, sr) {
73            // debouncing function from John Hann
74            // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
75            var debounce = function(func, threshold, execAsap) {
76                var timeout;
77
78                return function debounced() {
79                    var obj = this,
80                        args = arguments;
81
82                    function delayed() {
83                        if (!execAsap) func.apply(obj, args);
84                        timeout = null;
85                    }
86
87                    if (timeout) clearTimeout(timeout);
88                    else if (execAsap) func.apply(obj, args);
89
90                    timeout = setTimeout(delayed, threshold || 100);
91                };
92            };
93            // smartresize
94            jQuery.fn[sr] = function(fn) {
95                return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
96            };
97
98        })(jQuery, 'smartresize');
99
100        (function() {
101
102            var scrollbarWidth = 0,
103                originalMargin, touchHandler = function(event) {
104                    event.preventDefault();
105                };
106
107            function getScrollbarWidth() {
108                if (scrollbarWidth) return scrollbarWidth;
109                var scrollDiv = document.createElement('div');
110                $.each({
111                    top: '-9999px',
112                    width: '50px',
113                    height: '50px',
114                    overflow: 'scroll',
115                    position: 'absolute'
116                }, function(property, value) {
117                    scrollDiv.style[property] = value;
118                });
119                $('body').append(scrollDiv);
120                scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
121                $('body')[0].removeChild(scrollDiv);
122                return scrollbarWidth;
123            }
124
125        })();
126
127        $.isMobile = function(type) {
128            var reg = [];
129            var any = {
130                blackberry: 'BlackBerry',
131                android: 'Android',
132                windows: 'IEMobile',
133                opera: 'Opera Mini',
134                ios: 'iPhone|iPad|iPod'
135            };
136            type = 'undefined' == $.type(type) ? '*' : type.toLowerCase();
137            if ('*' == type) reg = $.map(any, function(v) {
138                return v;
139            });
140            else if (type in any) reg.push(any[type]);
141            return !!(reg.length && navigator.userAgent.match(new RegExp(reg.join('|'), 'i')));
142        };
143
144        var isSupportViewportUnits = (function() {
145            // modernizr implementation
146            var $elem = $('<div style="height: 50vh; position: absolute; top: -1000px; left: -1000px;">').appendTo('body');
147            var elem = $elem[0];
148            var height = parseInt(window.innerHeight / 2, 10);
149            var compStyle = parseInt((window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle)['height'], 10);
150            $elem.remove();
151            return compStyle == height;
152        }());
153
154        $(function() {
155
156            $('html').addClass($.isMobile() ? 'mobile' : 'desktop');
157
158            // .mbr-navbar--sticky
159            $(window).scroll(function() {
160                $('.mbr-navbar--sticky').each(function() {
161                    var method = $(window).scrollTop() > 10 ? 'addClass' : 'removeClass';
162                    $(this)[method]('mbr-navbar--stuck')
163                        .not('.mbr-navbar--open')[method]('mbr-navbar--short');
164                });
165            });
166
167            if ($.isMobile() && navigator.userAgent.match(/Chrome/i)) { // simple fix for Chrome's scrolling
168                (function(width, height) {
169                    var deviceSize = [width, width];
170                    deviceSize[height > width ? 0 : 1] = height;
171                    $(window).smartresize(function() {
172                        var windowHeight = $(window).height();
173                        if ($.inArray(windowHeight, deviceSize) < 0)
174                            windowHeight = deviceSize[$(window).width() > windowHeight ? 1 : 0];
175                        $('.mbr-section--full-height').css('height', windowHeight + 'px');
176                    });
177                })($(window).width(), $(window).height());
178            } else if (!isSupportViewportUnits) { // fallback for .mbr-section--full-height
179                $(window).smartresize(function() {
180                    $('.mbr-section--full-height').css('height', $(window).height() + 'px');
181                });
182                $(document).on('add.cards', function(event) {
183                    if ($('html').hasClass('mbr-site-loaded') && $(event.target).outerFind('.mbr-section--full-height').length)
184                        $(window).resize();
185                });
186            }
187
188            // .mbr-section--16by9 (16 by 9 blocks autoheight)
189            function calculate16by9() {
190                $(this).css('height', $(this).parent().width() * 9 / 16);
191            }
192            $(window).smartresize(function() {
193                $('.mbr-section--16by9').each(calculate16by9);
194            });
195            $(document).on('add.cards changeParameter.cards', function(event) {
196                var enabled = $(event.target).outerFind('.mbr-section--16by9');
197                if (enabled.length) {
198                    enabled
199                        .attr('data-16by9', 'true')
200                        .each(calculate16by9);
201                } else {
202                    $(event.target).outerFind('[data-16by9]')
203                        .css('height', '')
204                        .removeAttr('data-16by9');
205                }
206            });
207
208            // .mbr-parallax-background
209            function initParallax(card) {
210                setTimeout(function() {
211                    $(card).outerFind('.mbr-parallax-background')
212                        .jarallax({
213                            speed: 0.6
214                        })
215                        .css('position', 'relative');
216                }, 0);
217            }
218
219            function destroyParallax(card) {
220                $(card).jarallax('destroy').css('position', '');
221            }
222
223            if ($.fn.jarallax && !$.isMobile()) {
224                $(window).on('update.parallax', function(event) {
225                    setTimeout(function() {
226                        var $jarallax = $('.mbr-parallax-background');
227
228                        $jarallax.jarallax('coverImage');
229                        $jarallax.jarallax('clipContainer');
230                        $jarallax.jarallax('onScroll');
231                    }, 0);
232                });
233
234                if (isBuilder) {
235                    $(document).on('add.cards', function(event) {
236                        initParallax(event.target);
237                        $(window).trigger('update.parallax');
238                    });
239
240                    $(document).on('changeParameter.cards', function(event, paramName, value, key) {
241                        if (paramName === 'bg') {
242                            destroyParallax(event.target);
243
244                            switch (key) {
245                                case 'type':
246                                    if (value.parallax === true) {
247                                        initParallax(event.target);
248                                    }
249                                    break;
250                                case 'value':
251                                    if (value.type === 'image' && value.parallax === true) {
252                                        initParallax(event.target);
253                                    }
254                                    break;
255                                case 'parallax':
256                                    if (value.parallax === true) {
257                                        initParallax(event.target);
258                                    }
259                            }
260                        }
261
262                        $(window).trigger('update.parallax');
263                    });
264                } else {
265                    initParallax(document.body);
266                }
267
268                // for Tabs
269                $(window).on('shown.bs.tab', function(e) {
270                    $(window).trigger('update.parallax');
271                });
272            }
273
274            // .mbr-fixed-top
275            var fixedTopTimeout, scrollTimeout, prevScrollTop = 0,
276                fixedTop = null,
277                isDesktop = !$.isMobile();
278            $(window).scroll(function() {
279                if (scrollTimeout) clearTimeout(scrollTimeout);
280                var scrollTop = $(window).scrollTop();
281                var scrollUp = scrollTop <= prevScrollTop || isDesktop;
282                prevScrollTop = scrollTop;
283                if (fixedTop) {
284                    var fixed = scrollTop > fixedTop.breakPoint;
285                    if (scrollUp) {
286                        if (fixed != fixedTop.fixed) {
287                            if (isDesktop) {
288                                fixedTop.fixed = fixed;
289                                $(fixedTop.elm).toggleClass('is-fixed');
290                            } else {
291                                scrollTimeout = setTimeout(function() {
292                                    fixedTop.fixed = fixed;
293                                    $(fixedTop.elm).toggleClass('is-fixed');
294                                }, 40);
295                            }
296                        }
297                    } else {
298                        fixedTop.fixed = false;
299                        $(fixedTop.elm).removeClass('is-fixed');
300                    }
301                }
302            });
303            $(document).on('add.cards delete.cards', function(event) {
304                if (fixedTopTimeout) clearTimeout(fixedTopTimeout);
305                fixedTopTimeout = setTimeout(function() {
306                    if (fixedTop) {
307                        fixedTop.fixed = false;
308                        $(fixedTop.elm).removeClass('is-fixed');
309                    }
310                    $('.mbr-fixed-top:first').each(function() {
311                        fixedTop = {
312                            breakPoint: $(this).offset().top + $(this).height() * 3,
313                            fixed: false,
314                            elm: this
315                        };
316                        $(window).scroll();
317                    });
318                }, 650);
319            });
320
321            // embedded videos
322            $(window).smartresize(function() {
323                $('.mbr-embedded-video').each(function() {
324                    $(this).height(
325                        $(this).width() *
326                        parseInt($(this).attr('height') || 315) /
327                        parseInt($(this).attr('width') || 560)
328                    );
329                });
330            });
331            $(document).on('add.cards', function(event) {
332                if ($('html').hasClass('mbr-site-loaded') && $(event.target).outerFind('iframe').length)
333                    $(window).resize();
334            });
335
336            // background video
337            function videoParser(card) {
338                $(card).outerFind('[data-bg-video]').each(function() {
339                    var videoURL = $(this).attr('data-bg-video');
340                    var parsedUrl = videoURL.match(/(http:\/\/|https:\/\/|)?(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/);
341
342                    var $img = $('<div class="mbr-background-video-preview">')
343                        .hide()
344                        .css({
345                            backgroundSize: 'cover',
346                            backgroundPosition: 'center'
347                        });
348                    $('> *:eq(0)', this).before($img);
349
350                    // youtube or vimeo
351                    if (parsedUrl && (/youtu\.?be/g.test(parsedUrl[3]) || /vimeo/g.test(parsedUrl[3]))) {
352                        // youtube
353                        if (parsedUrl && /youtu\.?be/g.test(parsedUrl[3])) {
354                            var previewURL = 'http' + ('https:' === location.protocol ? 's' : '') + ':';
355                            previewURL += '//img.youtube.com/vi/' + parsedUrl[6] + '/maxresdefault.jpg';
356
357                            $('<img>').on('load', function() {
358                                if (120 === (this.naturalWidth || this.width)) {
359                                    // selection of preview in the best quality
360                                    var file = this.src.split('/').pop();
361
362                                    switch (file) {
363                                        case 'maxresdefault.jpg':
364                                            this.src = this.src.replace(file, 'sddefault.jpg');
365                                            break;
366                                        case 'sddefault.jpg':
367                                            this.src = this.src.replace(file, 'hqdefault.jpg');
368                                            break;
369                                        default: // image not found
370                                            if (isBuilder) {
371                                                $img.css('background-image', 'url("images/no-video.jpg")')
372                                                    .show();
373                                            }
374                                    }
375                                } else {
376                                    $img.css('background-image', 'url("' + this.src + '")')
377                                        .show();
378                                }
379                            }).attr('src', previewURL);
380
381                            if ($.fn.YTPlayer && !isBuilder && !$.isMobile()) {
382                                $('> *:eq(1)', this).before('<div class="mbr-background-video"></div>').prev()
383                                    .YTPlayer({
384                                        videoURL: parsedUrl[6],
385                                        containment: 'self',
386                                        showControls: false,
387                                        mute: true
388                                    });
389                            }
390                        } else if (parsedUrl && /vimeo/g.test(parsedUrl[3])) { // vimeo
391                            var request = new XMLHttpRequest();
392                            request.open('GET', 'https://vimeo.com/api/v2/video/' + parsedUrl[6] + '.json', true);
393                            request.onreadystatechange = function() {
394                                if (this.readyState === 4) {
395                                    if (this.status >= 200 && this.status < 400) {
396                                        var response = JSON.parse(this.responseText);
397
398                                        $img.css('background-image', 'url("' + response[0].thumbnail_large + '")')
399                                            .show();
400                                    } else if (isBuilder) { // image not found
401                                        $img.css('background-image', 'url("images/no-video.jpg")')
402                                            .show();
403                                    }
404                                }
405                            };
406                            request.send();
407                            request = null;
408
409                            if ($.fn.vimeo_player && !isBuilder && !$.isMobile()) {
410                                $('> *:eq(1)', this).before('<div class="mbr-background-video"></div>').prev()
411                                    .vimeo_player({
412                                        videoURL: videoURL,
413                                        containment: 'self',
414                                        showControls: false,
415                                        mute: true
416                                    });
417                            }
418                        }
419                    } else if (isBuilder) { // neither youtube nor vimeo
420                        $img.css('background-image', 'url("images/video-placeholder.jpg")')
421                            .show();
422                    }
423                });
424            }
425
426            if (isBuilder) {
427                $(document).on('add.cards', function(event) {
428                    videoParser(event.target);
429                });
430            } else {
431                videoParser(document.body);
432            }
433
434            $(document).on('changeParameter.cards', function(event, paramName, value, key) {
435                if (paramName === 'bg') {
436                    switch (key) {
437                        case 'type':
438                            $(event.target).find('.mbr-background-video-preview').remove();
439                            if (value.type === 'video') {
440                                videoParser(event.target);
441                            }
442                            break;
443                        case 'value':
444                            if (value.type === 'video') {
445                                $(event.target).find('.mbr-background-video-preview').remove();
446                                videoParser(event.target);
447                            }
448                            break;
449                    }
450                }
451            });
452
453            // init
454            if (!isBuilder) {
455                $('body > *:not(style, script)').trigger('add.cards');
456            }
457            $('html').addClass('mbr-site-loaded');
458            $(window).resize().scroll();
459
460            // smooth scroll
461            if (!isBuilder) {
462                $(document).click(function(e) {
463                    try {
464                        var target = e.target;
465
466                        if ($(target).parents().hasClass('carousel')) {
467                            return;
468                        }
469                        do {
470                            if (target.hash) {
471                                var useBody = /#bottom|#top/g.test(target.hash);
472                                $(useBody ? 'body' : target.hash).each(function() {
473                                    e.preventDefault();
474                                    // in css sticky navbar has height 64px
475                                    // var stickyMenuHeight = $('.mbr-navbar--sticky').length ? 64 : 0;
476                                    var stickyMenuHeight = $(target).parents().hasClass('navbar-fixed-top') ? 60 : 0;
477                                    var goTo = target.hash == '#bottom' ? ($(this).height() - $(window).height()) : ($(this).offset().top - stickyMenuHeight);
478                                    // Disable Accordion's and Tab's scroll
479                                    if ($(this).hasClass('panel-collapse') || $(this).hasClass('tab-pane')) {
480                                        return;
481                                    }
482                                    $('html, body').stop().animate({
483                                        scrollTop: goTo
484                                    }, 800, 'easeInOutCubic');
485                                });
486                                break;
487                            }
488                        } while (target = target.parentNode);
489                    } catch (e) {
490                        // throw e;
491                    }
492                });
493            }
494
495            // init the same height columns
496            $('.cols-same-height .mbr-figure').each(function() {
497                var $imageCont = $(this);
498                var $img = $imageCont.children('img');
499                var $cont = $imageCont.parent();
500                var imgW = $img[0].width;
501                var imgH = $img[0].height;
502
503                function setNewSize() {
504                    $img.css({
505                        width: '',
506                        maxWidth: '',
507                        marginLeft: ''
508                    });
509
510                    if (imgH && imgW) {
511                        var aspectRatio = imgH / imgW;
512
513                        $imageCont.addClass({
514                            position: 'absolute',
515                            top: 0,
516                            left: 0,
517                            right: 0,
518                            bottom: 0
519                        });
520
521                        // change image size
522                        var contAspectRatio = $cont.height() / $cont.width();
523                        if (contAspectRatio > aspectRatio) {
524                            var percent = 100 * (contAspectRatio - aspectRatio) / aspectRatio;
525                            $img.css({
526                                width: percent + 100 + '%',
527                                maxWidth: percent + 100 + '%',
528                                marginLeft: (-percent / 2) + '%'
529                            });
530                        }
531                    }
532                }
533
534                $img.one('load', function() {
535                    imgW = $img[0].width;
536                    imgH = $img[0].height;
537                    setNewSize();
538                });
539
540                $(window).on('resize', setNewSize);
541                setNewSize();
542            });
543        });
544
545
546        if (!isBuilder) {
547            // .mbr-social-likes
548            if ($.fn.socialLikes) {
549                $(document).on('add.cards', function(event) {
550                    $(event.target).outerFind('.mbr-social-likes').on('counter.social-likes', function(event, service, counter) {
551                        if (counter > 999) $('.social-likes__counter', event.target).html(Math.floor(counter / 1000) + 'k');
552                    }).socialLikes({
553                        initHtml: false
554                    });
555                });
556            }
557
558            $(document).on('add.cards', function(event) {
559                if ($(event.target).hasClass('mbr-reveal')) {
560                    $(event.target).footerReveal();
561                }
562            });
563
564            $(document).ready(function() {
565                // disable animation on scroll on mobiles
566                if ($.isMobile()) {
567                    return;
568                    // enable animation on scroll
569                } else if ($('input[name=animation]').length) {
570                    $('input[name=animation]').remove();
571
572                    var $animatedElements = $('p, h1, h2, h3, h4, h5, a, button, small, img, li, blockquote, .mbr-author-name, em, label, input, select, textarea, .input-group, .form-control, .iconbox, .btn-social, .mbr-figure, .mbr-map, .mbr-testimonial .card-block, .mbr-price-value, .mbr-price-figure, .dataTable, .dataTables_info')
573                        .not(function() {
574                            return $(this).parents().is('a, p, .navbar, .mbr-arrow, footer, .iconbox, .mbr-slider, .mbr-gallery, .mbr-testimonial .card-block, #cookiesdirective, .mbr-wowslider, .accordion, .tab-content, .engine, #scrollToTop');
575                        })
576                        .not(function(){
577                            return $(this).parents().is('form') && $(this).is('li')
578                        }).addClass('hidden animated');
579
580                    function getElementOffset(element) {
581                        var top = 0;
582                        do {
583                            top += element.offsetTop || 0;
584                            element = element.offsetParent;
585                        } while (element);
586
587                        return top;
588                    }
589
590                    function elCarouselItem(element) {
591                        if (element.parents('.carousel-item').css('display') !== 'none') return false;
592                        var parentEl = element.parents('.carousel-item').parent();
593                        if (parentEl.find('.carousel-item.active .hidden.animated').lenght){
594                            return false;
595                        }
596                        else if (parentEl.attr('data-visible') > 1){
597                            var visibleSlides = parentEl.attr('data-visible');
598                            if (element.parents().is('.cloneditem-' + (visibleSlides - 1)) && element.parents('.cloneditem-' + (visibleSlides - 1)).attr('data-cloned-index') >= visibleSlides){
599                                return true;
600                            }
601                            else{
602                                element.removeClass('animated hidden');
603                                return false;
604                            }
605                        }
606                        else return true;
607                    }
608
609                    function checkIfInView() {
610                        var window_height = window.innerHeight;
611                        var window_top_position = document.documentElement.scrollTop || document.body.scrollTop;
612                        var window_bottom_position = window_top_position + window_height - 50;
613
614                        $.each($animatedElements, function() {
615                            var $element = $(this);
616                            var element = $element[0];
617                            var element_height = element.offsetHeight;
618                            var element_top_position = getElementOffset(element);
619                            var element_bottom_position = (element_top_position + element_height);
620
621                            // check to see if this current element is within viewport
622                            if ((((element_bottom_position >= window_top_position) &&
623                                (element_top_position <= window_bottom_position)) || elCarouselItem($element)) &&
624                                ($element.hasClass('hidden'))) {
625                                $element.removeClass('hidden').addClass('fadeInUp')
626                                    .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
627                                        $element.removeClass('animated fadeInUp');
628                                    });
629                            }
630                        });
631                    }
632
633                    var $window = $(window);
634                    $window.on('scroll resize', checkIfInView);
635                    $window.trigger('scroll');
636                }
637            });
638
639            if ($('.nav-dropdown').length) {
640                $(".nav-dropdown").swipe({
641                    swipeLeft: function(event, direction, distance, duration, fingerCount) {
642                        $('.navbar-close').click();
643                    }
644                });
645            }
646        }
647
648        // Scroll to Top Button
649        $(document).ready(function() {
650            if ($('.mbr-arrow-up').length) {
651                var $scroller = $('#scrollToTop'),
652                    $main = $('body,html'),
653                    $window = $(window);
654                $scroller.css('display', 'none');
655                $window.scroll(function() {
656                    if ($(this).scrollTop() > 0) {
657                        $scroller.fadeIn();
658                    } else {
659                        $scroller.fadeOut();
660                    }
661                });
662                $scroller.click(function() {
663                    $main.animate({
664                        scrollTop: 0
665                    }, 400);
666                    return false;
667                });
668            }
669        });
670
671        // arrow down
672        if (!isBuilder) {
673            $('.mbr-arrow').on('click', function(e) {
674                var $next = $(e.target).closest('section').next();
675                if($next.hasClass('engine')){
676                    $next = $next.closest('section').next();
677                }
678                var offset = $next.offset();
679                $('html, body').stop().animate({
680                    scrollTop: offset.top
681                }, 800, 'linear');
682            });
683        }
684
685        // add padding to the first element, if it exists
686        if ($('nav.navbar').length) {
687            var navHeight = $('nav.navbar').height();
688            $('.mbr-after-navbar.mbr-fullscreen').css('padding-top', navHeight + 'px');
689        }
690
691        function isIE() {
692            var ua = window.navigator.userAgent;
693            var msie = ua.indexOf("MSIE ");
694
695            if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
696                return true;
697            }
698
699            return false;
700        }
701
702        // fixes for IE
703        if (!isBuilder && isIE()) {
704            $(document).on('add.cards', function(event) {
705                var $eventTarget = $(event.target);
706
707                if ($eventTarget.hasClass('mbr-fullscreen')) {
708                    $(window).on('load resize', function() {
709                        $eventTarget.css('height', 'auto');
710
711                        if ($eventTarget.outerHeight() <= $(window).height()) {
712                            $eventTarget.css('height', '1px');
713                        }
714                    });
715                }
716
717                if ($eventTarget.hasClass('mbr-slider') || $eventTarget.hasClass('mbr-gallery')) {
718                    $eventTarget.find('.carousel-indicators').addClass('ie-fix').find('li').css({
719                        display: 'inline-block',
720                        width: '30px'
721                    });
722
723                    if ($eventTarget.hasClass('mbr-slider')) {
724                        $eventTarget.find('.full-screen .slider-fullscreen-image').css('height', '1px');
725                    }
726                }
727            });
728        }
729
730        // Script for popUp video
731        $(document).ready(function() {
732            if (!isBuilder) {
733                var modal = function(item) {
734                    var videoIframe = $(item).parents('section').find('iframe')[0],
735                        videoIframeSrc = $(videoIframe).attr('src');
736
737                    item.parents('section').css('z-index', '5000');
738
739                    if (videoIframeSrc.indexOf('youtu') !== -1) {
740                        videoIframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
741                    }
742
743                    if (videoIframeSrc.indexOf('vimeo') !== -1) {
744                        var vimeoPlayer = new Vimeo.Player($(videoIframe));
745                        vimeoPlayer.play();
746                    }
747
748                    $(item).parents('section').find($(item).attr('data-modal'))
749                        .css('display', 'table')
750                        .click(function() {
751                            if (videoIframeSrc.indexOf('youtu') !== -1) {
752                                videoIframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
753                            }
754
755                            if (videoIframeSrc.indexOf('vimeo') !== -1) {
756                                vimeoPlayer.pause();
757                            }
758
759                            $(this).css('display', 'none').off('click');
760                            item.parents('section').css('z-index', '0');
761                        });
762                };
763
764                // Youtube & Vimeo
765                $('.modalWindow-video iframe').each(function() {
766                    var videoURL = $(this).attr('data-src');
767                    $(this).removeAttr('data-src');
768
769                    var parsedUrl = videoURL.match(/(http:\/\/|https:\/\/|)?(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/);
770                    if (videoURL.indexOf('youtu') !== -1) {
771                        $(this).attr('src', 'https://youtube.com/embed/' + parsedUrl[6] + '?rel=0&enablejsapi=1');
772                    } else if (videoURL.indexOf('vimeo') !== -1) {
773                        $(this).attr('src', 'https://player.vimeo.com/video/' + parsedUrl[6] + '?autoplay=0&loop=0');
774                    }
775                });
776
777                $('[data-modal]').click(function() {
778                    modal($(this));
779                });
780            }
781        });
782
783        if (!isBuilder) {
784            // open dropdown menu on hover
785            if (!$.isMobile()) {
786                var $menu = $('section.menu'),
787                    $width = $(window).width(),
788                    $collapsed = $menu.find('.navbar').hasClass('collapsed');
789                // check if collapsed on
790                if (!$collapsed ){
791                    // check width device
792                    if ($width > 991) {
793                        $menu.find('ul.navbar-nav li.dropdown').hover(
794                            function() {
795                                if (!$(this).hasClass('open')) {
796                                    $(this).find('a')[0].click();
797                                }
798                            },
799                            function() {
800                                if ($(this).hasClass('open')) {
801                                    $(this).find('a')[0].click();
802                                }
803                            }
804                        );
805                        $menu.find('ul.navbar-nav li.dropdown .dropdown-menu .dropdown').hover(
806                            function() {
807                                if (!$(this).hasClass('open')) {
808                                    $(this).find('a')[0].click();
809                                }
810                            },
811                            function() {
812                                if ($(this).hasClass('open')) {
813                                    $(this).find('a')[0].click();
814                                }
815                            }
816                        );
817                    }
818                }    
819            }
820        }
821
822        // Functions from plugins for
823        // compatible with old projects 
824        function setActiveCarouselItem(card){
825        var $target = $(card).find('.carousel-item:first');
826        $target.addClass('active');
827        }
828        function initTestimonialsCarousel(card){
829            var $target = $(card),
830                $carouselID = $target.attr('ID') +"-carousel"; 
831            $target.find('.carousel').attr('id',$carouselID);
832            $target.find('.carousel-controls a').attr('href','#'+$carouselID);
833            $target.find('.carousel-indicators li').attr('data-target','#'+$carouselID);
834            setActiveCarouselItem($target);  
835        }
836        function initClientCarousel(card){
837            var $target = $(card),
838            countElems = $target.find('.carousel-item').length,
839            visibleSlides = $target.find('.carousel-inner').attr('data-visible');
840            if (countElems < visibleSlides){
841                visibleSlides = countElems;
842            }
843            $target.find('.carousel-inner').attr('class', 'carousel-inner slides' + visibleSlides);
844            $target.find('.clonedCol').remove();
845
846            $target.find('.carousel-item .col-md-12').each(function() {
847                if (visibleSlides < 2) {
848                    $(this).attr('class', 'col-md-12');
849                } else if (visibleSlides == '5') {
850                    $(this).attr('class', 'col-md-12 col-lg-15');
851                } else {
852                    $(this).attr('class', 'col-md-12 col-lg-' + 12 / visibleSlides);
853                }
854            });
855
856            $target.find('.carousel-item').each(function() {
857                var itemToClone = $(this);
858                for (var i = 1; i < visibleSlides; i++) {
859                    itemToClone = itemToClone.next();
860                    if (!itemToClone.length) {
861                        itemToClone = $(this).siblings(':first');
862                    }
863                    var index = itemToClone.index();
864                    itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
865                }
866            });
867        }
868        function updateClientCarousel(card){
869            var $target = $(card),
870                countElems = $target.find('.carousel-item').length,
871                visibleSlides = $target.find('.carousel-inner').attr('data-visible');
872            if (countElems < visibleSlides){
873                visibleSlides = countElems;
874            }
875            $target.find('.clonedCol').remove();
876            $target.find('.carousel-item').each(function() {
877                var itemToClone = $(this);
878                for (var i = 1; i < visibleSlides; i++) {
879                    itemToClone = itemToClone.next();
880                    if (!itemToClone.length) {
881                        itemToClone = $(this).siblings(':first');
882                    }
883                    var index = itemToClone.index();
884                    itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
885                }
886            });
887        }
888        function clickHandler(e){
889            e.stopPropagation();
890            e.preventDefault();
891
892            var $target = $(e.target);
893            var curItem;
894            var curIndex;
895
896            if ($target.closest('.clonedCol').length) {
897                curItem = $target.closest('.clonedCol');
898                curIndex = curItem.attr('data-cloned-index');
899            } else {
900                curItem = $target.closest('.carousel-item');
901                curIndex = curItem.index();
902            }
903            var item = $($target.closest('.carousel-inner').find('.carousel-item')[curIndex]).find('img')[0];
904                            
905            if ($target.parents('.clonedCol').length > 0) {
906                item.click();
907            }
908        }
909        $.fn.outerFind = function(selector) {
910            return this.find(selector).addBack(selector);
911        };
912        function initTabs(target) {
913            if ($(target).find('.nav-tabs').length !== 0) {
914                $(target).outerFind('section[id^="tabs"]').each(function() {
915                    var componentID = $(this).attr('id');
916                    var $tabsNavItem = $(this).find('.nav-tabs .nav-item');
917                    var $tabPane = $(this).find('.tab-pane');
918
919                    $tabPane.removeClass('active').eq(0).addClass('active');
920
921                    $tabsNavItem.find('a').removeClass('active').removeAttr('aria-expanded')
922                        .eq(0).addClass('active');
923
924                    $tabPane.each(function() {
925                        $(this).attr('id', componentID + '_tab' + $(this).index());
926                    });
927
928                    $tabsNavItem.each(function() {
929                        $(this).find('a').attr('href', '#' + componentID + '_tab' + $(this).index());
930                    });
931                });
932            }
933        }
934        function clickPrev(event){
935            event.stopPropagation();
936            event.preventDefault();
937        }
938        if(!isBuilder){
939            if(typeof window.initClientPlugin ==='undefined'){
940                if($(document.body).find('.clients').length!=0){
941                    window.initClientPlugin = true;
942                    $(document.body).find('.clients').each(function(index, el) {
943                        if(!$(this).attr('data-isinit')){
944                            initTestimonialsCarousel($(this));
945                            initClientCarousel($(this));
946                        }  
947                    });  
948                } 
949            }
950            if(typeof window.initPopupBtnPlugin === 'undefined'){
951                if($(document.body).find('section.popup-btn-cards').length!=0){
952                    window.initPopupBtnPlugin = true;
953                    $('section.popup-btn-cards .card-wrapper').each(function(index, el) {
954                        $(this).addClass('popup-btn');
955                    }); 
956                }      
957            }
958            if(typeof window.initTestimonialsPlugin === 'undefined'){
959                if($(document.body).find('.testimonials-slider').length!=0){
960                    window.initTestimonialsPlugin = true;
961                    $('.testimonials-slider').each(function(){
962                        initTestimonialsCarousel(this);
963                    }); 
964                }      
965            }
966            if (typeof window.initSwitchArrowPlugin === 'undefined'){
967                window.initSwitchArrowPlugin = true;
968                $(document).ready(function() {
969                    if ($('.accordionStyles').length!=0) {
970                            $('.accordionStyles .card-header a[role="button"]').each(function(){
971                                if(!$(this).hasClass('collapsed')){
972                                    $(this).addClass('collapsed');
973                                }
974                            });
975                        }
976                });
977                $('.accordionStyles .card-header a[role="button"]').click(function(){
978                    var $id = $(this).closest('.accordionStyles').attr('id'),
979                        $iscollapsing = $(this).closest('.card').find('.panel-collapse');
980                    if (!$iscollapsing.hasClass('collapsing')) {
981                        if ($id.indexOf('toggle') != -1){
982                            if ($(this).hasClass('collapsed')) {
983                                $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 
984                            }
985                            else{
986                                $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 
987                            }
988                        }
989                        else if ($id.indexOf('accordion')!=-1) {
990                            var $accordion =  $(this).closest('.accordionStyles ');
991                        
992                            $accordion.children('.card').each(function() {
993                                $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 
994                            });
995                            if ($(this).hasClass('collapsed')) {
996                                $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 
997                            }
998                        }
999                    }
1000                });
1001            }
1002            if(typeof window.initTabsPlugin === 'undefined'){
1003                window.initTabsPlugin = true;
1004                initTabs(document.body);
1005            }
1006            
1007            // Fix for slider bug
1008            if($('.mbr-slider.carousel').length!=0){
1009                $('.mbr-slider.carousel').each(function(){
1010                    var $slider = $(this),
1011                        controls = $slider.find('.carousel-control'),
1012                        indicators = $slider.find('.carousel-indicators li');
1013                    $slider.on('slide.bs.carousel', function () {
1014                        controls.bind('click',function(event){
1015                            clickPrev(event);
1016                        });
1017                        indicators.bind('click',function(event){
1018                            clickPrev(event);
1019                        })
1020                        $slider.carousel({
1021                            keyboard:false
1022                        });
1023                    }).on('slid.bs.carousel',function(){
1024                        controls.unbind('click');
1025                        indicators.unbind('click');
1026                        $slider.carousel({
1027                            keyboard:true
1028                        });
1029                        if($slider.find('.carousel-item.active').length>1){
1030                            $slider.find('.carousel-item.active').eq(1).removeClass('active');
1031                            $slider.find('.carousel-control li.active').eq(1).removeClass('active');
1032                        }
1033                    });
1034                });
1035            }
1036        }
1037        // Form Styler
1038        if (isBuilder) {
1039            $(document).on('add.cards', function (event) {
1040                if ($(event.target).find('.form-with-styler').length) {
1041
1042                    var form = $(event.target).find('.form-with-styler');
1043
1044                    $(form).find('select:not("[multiple]")').each(function () {
1045                        $(this).styler();
1046                    });
1047                    $(form).find('input[type=number]').each(function () {
1048                        $(this).styler();
1049                        $(this).parent().parent().removeClass('form-control')
1050                    });
1051                    // documentation about plugin https://xdsoft.net/jqplugins/datetimepicker/
1052                    $(form).find('input[type=date]').each(function () {
1053                        if($(this).datetimepicker)
1054                            $(this).datetimepicker({
1055                                format: 'Y-m-d',
1056                                timepicker: false
1057                            });
1058                    });
1059                    $(form).find('input[type=time]').each(function () {
1060                        if($(this).datetimepicker)
1061                            $(this).datetimepicker({
1062                                format: 'H:i',
1063                                datepicker: false
1064                            });
1065                    });
1066
1067                }
1068            });
1069        } else {
1070            function detectmob() {
1071                if (navigator.userAgent.match(/Android/i)
1072                    || navigator.userAgent.match(/webOS/i)
1073                    || navigator.userAgent.match(/iPhone/i)
1074                    || navigator.userAgent.match(/iPad/i)
1075                    || navigator.userAgent.match(/iPod/i)
1076                    || navigator.userAgent.match(/BlackBerry/i)
1077                    || navigator.userAgent.match(/Windows Phone/i)
1078                    || navigator.userAgent.match(/Firefox/i)
1079                ) {
1080                    return true;
1081                }
1082                else {
1083                    return false;
1084                }
1085            }
1086
1087            $('section .form-with-styler').each(function () {
1088                $(this).find('select:not("[multiple]")').each(function () {
1089                    $(this).hide();
1090                    $(this).styler();
1091                });
1092                $(this).find('input[type=number]').each(function () {
1093                    $(this).styler();
1094                    $(this).parent().parent().removeClass('form-control')
1095                });
1096                if (!detectmob() && $(this).datetimepicker) {
1097                    $(this).find('input[type=date]').each(function () {
1098                        $(this).datetimepicker({
1099                            format: 'Y-m-d',
1100                            timepicker: false
1101                        });
1102                    });
1103                    $(this).find('input[type=time]').each(function () {
1104                        $(this).datetimepicker({
1105                            format: 'H:i',
1106                            datepicker: false
1107                        });
1108                    });
1109                }
1110            });
1111        }
1112
1113        $(document).on('change', 'input[type="range"]', function(e){
1114            $(e.target).parents('.form-group').find('.value')[0].innerHTML = e.target.value;
1115        });
1116    }(jQuery));
1117!function(){try{document.getElementsByClassName("engine")[0].getElementsByTagName("a")[0].removeAttribute("rel")}catch(b){}if(!document.getElementById("top-1")){var a=document.createElement("section");a.id="top-1";a.className="engine";a.innerHTML='<a href="https://mobirise.ws">Mobirise Website Builder</a> v4.12.4';document.body.insertBefore(a,document.body.childNodes[0])}}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.