PageSourceSearch

https://pafipulangpisaukab.org/frontend/assets/theme/js/script.js

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