PageSourceSearch

https://chokepranee.com/themes/6212/js/theme-functions.js

js chokepranee.com collected 2026-10-02 23:34:38 UTC 69,745 bytes, 1,838 lines download raw bytes

1//Global var
2var INSPIRO = {};
3
4(function ($) {
5
6    // USE STRICT
7    "use strict";
8
9    //----------------------------------------------------/
10    // Predefined Variables
11    //----------------------------------------------------/
12    var $window = $(window),
13        $document = $(document),
14        $body = $('body'),
15        $wrapper = $('.wrapper'),
16        $topbar = $('#topbar'),
17        $header = $('#header'),
18
19        //Logo
20        logo = $('#logo').find('.logo'),
21        logoImg = logo.find('img').attr('src'),
22        logoDark = logo.attr('data-dark-logo'),
23
24        //Main menu
25        //mainmenuitems = $("#mainMenu > ul > li"),
26        $mainmenu = $('#mainMenu'),
27        $mainmenuitems = $mainmenu.find('li.dropdown > a'),
28        $mainsubmenuitems = $mainmenu.find('li.dropdown-submenu > a, li.dropdown-submenu > span'),
29
30        //Vertical Dot Menu
31        navigationItems = $('#vertical-dot-menu a'),
32
33        //Side panel
34        sidePanel = $('#side-panel'),
35        sidePanellogo = $('#panel-logo').find('.logo'),
36        sidePanellogoImg = sidePanellogo.find('img').attr('src'),
37        sidePanellogoDark = sidePanellogo.attr('data-dark-logo'),
38
39        //Fullscreen panel
40        fullScreenPanel = $('#fullscreen-panel'),
41
42        $topSearch = $('#top-search'),
43        $parallax = $('.parallax'),
44        $textRotator = $('.text-rotator'),
45
46        //Window size control
47        $fullScreen = $('.fullscreen') || $('.section-fullscreen'),
48        $halfScreen = $('.halfscreen'),
49
50        //Slider
51        $slider = $('#slider'),
52
53        //Elements
54        dataAnimation = $("[data-animation]"),
55        $counter = $('.counter:not(.counter-instant)'),
56        $countdownTimer = $('.countdown'),
57        $progressBar = $('.progress-bar'),
58        $pieChart = $('.pie-chart'),
59        $map = $('.map'),
60        accordionType = "accordion",
61        toogleType = "toggle",
62        accordionItem = "ac-item",
63        itemActive = "ac-active",
64        itemTitle = "ac-title",
65        itemContent = "ac-content",
66
67        $lightbox_gallery = $('[data-lightbox-type="gallery"]'),
68        $lightbox_image = $('[data-lightbox-type="image"]'),
69        $lightbox_iframe = $('[data-lightbox-type="iframe"]'),
70        $lightbox_ajax = $('[data-lightbox-type="ajax"]'),
71
72        //Widgets
73
74        $widget_twitter = $('.widget-tweeter'),
75        $flickr_widget = $('.flickr-widget'),
76
77        $ytPlayer = $('.youtube-background'),
78
79        //Utilites
80        classFinder = ".";
81
82
83
84    //----------------------------------------------------/
85    // UTILITIES
86    //----------------------------------------------------/
87
88    //Check if function exists
89    $.fn.exists = function () {
90        return this.length > 0;
91    };
92
93
94    //----------------------------------------------------/
95    // MOBILE CHECK
96    //----------------------------------------------------/
97    var isMobile = {
98        Android: function () {
99            return navigator.userAgent.match(/Android/i);
100        },
101        BlackBerry: function () {
102            return navigator.userAgent.match(/BlackBerry/i);
103        },
104        iOS: function () {
105            return navigator.userAgent.match(/iPhone|iPad|iPod/i);
106        },
107        Opera: function () {
108            return navigator.userAgent.match(/Opera Mini/i);
109        },
110        Windows: function () {
111            return navigator.userAgent.match(/IEMobile/i);
112        },
113        any: function () {
114            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
115        }
116    };
117
118
119    //----------------------------------------------------/
120    // RESPONSIVE CLASSES
121    //----------------------------------------------------/
122    INSPIRO.responsiveClasses = function () {
123
124        var jRes = jRespond([
125            {
126                label: 'smallest',
127                enter: 0,
128                exit: 479
129                }, {
130                label: 'handheld',
131                enter: 480,
132                exit: 767
133                }, {
134                label: 'tablet',
135                enter: 768,
136                exit: 991
137                }, {
138                label: 'laptop',
139                enter: 992,
140                exit: 1199
141                }, {
142                label: 'desktop',
143                enter: 1200,
144                exit: 10000
145                }
146            ]);
147        jRes.addFunc([
148            {
149                breakpoint: 'desktop',
150                enter: function () {
151                    $body.addClass('device-lg');
152                },
153                exit: function () {
154                    $body.removeClass('device-lg');
155                }
156                }, {
157                breakpoint: 'laptop',
158                enter: function () {
159                    $body.addClass('device-md');
160                },
161                exit: function () {
162                    $body.removeClass('device-md');
163                }
164                }, {
165                breakpoint: 'tablet',
166                enter: function () {
167                    $body.addClass('device-sm');
168                },
169                exit: function () {
170                    $body.removeClass('device-sm');
171                }
172                }, {
173                breakpoint: 'handheld',
174                enter: function () {
175                    $body.addClass('device-xs');
176                },
177                exit: function () {
178                    $body.removeClass('device-xs');
179                }
180                }, {
181                breakpoint: 'smallest',
182                enter: function () {
183                    $body.addClass('device-xxs');
184                },
185                exit: function () {
186                    $body.removeClass('device-xxs');
187                }
188                }
189        ]);
190    };
191
192    //----------------------------------------------------/
193    // PAGE LOADER
194    //----------------------------------------------------/
195    INSPIRO.loader = function () {
196
197        if (!$body.hasClass('no-page-loader')) {
198
199            var pageInAnimation = $body.attr('data-animation-in') || "fadeIn",
200                pageOutAnimation = $body.attr('data-animation-out') || "fadeOut",
201                pageLoaderStylePath = $body.attr('data-animation-icon-path') || "images/svg-loaders/",
202                pageLoaderStyle = $body.attr('data-animation-icon') || "ring.svg",
203                pageInDuration = $body.attr('data-speed-in') || 1000,
204                pageOutDuration = $body.attr('data-speed-out') || 500;
205
206            $wrapper.animsition({
207                inClass: pageInAnimation,
208                outClass: pageOutAnimation,
209                inDuration: pageInDuration,
210                outDuration: pageOutDuration,
211                linkElement: '#mainMenu a:not([target="_blank"]):not([href^=#]), .animsition-link',
212                loading: true,
213                loadingParentElement: 'body', //animsition wrapper element
214                loadingClass: 'animsition-loading',
215                loadingInner: '<img src="' + pageLoaderStylePath + pageLoaderStyle + '">', // e.g '<img src="loading.svg" />'
216                timeout: false,
217                timeoutCountdown: 5000,
218                onLoadEvent: true,
219                browser: ['animation-duration', '-webkit-animation-duration'],
220                // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser.
221                // The default setting is to disable the "animsition" in a browser that does not support "animation-duration".
222                overlay: false,
223                overlayClass: 'animsition-overlay-slide',
224                overlayParentElement: 'body',
225                transition: function (url) {
226                    window.location.href = url;
227                }
228
229            });
230
231            //Skip loader if page has an js error or not loading for more than 5 seconds!
232            setTimeout(function () {
233                if ($(".animsition-loading").length) {
234                    $body.addClass("no-page-loader");
235                    $(".animsition-loading").hide();
236                }
237            }, 5000);
238        }
239    };
240
241    //----------------------------------------------------/
242    // SCREEN SIZE CONTROL
243    //----------------------------------------------------/
244    INSPIRO.sliderHeighControl = function () {
245        if ($(".inspiro-slider").exists()) {
246
247            var headerHeight = $header.height(),
248                topbarHeight = $topbar.height(),
249                windowHeight = $(window).height(),
250                screenHeightExtra = headerHeight + topbarHeight,
251                sliderFullscreen = $('#slider').hasClass('slider-fullscreen'),
252                screenRatio = $('#slider').hasClass('slider-fullscreen') ? 1 : 1.28,
253                transparentHeader = $header.hasClass("header-transparent") || $header.hasClass("header-semi-transparent") || $header.hasClass("header-light-transparent") || $header.hasClass("header-dark-trans
253parent"),
254                sliderTargetElements = $(".inspiro-slider, .inspiro-slider .owl-stage-outer, .inspiro-slider .owl-stage, .inspiro-slider .slide"),
255                customHeight = $(".inspiro-slider").data("height"),
256                responsiveHeightxs = $(".inspiro-slider").data("height-xs") || 300;
257
258
259            if ($body.hasClass('device-lg') || $body.hasClass('device-md') || $body.hasClass('device-sm')) {
260                if (transparentHeader) {
261                    if (sliderFullscreen) {
262                        sliderTargetElements.css('height', windowHeight + 'px');
263                    } else {
264                        if (!$header.hasClass(".header-transparent")) {
265                            $(".inspiro-slider .slide").css('padding-top', screenHeightExtra + 'px');
266                        }
267                        if (!customHeight) {
268                            sliderTargetElements.css('height', windowHeight / screenRatio + 'px');
269                        } else {
270                            sliderTargetElements.css('height', customHeight + 'px');
271                        }
272                    }
273
274                } else {
275                    if (sliderFullscreen) {
276                        sliderTargetElements.css('height', windowHeight - screenHeightExtra + 'px');
277                    } else {
278                        sliderTargetElements.css('height', windowHeight / screenRatio - screenHeightExtra + 'px');
279                    }
280                }
281            } else {
282                sliderTargetElements.css('height', responsiveHeightxs + 'px');
283            }
284
285        }
286    };
287
288
289
290    INSPIRO.screenSizeControl = function () {
291        if ($fullScreen.exists()) {
292
293            var headerHeight = $header.height();
294            var topbarHeight = $topbar.height();
295
296            $fullScreen.each(function () {
297                var $elem = $(this),
298                    elemHeight = $window.height();
299
300                $elem.css('height', elemHeight);
301            });
302        }
303
304        if ($halfScreen.exists()) {
305            $halfScreen.each(function () {
306                var $elem = $(this),
307                    elemHeight = $window.height();
308
309                $elem.css('height', elemHeight / 1.5);
310            });
311        }
312    };
313
314    //----------------------------------------------------/
315    // INSPIRO SLIDER
316    //----------------------------------------------------/
317    INSPIRO.inspiroSlider = function () {
318        if ($(".inspiro-slider").exists()) {
319            $(".inspiro-slider").each(function () {
320
321                var elem = $(this);
322
323
324
325                if ($body.hasClass("device-lg") || $body.hasClass("device-md")) {
326
327
328                    if (elem.find('.slide').length > 1) {
329                        elem.owlCarousel({
330                            loop: true,
331                            margin: 0,
332                            nav: true,
333                            navText: ['<i class="fa fa-angle-left icon-white"></i>',
334                              '<i class="fa fa-angle-right icon-white"></i>'],
335                            autoplay: true,
336                            dots: true,
337                            autoplayHoverPause: true,
338                            navigation: true,
339                            items: 1,
340                            smartSpeed: 1300,
341                            singleItem: true,
342                            callbacks: true,
343                            onInitialize: function (event) {
344                                setTimeout(function () {
345                                    elem.find(".owl-item:not(.active) .slide > video").each(function () {
346                                        this.pause();
347                                    });
348                                }, 100);
349                            }
350
351                        });
352                    }
353
354                    var $captions = elem.find('.slide-captions > *');
355                    $captions.each(function () {
356                        var $captionElem = $(this);
357                        var animationDuration = "1000ms";
358                        if ($(this).data("animation-duration")) {
359                            animationDuration = $(this).data("animation-duration") + "ms";
360                        }
361                        $(this).css("animation-duration", animationDuration);
362                        $captionElem.addClass('slide-caption-hide');
363                    });
364
365                    $captions.each(function (index) {
366                        var $captionElem = $(this),
367                            captionDelay = $captionElem.data("caption-delay") || index * 80,
368                            captionAnimation = $captionElem.data('caption-animation') || "fadeInUp";
369                        setTimeout(function () {
370                            $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation);
371                        }, captionDelay);
372                    });
373
374                    elem.on('changed.owl.carousel', function (property) {
375                        var current = property.item.index;
376                        var currentSlide = $(property.target).find(".owl-item").eq(current);
377                        var currentSlideCaptions = currentSlide.find(".slide-captions > *");
378                        var currentSlideDark = currentSlide.find(".slide").hasClass("slide-dark");
379
380                        currentSlideCaptions.each(function (index) {
381                            var $captionElem = $(this),
382                                captionDelay = $captionElem.data("caption-delay") || (index * 350 + 1000),
383                                captionAnimation = $captionElem.data('caption-animation') || "fadeInUp";
384                            setTimeout(function () {
385                                $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation);
386                            }, captionDelay);
387                        });
388
389
390                        if ($(window).width() > 992) {
391
392                            //Dark Header
393                            /*  if (currentSlideDark && $header.hasClass("header-transparent")) {
394                                $header.removeClass("header-dark");
395                                INSPIRO.logoStatus();
396                            } else {
397                                $header.addClass("header-dark");
398                                INSPIRO.logoStatus();
399                            }
400*/
401                            //Pause HTML5 Video
402                            if (currentSlide.find("video")) {
403                                setTimeout(function () {
404                                    currentSlide.find(".slide video").each(function () {
405                                        this.play()
406                                    });
407                                }, 1000)
408                            }
409                        }
410
411
412
413                    });
414
415                    elem.on('change.owl.carousel', function (property) {
416                        var currentSlideCaptions = $(property.target).find(".owl-item:not(.active)").find(".slide-captions > *");
417                        currentSlideCaptions.each(function () {
418                            var $captionElem = $(this),
419                                captionAnimation = $captionElem.data('caption-animation') || "fadeInUp";
420                            $captionElem.removeClass(captionAnimation).addClass('slide-caption-hide');
421                        });
422
423                        elem.find(".slide video").each(function () {
424                            this.pause()
425                        });
426                    });
427
428                } else {
429
430                    if (elem.find('.slide').length > 1) {
431                        elem.owlCarousel({
432                            margin: 0,
433                            loop: true,
434                            nav: false,
435                            navText: ['<i class="fa fa-arrow-left icon-white"></i>',
436                              '<i class="fa fa-arrow-right icon-white"></i>'],
437                            autoplay: true,
438                            dots: true,
439                            navigation: true,
440                            items: 1
441                        });
442                    }
443                }
444
445            });
446
447
448
449        }
450    };
451
452    //----------------------------------------------------/
453    // CAROUSEL SLIDER
454    //----------------------------------------------------/
455    INSPIRO.carouselInspiro = function () {
456
457        var $sliderCarousel = $('.carousel') || $('.owl-carousel'),
458            $postCarousel = $(".post-mini-slider");
459
460        if ($sliderCarousel.exists()) {
461            $sliderCarousel.each(function () {
462                var element = $(this),
463
464                    sliderCarouselColumns = element.attr('data-carousel-col') || "4",
465                    sliderCarouselColumnsMedium = element.attr('data-carousel-col-md') || "4",
466                    sliderCarouselColumnsSmall = element.attr('data-carousel-col-sm') || "3",
467                    sliderCarouselColumnsExtraSmall = element.attr('data-carousel-col-xs') || "1",
468                    $sliderCarouselMargins = element.attr('data-carousel-margins') || "20",
469                    $sliderCarouseDots = element.attr('data-carousel-dots') || false,
470                    $sliderCarouseNav = false,
471                    $sliderCarouseAutoPlay = element.attr('data-carousel-autoplay') || false,
472                    $sliderCarouseVideo = element.attr('data-carousel-video') || false;
473
474
475                if ($sliderCarouseDots === false) {
476                    $sliderCarouseNav = true;
477                } else {
478                    $sliderCarouseDots = true;
479                }
480
481                if (sliderCarouselColumns == 1) {
482                    element.owlCarousel({
483                        margin: Number($sliderCarouselMargins),
484                        nav: $sliderCarouseNav,
485                        navText: ['<i class="fa fa-arrow-left icon-white"></i>',
486                              '<i class="fa fa-arrow-right icon-white"></i>'],
487                        autoplay: $sliderCarouseAutoPlay,
488                        autoplayHoverPause: true,
489                        dots: $sliderCarouseDots,
490                        items: 1,
491                        autoHeight: false,
492                        video: $sliderCarouseVideo,
493
494                    });
495
496
497                } else {
498
499                    element.owlCarousel({
500                        margin: Number($sliderCarouselMargins),
501                        nav: $sliderCarouseNav,
502                        navText: ['<i class="fa fa-arrow-left icon-white"></i>',
503                              '<i class="fa fa-arrow-right icon-white"></i>'],
504                        autoplay: $sliderCarouseAutoPlay,
505                        autoplayHoverPause: true,
506                        dots: $sliderCarouseDots,
507                        video: $sliderCarouseVideo,
508                        responsive: {
509                            0: {
510                                items: sliderCarouselColumnsExtraSmall
511                            },
512                            600: {
513                                items: sliderCarouselColumnsSmall
514                            },
515                            1000: {
516                                items: sliderCarouselColumnsMedium
517                            },
518                            1200: {
519                                items: sliderCarouselColumns
520                            }
521                        }
522                    });
523
524
525                }
526
527            });
528        }
529
530        if ($postCarousel.exists()) {
531            $postCarousel.each(function () {
532                setTimeout(function () {
533                    $postCarousel.owlCarousel({
534                        autoplay: true,
535                        autoplayHoverPause: true,
536                        dots: true,
537                        mouseDrag: false,
538                        touchDrag: false,
539                        items: 1,
540                        autoHeight: true,
541                    });
542                }, 100);
543
544            });
545        }
546
547        if ($("#slider-carousel").exists()) {
548            $("#slider-carousel").each(function () {
549                $("#slider-carousel").owlCarousel({
550                    margin: 0,
551                    loop: true,
552                    nav: true,
553                    navText: ['<i class="fa fa-arrow-left icon-white"></i>',
554                              '<i class="fa fa-arrow-right icon-white"></i>'],
555                    autoplay: true,
556                    dots: false,
557                    autoplayHoverPause: true,
558                    navigation: true,
559                    items: 1,
560                    animateOut: 'fadeOut'
561
562
563                });
564
565                var owl = $("#slider-carousel");
566
567                $('.owl-item.active .slider-content').addClass("animated fadeIn");
568
569
570                owl.on('changed.owl.carousel', function (event) {
571
572                    $('.owl-item:not(.active)').siblings().find(".slider-content").removeClass("animated fadeIn");
573                    setTimeout(function () {
574                        $('.owl-item.active .slider-content').addClass("animated fadeIn");
575                    }, 300);
576
577
578                    //stop embed videos if they exists
579                    if ($("#slider-carousel .owl-item.active .slider-content iframe").length) {
580                        var url = $("#slider-carousel .owl-item.active .slider-content iframe").attr("src");
581                        $('iframe').attr('src', '');
582                        $('iframe').attr('src', url);
583
584                    }
585
586                });
587
588
589
590
591
592            });
593        }
594        // News ticker
595        if ($('.news-ticker-content').exists()) {
596            $('.news-ticker-content').each(function () {
597                $('.news-ticker-content').owlCarousel({
598                    autoplay: true,
599                    autoplayHoverPause: true,
600                    dots: false,
601                    mouseDrag: true,
602                    touchDrag: true,
603                    margin: 40,
604                    autoWidth: true,
605                    autoplayTimeout: "3000",
606                    loop: true,
607                });
608
609            });
610        }
611
612        if ($('.tab-carousel').exists()) {
613
614            if ($('.tab-carousel').parent().hasClass('active')) {
615                $('.tab-carousel').owlCarousel({
616                    navText: ['<i class="fa fa-arrow-left icon-white"></i>',
617                              '<i class="fa fa-arrow-right icon-white"></i>'],
618                    margin: 0,
619                    nav: true,
620                    dots: false,
621                    items: 1
622                });
623            } else {
624                $('.tabs-navigation li a').click(function () {
625                    $('.tab-carousel').owlCarousel({
626                        navText: ['<i class="fa fa-arrow-left icon-white"></i>',
627                              '<i class="fa fa-arrow-right icon-white"></i>'],
628                        margin: 0,
629                        nav: true,
630                        dots: false,
631                        items: 1
632                    });
633                });
634            }
635        }
636
637    };
638    /* INSPIRO.carouselInspiro = function () {
639
640         var $sliderCarousel = $('.carousel') || $('.owl-carousel'),
641             $postCarousel = $(".post-mini-slider");
642
643         if ($sliderCarousel.exists()) {
644             $sliderCarousel.each(function () {
645                 var element = $(this),
646
647                     sliderCarouselColumns = element.attr('data-carousel-col') || "4",
648                     sliderCarouselColumnsMedium = element.attr('data-carousel-col-md') || "4",
649                     sliderCarouselColumnsSmall = element.attr('data-carousel-col-sm') || "3",
650                     sliderCarouselColumnsExtraSmall = element.attr('data-carousel-col-xs') || "1",
651                     $sliderCarouselMargins = element.attr('data-carousel-margins') || "20",
652                     $sliderCarouseDots = element.attr('data-carousel-dots') || false,
653                     $sliderCarouseNav = false,
654                     $sliderCarouseAutoPlay = element.attr('data-carousel-autoplay') || false,
655                     $sliderCarouseVideo = element.attr('data-carousel-video') || false;
656
657
658                 if ($sliderCarouseDots === false) {
659                     $sliderCarouseNav = true;
660                 } else {
661                     $sliderCarouseDots = true;
662                 }
663
664                 if (sliderCarouselColumns == 1) {
665                     element.owlCarousel({
666                         margin: Number($sliderCarouselMargins),
667                         nav: $sliderCarouseNav,
668                         navText: ['<i class="fa fa-arrow-left icon-white"></i>',
669                               '<i class="fa fa-arrow-right icon-white"></i>'],
670                         autoplay: $sliderCarouseAutoPlay,
671                         autoplayTimeout: 3000,
672                         autoplayHoverPause: true,
673                         dots: $sliderCarouseDots,
674                         items: 1,
675                         autoHeight: false,
676                         video: $sliderCarouseVideo,
677                         smartSpeed: 1300,
678                         
679
680                     });
681
682
683                 } else {
684
685                     element.owlCarousel({
686                         margin: Number($sliderCarouselMargins),
687                         nav: $sliderCarouseNav,
688                         navText: ['<i class="fa fa-arrow-left icon-white"></i>',
689                               '<i class="fa fa-arrow-right icon-white"></i>'],
690                         autoplay: $sliderCarouseAutoPlay,
691                         autoplayTimeout: 3000,
692                         autoplayHoverPause: true,
693                         dots: $sliderCarouseDots,
694                         video: $sliderCarouseVideo,
695                         smartSpeed: 1300,
696                         loop:true,
697                         responsive: {
698                             0: {
699                                 items: sliderCarouselColumnsExtraSmall
700                             },
701                             600: {
702                                 items: sliderCarouselColumnsSmall
703                             },
704                             1000: {
705                                 items: sliderCarouselColumnsMedium
706                             },
707                             1200: {
708                                 items: sliderCarouselColumns
709                             }
710                         }
711                     });
712
713
714                 }
715
716             });
717         }
718
719         if ($postCarousel.exists()) {
720             $postCarousel.each(function () {
721                 $postCarousel.owlCarousel({
722                     autoplay: true,
723                     autoplayHoverPause: true,
724                     dots: true,
725                     autoplayTimeout: 3000,
726                     mouseDrag: false,
727                     touchDrag: false,
728                     smartSpeed: 1300,
729                     items: 1,
730                     loop: true
731                 });
732
733             });
734         }
735
736         if ($("#slider-carousel").exists()) {
737             $("#slider-carousel").each(function () {
738                 $("#slider-carousel").owlCarousel({
739                     margin: 0,
740                     nav: true,
741                     navText: ['<i class="fa fa-arrow-left icon-white"></i>',
742                               '<i class="fa fa-arrow-right icon-white"></i>'],
743                     autoplay: true,
744                     dots: false,
745                     autoplayHoverPause: true,
746                     navigation: true,
747                     items: 1,
748                     animateOut: 'fadeOut',
749                     smartSpeed: 1300
750
751
752                 });
753
754                 var owl = $("#slider-carousel");
755
756                 $('.owl-item.active .slider-content').addClass("animated fadeIn");
757
758
759                 owl.on('changed.owl.carousel', function (event) {
760
761                     $('.owl-item:not(.active)').siblings().find(".slider-content").removeClass("animated fadeIn");
762                     setTimeout(function () {
763                         $('.owl-item.active .slider-content').addClass("animated fadeIn");
764                     }, 300);
765
766
767                     //stop embed videos if they exists
768                     if ($("#slider-carousel .owl-item.active .slider-content iframe").length) {
769                         var url = $("#slider-carousel .owl-item.active .slider-content iframe").attr("src");
770                         $('iframe').attr('src', '');
771                         $('iframe').attr('src', url);
772
773                     }
774
775                 });
776
777
778
779
780
781             });
782         }
783         // News ticker
784         if ($('.news-ticker-content').exists()) {
785             $('.news-ticker-content').each(function () {
786                 $('.news-ticker-content').owlCarousel({
787                     autoplay: true,
788                     autoplayHoverPause: true,
789                     dots: false,
790                     mouseDrag: true,
791                     touchDrag: true,
792                     margin: 40,
793                     autoWidth: true,
794                     autoplayTimeout: "3000",
795                 });
796
797             });
798         }
799
800         if ($('.tab-carousel').exists()) {
801
802             if ($('.tab-carousel').parent().hasClass('active')) {
803                 $('.tab-carousel').owlCarousel({
804                     navText: ['<i class="fa fa-arrow-left icon-white"></i>',
805                               '<i class="fa fa-arrow-right icon-white"></i>'],
806                     margin: 0,
807                     nav: true,
808                     dots: false,
809                     items: 1
810                 });
811             } else {
812                 $('.tabs-navigation li a').click(function () {
813                     $('.tab-carousel').owlCarousel({
814                         navText: ['<i class="fa fa-arrow-left icon-white"></i>',
815                               '<i class="fa fa-arrow-right icon-white"></i>'],
816                        
816 margin: 0,
817                         nav: true,
818                         dots: false,
819                         items: 1
820                     });
821                 });
822             }
823         }
824
825     };*/
826
827    //----------------------------------------------------/
828    // SMOTH SCROLL NAVIGATION
829    //----------------------------------------------------/
830    INSPIRO.naTo = function () {
831        $('a.scroll-to, a.nav-to').on('click', function () {
832            var $anchor = $(this);
833
834            $('html, body').stop(true, false).animate({
835                scrollTop: $($anchor.attr('href')).offset().top
836            }, 1500, 'easeInOutExpo');
837            return false;
838        });
839
840    };
841
842    //----------------------------------------------------/
843    // GO TO TOP
844    //----------------------------------------------------/
845    INSPIRO.goToTop = function () {
846
847        /*  if ($('.gototop').length > 0) {
848
849              var $goToTop = $('.gototop'),
850                  scrollOffsetFromTop = 800;
851
852              if ($window.scrollTop() > scrollOffsetFromTop) {
853                  $goToTop.fadeIn("slow");
854              } else {
855                  $goToTop.fadeOut("slow");
856              }
857
858              $goToTop.on("click", function () {
859                  $('body,html').stop(true).animate({
860                      scrollTop: 0
861                  }, 1500, 'easeInOutExpo');
862                  return false;
863              });
864          }*/
865
866    };
867
868    //----------------------------------------------------/
869    // LOGO STATUS
870    //----------------------------------------------------/
871    INSPIRO.logoStatus = function () {
872
873        if ($header.hasClass('header-navigation-light') && $window.width() < 991) {
874            logo.find('img').attr('src', logoImg);
875        } else {
876
877            if ($header.hasClass('header-dark')) {
878
879                if (logoDark) {
880                    logo.find('img').attr('src', logoDark);
881                } else {
882                    logo.find('img').attr('src', logoImg);
883                }
884
885            } else {
886                logo.find('img').attr('src', logoImg);
887            }
888        }
889
890    };
891
892    //----------------------------------------------------/
893    // STICKY HEADER
894    //----------------------------------------------------/
895    INSPIRO.stickyHeaderStatus = function () {
896        if ($header.exists()) {
897            var headerOffset = $header.offset().top;
898
899            if ($window.scrollTop() > headerOffset) {
900
901                if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
902
903                    if (!$header.hasClass("header-no-sticky")) {
904                        $header.addClass('header-sticky');
905                    }
906                    if ($header.hasClass('header-navigation-light')) {
907                        logo.find('img').attr('src', logoImg);
908                    }
909                } else {
910                    $header.removeClass('header-sticky');
911                }
912            } else {
913                $header.removeClass('header-sticky');
914            }
915        }
916    };
917
918    INSPIRO.stickyHeader = function () {
919        $window.on('scroll', function () {
920            INSPIRO.logoStatus();
921            INSPIRO.stickyHeaderStatus();
922
923        });
924    };
925
926    //----------------------------------------------------/
927    // TOP BAR
928    //----------------------------------------------------/
929    INSPIRO.topBar = function () {
930        if ($topbar.exists()) {
931            $("#topbar .topbar-dropdown .topbar-form").each(function (index, element) {
932                if ($window.width() - ($(element).width() + $(element).offset().left) < 0) {
933                    $(element).addClass('dropdown-invert');
934                }
935            });
936        }
937    };
938
939    //----------------------------------------------------/
940    // TOP SEARCH
941    //----------------------------------------------------/
942    $("#top-search-trigger").on("click", function () {
943        $body.toggleClass('top-search-active');
944        $topSearch.find('input').focus();
945        return false;
946    });
947
948    //----------------------------------------------------/
949    // MAIN MENU
950    //----------------------------------------------------/
951
952    if (!$body.hasClass('device-lg') || !$body.hasClass('device-md')) {
953
954        if ($mainmenu.hasClass('mega-menu')) {
955            $mainmenuitems.on('click', function () {
956                $(this).parent('ul li').toggleClass("resp-active", 1000, "easeOutSine");
957                return false;
958            });
959            $mainsubmenuitems.on('click', function () {
960                $(this).parent('li').toggleClass('resp-active');
961                return false;
962            });
963        }
964    }
965
966    INSPIRO.menuFix = function () {
967        if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
968            $('ul.main-menu .dropdown:not(.mega-menu-item) ul ul').each(function (index, element) {
969                if ($window.width() - ($(element).width() + $(element).offset().left) < 0) {
970                    $(element).addClass('menu-invert');
971                }
972            });
973        }
974    };
975
976
977
978    INSPIRO.mainMenu = function () {
979
980
981        if ($mainmenu.hasClass("slide-menu")) {
982            $(".nav-main-menu-responsive").addClass("slide-menu-version");
983            $(".lines-button").on("click", function () {
984                $(this).toggleClass("tcon-transform");
985                $(".navigation-wrap").toggleClass("navigation-active");
986                $mainmenu.toggleClass("items-visible");
987            });
988        } else {
989            $(".lines-button").on("click", function () {
990                $(this).toggleClass("tcon-transform");
991                $(".navigation-wrap").toggleClass("navigation-active");
992            });
993        }
994        $(".navigation-wrap").removeClass("navbar-collapse collapse main-menu-collapse");
995    }
996
997    //----------------------------------------------------/
998    // Side panel
999    //----------------------------------------------------/
1000
1001    INSPIRO.sidePanel = function () {
1002        if (sidePanel.exists()) {
1003
1004            if ($body.hasClass("side-panel-static")) {
1005                $body.addClass("side-push-panel side-panel-left side-panel-active");
1006
1007            } else {
1008                $(".side-panel-button button").on("click", function () {
1009                    if ($body.hasClass("side-panel-active")) {
1010                        $body.removeClass("side-panel-active");
1011                    } else {
1012                        $body.addClass("side-panel-active");
1013                    }
1014                    return false;
1015                });
1016
1017                $body.removeClass("side-panel-active");
1018                $body.addClass("side-push-panel side-panel-left");
1019            }
1020
1021        } else {
1022            $body.removeClass("side-push-panel side-panel-left");
1023        }
1024
1025        //Side Panel Dark logo version
1026        if (sidePanel.hasClass('side-panel-dark')) {
1027
1028            if (sidePanellogoDark) {
1029                sidePanellogo.find('img').attr('src', sidePanellogoDark);
1030            } else {
1031                sidePanellogo.find('img').attr('src', sidePanellogoImg);
1032            }
1033
1034        } else {
1035            sidePanellogo.find('img').attr('src', sidePanellogoImg);
1036        }
1037
1038    };
1039    //----------------------------------------------------/
1040    // VERTICAL MENU (DOTS)
1041    //----------------------------------------------------/
1042
1043    INSPIRO.verticalDotMenu = function () {
1044        if (navigationItems.exists()) {
1045            navigationItems.on('click', function () {
1046                navigationItems.removeClass('active');
1047                $(this).addClass('active');
1048                return false;
1049            });
1050        }
1051    };
1052
1053    //----------------------------------------------------/
1054    // FULLSCREEN MENU
1055    //----------------------------------------------------/
1056
1057    INSPIRO.fullScreenPanel = function () {
1058        if (fullScreenPanel.exists()) {
1059            $("#fullscreen-panel-button").on("click", function () {
1060                $body.toggleClass('fullscreen-panel-active');
1061                return false;
1062            });
1063        }
1064    };
1065
1066
1067    //----------------------------------------------------/
1068    // TEXT ROTATOR
1069    //----------------------------------------------------/
1070    INSPIRO.textRotator = function () {
1071        if ($textRotator.exists()) {
1072            $textRotator.each(function () {
1073                var $elem = $(this),
1074                    dataTextSeperator = $elem.attr('data-rotate-separator') || ",",
1075                    dataTextEffect = $elem.attr('data-rotate-effect') || "flipInX",
1076                    dataTextSpeed = $elem.attr('data-rotate-speed') || 2000;
1077
1078                $textRotator.Morphext({
1079                    animation: dataTextEffect,
1080                    separator: dataTextSeperator,
1081                    speed: Number(dataTextSpeed)
1082                });
1083            });
1084        }
1085    };
1086
1087    //----------------------------------------------------/
1088    // ACCORDION
1089    //----------------------------------------------------/
1090    INSPIRO.accordion = function () {
1091        var $accs = $(classFinder + accordionItem);
1092
1093        $accs.length && ($accs.each(function () {
1094            var $item = $(this);
1095
1096            $item.hasClass(itemActive) ? $item.addClass(itemActive) : $item.find(classFinder + itemContent).hide();
1097        }), $(classFinder + itemTitle).on("click", function (e) {
1098
1099            var $link = $(this),
1100                $item = $link.parents(classFinder + accordionItem),
1101                $acc = $item.parents(classFinder + accordionType);
1102
1103            $item.hasClass(itemActive) ? $acc.hasClass(toogleType) ? ($item.removeClass(itemActive), $link.next(classFinder + itemContent).slideUp("fast")) : ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")) : ($acc.hasClass(toogleType) || ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")), $item.addClass(itemActive),
1104                    $link.next(classFinder + itemContent).slideToggle("fast")
1105                ),
1106                e.preventDefault();
1107            return false;
1108        }));
1109
1110        if ($('.carousel').exists()) {
1111            INSPIRO.carouselInspiro();
1112        }
1113
1114    };
1115
1116    /* ---------------------------------------------------------------------------
1117     * TABS
1118     * --------------------------------------------------------------------------- */
1119    INSPIRO.tabs = function () {
1120        var $tabNavigation = $(".tabs-navigation a");
1121        if ($tabNavigation.exists()) {
1122            $tabNavigation.on("click", function (e) {
1123                $(this).tab("show"), e.preventDefault();
1124                return false;
1125            });
1126
1127
1128        }
1129    };
1130
1131    /* ---------------------------------------------------------------------------
1132     * Animations
1133     * --------------------------------------------------------------------------- */
1134    INSPIRO.animations = function () {
1135        if (dataAnimation.exists() && $body.hasClass('device-lg') || $body.hasClass('device-md')) {
1136            dataAnimation.each(function () {
1137                $(this).addClass("animated");
1138                var $elem = $(this),
1139                    animationType = $elem.attr("data-animation") || "fadeIn",
1140                    animationDelay = $elem.attr("data-animation-delay") || 200,
1141                    animationDirection = ~animationType.indexOf("Out") ? "back" : "forward";
1142
1143
1144                if (animationDirection == "forward") {
1145                    $elem.appear(function () {
1146                        setTimeout(function () {
1147                            $elem.addClass(animationType + " visible");
1148                        }, animationDelay);
1149
1150
1151                    }, {
1152                        accX: 0,
1153                        accY: -120
1154                    }, 'easeInCubic');
1155
1156                } else {
1157                    $elem.addClass("visible");
1158                    $elem.on("click", function () {
1159                        $elem.addClass(animationType);
1160                        return false;
1161                    });
1162                }
1163
1164
1165                if ($elem.parents('.demo-play-animations').length) {
1166                    $elem.on("click", function () {
1167                        $elem.removeClass(animationType);
1168                        setTimeout(function () {
1169                            $elem.addClass(animationType);
1170                        }, 50);
1171                        return false;
1172                    });
1173                }
1174            });
1175
1176        }
1177    };
1178
1179    /* ---------------------------------------------------------------------------
1180     * PARALLAX
1181     * --------------------------------------------------------------------------- */
1182    INSPIRO.parallax = function () {
1183        if ($parallax.exists() || $(".page-title-parallax")) {
1184
1185            if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
1186                $.stellar({
1187                    horizontalScrolling: false,
1188                    verticalScrolling: true,
1189                    horizontalOffset: 0,
1190                    verticalOffset: 0,
1191                });
1192
1193            } else {
1194                $parallax.addClass('no-parallax');
1195            }
1196        }
1197    };
1198
1199
1200    /* ---------------------------------------------------------------------------
1201     * RESPONSIVE VIDEOS
1202     * --------------------------------------------------------------------------- */
1203    INSPIRO.resposniveVideos = function () {
1204        if ($().fitVids) {
1205            $("section, .content, .post-content, .ajax-quick-view,#slider:not(.revslider-wrap)").fitVids();
1206        }
1207    };
1208
1209
1210
1211    /* ---------------------------------------------------------------------------
1212     * COUNTER NUMBERS
1213     * --------------------------------------------------------------------------- */
1214    INSPIRO.counters = function () {
1215        if ($counter.exists()) {
1216            $counter.each(function () {
1217                var $elem = $(this);
1218
1219                if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
1220                    $elem.appear(function () {
1221                        $elem.find('span').countTo();
1222                    });
1223                } else {
1224                    var countTo = $elem.find('span').attr('data-to');
1225                    $elem.find('span').html(countTo);
1226                }
1227            });
1228        }
1229    };
1230
1231    /* ---------------------------------------------------------------------------
1232     * COUNTDOWN TIMER
1233     * --------------------------------------------------------------------------- */
1234    INSPIRO.countdownTimer = function () {
1235
1236        if ($countdownTimer.exists()) {
1237            setTimeout(function () {
1238                $('[data-countdown]').each(function () {
1239                    var $this = $(this),
1240                        finalDate = $(this).data('countdown');
1241                    $this.countdown(finalDate, function (event) {
1242                        $this.html(event.strftime('<div class="countdown-container"><div class="countdown-box"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="countdown-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="countdown-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="countdown-box"><div class="number">%S</div><span>Seconds</span></div></div>'));
1243
1244                    });
1245                });
1246            }, 300);
1247        }
1248    };
1249
1250
1251    /* ---------------------------------------------------------------------------
1252     * PROGRESS BARS
1253     * --------------------------------------------------------------------------- */
1254    INSPIRO.progressBar = function () {
1255
1256        if ($progressBar.exists()) {
1257            $progressBar.each(function (i, elem) {
1258                var $elem = $(this),
1259                    percent = $elem.attr('data-percent') || "100",
1260                    delay = $elem.attr('data-delay') || "100",
1261                    type = $elem.attr('data-type') || "%";
1262
1263                if (!$elem.hasClass('progress-animated')) {
1264                    $elem.css({
1265                        'width': '0%'
1266                    });
1267                }
1268
1269                var progressBarRun = function () {
1270                    $elem.animate({
1271                        'width': percent + '%'
1272                    }, 'easeInOutCirc').addClass('progress-animated');
1273
1274                    $elem.delay(delay).append('<span class="progress-type animated fadeIn">' + type + '</span><span class="progress-number animated fadeIn">' + percent + '</span>');
1275                };
1276
1277                if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
1278                    $(elem).appear(function () {
1279                        setTimeout(function () {
1280                            progressBarRun();
1281                        }, delay);
1282                    });
1283                } else {
1284                    progressBarRun();
1285                }
1286
1287
1288
1289
1290
1291            });
1292
1293
1294        }
1295    };
1296
1297    /* ---------------------------------------------------------------------------
1298     * PRI CHARTS
1299     * --------------------------------------------------------------------------- */
1300    INSPIRO.pieChart = function () {
1301
1302        if ($pieChart.exists()) {
1303            $pieChart.each(function () {
1304
1305                var $elem = $(this),
1306                    pieChartSize = $elem.attr('data-size') || "160",
1307                    pieChartAnimate = $elem.attr('data-animate') || "2000",
1308                    pieChartWidth = $elem.attr('data-width') || "6",
1309                    pieChartColor = $elem.attr('data-color') || "#00c0e9",
1310                    pieChartTrackColor = $elem.attr('data-trackcolor') || "rgba(0,0,0,0.10)";
1311
1312                $elem.find('span, i').css({
1313                    'width': pieChartSize + 'px',
1314                    'height': pieChartSize + 'px',
1315                    'line-height': pieChartSize + 'px'
1316                });
1317
1318                $elem.appear(function () {
1319                    $elem.easyPieChart({
1320                        size: Number(pieChartSize),
1321                        animate: Number(pieChartAnimate),
1322                        trackColor: pieChartTrackColor,
1323                        lineWidth: Number(pieChartWidth),
1324                        barColor: pieChartColor,
1325                        scaleColor: false,
1326                        lineCap: 'square',
1327                        onStep: function (from, to, percent) {
1328                            $elem.find('span.percent').text(Math.round(percent));
1329                        }
1330                    });
1331                });
1332            });
1333        }
1334    };
1335
1336    /* ---------------------------------------------------------------------------
1337     * GOOGLE MAPS
1338     * --------------------------------------------------------------------------- */
1339    INSPIRO.maps = function () {
1340
1341        if ($map.exists()) {
1342
1343
1344            $map.each(function () {
1345
1346                var $elem = $(this),
1347                    mapAddress = $elem.attr('data-map-address') ? $elem.attr('data-map-address') : "Melbourne, Australia",
1348                    mapType = $elem.attr('data-map-type') ? $elem.attr('data-map-type') : "ROADMAP",
1349                    mapZoom = $elem.attr('data-map-zoom') ? $elem.attr('data-map-zoom') : "14",
1350                    mapIcon = $elem.attr('data-map-icon') ? $elem.attr('data-map-icon') : "images/markers/marker2.png";
1351
1352                var markers = [{
1353                    address: mapAddress,
1354                    html: mapAddress,
1355                    icon: {
1356                        image: mapIcon,
1357                        iconsize: [40, 63],
1358                        iconanchor: [18, 60],
1359                    },
1360                    }];
1361
1362                $elem.gMap({
1363
1364                    address: mapAddress,
1365                    maptype: mapType,
1366                    markers: markers,
1367                    zoom: Number(mapZoom),
1368                    doubleclickzoom: true,
1369                    controls: {
1370                        panControl: true,
1371                        zoomControl: true,
1372                        mapTypeControl: false,
1373                        scaleControl: true,
1374                        streetViewControl: false,
1375                        overviewMapControl: true
1376                    },
1377                    styles: [{
1378                        featureType: "poi",
1379                        elementType: "labels",
1380                        stylers: [{
1381                            visibility: "off"
1382                        }]
1383                    }]
1384
1385                });
1386            });
1387
1388        }
1389    };
1390
1391    /* ---------------------------------------------------------------------------
1392     * MASONRY ISOTOPE
1393     * --------------------------------------------------------------------------- */
1394    INSPIRO.masonryIsotope = function () {
1395
1396        var $isotops = $(".isotope");
1397        $isotops.each(function () {
1398            var isotopeTime,
1399                $elem = $(this),
1400                defaultFilter = $elem.data("isotopeDefaultFilter") || 0,
1401                id = $elem.attr("id"),
1402                mode = $elem.attr('data-isotope-mode') || "masonry",
1403                columns = $elem.attr('data-isotope-col') || "4",
1404                $elemContainer = $elem,
1405                itemElement = $elem.attr('data-isotope-item') || ".isotope-item",
1406                itemElementSpace = $elem.attr('data-isotope-item-space') || 0;
1407
1408
1409            $elem.isotope({
1410                    filter: defaultFilter,
1411                    itemSelector: itemElement,
1412                    layoutMode: mode,
1413                    transitionDuration: '0.6s',
1414                    resizesContainer: true,
1415                    resizable: true,
1416                    animationOptions: {
1417                        duration: 400,
1418                        queue: !1
1419                    }
1420
1421                }),
1422
1423                $window.resize(function () {
1424
1425
1426                    $elemContainer.css('margin-right', '-' + itemElementSpace + '%');
1427
1428                    if ($body.hasClass('device-sm') || $body.hasClass('device-xs')) {
1429                        itemWidth(2, $elemContainer, itemElement, itemElementSpace);
1430                    } else if ($body.hasClass('device-xxs')) {
1431                        itemWidth(1, $elemContainer, itemElement, itemElementSpace);
1432                    } else {
1433                        itemWidth(columns, $elemContainer, itemElement, itemElementSpace);
1434                    }
1435
1436                    if (columns == 1 && $body.hasClass('device-sm') || columns == 1 && $body.hasClass('device-xs')) {
1437                        itemWidth(1, $elemContainer, itemElement, itemElementSpace);
1438                    }
1439
1440                    clearTimeout(isotopeTime), isotopeTime = setTimeout(function () {
1441                        $elem.isotope("layout");
1442                    }, 300);
1443                });
1444
1445
1446
1447
1448            var $menu = $('[data-isotope-nav="' + id + '"]');
1449
1450            $menu.length && $menu.find("li:not('.link-only')").on("click", function (e) {
1451                var $link = $(this);
1452
1453                $(".filter-active-title").empty().append($link.text());
1454
1455                if (!$link.hasClass("ptf-active")) {
1456                    var selector = $link.attr("data-filter");
1457                    $link.parents(".portfolio-filter").eq(0).find(".ptf-active").removeClass("ptf-active"), $link.addClass("ptf-active"), $elem.isotope({
1458                        filter: selector
1459                    });
1460                }
1461
1462                e.preventDefault();
1463                return false;
1464            }), $window.resize();
1465
1466
1467        });
1468
1469    };
1470
1471    // Intellegent Grid
1472    var itemWidth = function (columns, $elemContainer, itemElement, itemElementSpace) {
1473
1474        var $findElement = $elemContainer.find(itemElement);
1475        var $findElementLarge = $elemContainer.find(".large-item");
1476
1477        var itemElementMargins = {
1478            "margin-right": itemElementSpace + "%",
1479            "margin-bottom": itemElementSpace + "%",
1480        };
1481
1482        if (columns == 1) {
1483            $findElement.width('100%');
1484            $findElementLarge.width('100%');
1485        }
1486
1487        if (columns == 2) {
1488            $findElement.width(50 - itemElementSpace + '%').css(itemElementMargins);
1489            $findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins);
1490        }
1491
1492        if (columns == 3) {
1493            $findElement.width(33.33 - itemElementSpace + '%').css(itemElementMargins);
1494            $findElementLarge.width(66.66 - itemElementSpace + '%').css(itemElementMargins);
1495        }
1496
1497        if (columns == 4) {
1498            $findElement.width(25 - itemElementSpace + '%').css(itemElementMargins);
1499            $findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins);
1500        }
1501
1502        if (columns == 5) {
1503            $findElement.width(20 - itemElementSpace + '%').css(itemElementMargins);
1504            $findElementLarge.width(40 - itemElementSpace + '%').css(itemElementMargins);
1505        }
1506
1507        if (columns == 6) {
1508            $findElement.width(16.666666 - itemElementSpace + '%').css(itemElementMargins);
1509            $findElementLarge.width(33.333333 - itemElementSpace + '%').css(itemElementMargins);
1510        }
1511
1512
1513
1514    };
1515
1516
1517
1518    /* ---------------------------------------------------------------------------
1519     * TOOLTIPS
1520     * --------------------------------------------------------------------------- */
1521    INSPIRO.tooltip = function () {
1522
1523        var $tooltip = $('[data-toggle="tooltip"]');
1524        if ($tooltip.exists()) {
1525            $('[data-toggle="tooltip"]').tooltip();
1526        }
1527
1528    };
1529
1530    /* ---------------------------------------------------------------------------
1531     * POPOVER
1532     * --------------------------------------------------------------------------- */
1533    INSPIRO.popover = function () {
1534
1535        var $popover = $('[data-toggle="popover"]');
1536        if ($popover.exists()) {
1537            $('[data-toggle="popover"]').popover({
1538                container: 'body',
1539                html: true
1540            });
1541
1542        }
1543
1544    };
1545
1546    /* ---------------------------------------------------------------------------
1547     * LIGHTBOX
1548     * --------------------------------------------------------------------------- */
1549    INSPIRO.lightBoxInspiro = function () {
1550
1551        if ($lightbox_image.exists()) {
1552            $lightbox_image.magnificPopup({
1553                type: 'image'
1554            });
1555        }
1556
1557        if ($lightbox_gallery.exists()) {
1558            $lightbox_gallery.each(function () {
1559                $(this).magnificPopup({
1560                    delegate: 'a[data-lightbox="gallery-item"]',
1561                    type: 'image',
1562                    gallery: {
1563                        enabled: true
1564                    }
1565                });
1566            });
1567        }
1568
1569        if ($lightbox_iframe.exists()) {
1570            $lightbox_iframe.each(function () {
1571                $(this).magnificPopup({
1572                    type: 'iframe'
1573                });
1574            });
1575        }
1576
1577        if ($lightbox_ajax.exists()) {
1578            $lightbox_ajax.each(function () {
1579                $(this).magnificPopup({
1580                    type: 'ajax',
1581                    callbacks: {
1582                        ajaxContentAdded: function (mfpResponse) {
1583                            INSPIRO.carouselInspiro();
1584                            INSPIRO.resposniveVideos();
1585                            INSPIRO.accordion();
1586                        }
1587                    }
1588                });
1589            });
1590        }
1591    };
1592
1593
1594    /* ---------------------------------------------------------------------------
1595     * FLICKR WIDGET
1596     * --------------------------------------------------------------------------- */
1597    INSPIRO.widget_twitter = function () {
1598
1599        if ($widget_twitter.exists()) {
1600            $widget_twitter.each(function () {
1601
1602                var $elem = $(this),
1603                    twitterUser = $elem.attr('data-username') || 'ardianmusliu',
1604                    twitterLimit = $elem.attr('data-limit') || 2,
1605                    twitterProfileImage = $elem.attr('data-profile-image') || false,
1606                    twitterTime = $elem.attr('data-time') || true,
1607                    twitterActions = $elem.attr('data-actions') || false;
1608
1609                $elem.tweecool({
1610                    username: twitterUser,
1611                    limit: twitterLimit,
1612                    profile_image: twitterProfileImage,
1613                    show_actions: twitterActions,
1614                    show_time: twitterTime
1615                });
1616            });
1617
1618
1619            /* username : Your username
1620             limit  : Number of tweets to show (Default value: 5)
1621             profile_image :  Show profile image (Default value: true)
1622             show_time : Show tweet time (Default value: true)
1623             show_media : Show media (Default value: false)
1624             show_media_size : Set media size (Default value: thumb)
1625             show_actions : Show action box such as 'reply', 'retweet' and 'favorite' (Default value: false)
1626             action_reply_icon : Reply icon, add your HTML tags or ASCII code (Default value: '&crarr;')
1627             action_retweet_icon : Retweet icon, add your HTML tags or ASCII code (Default value: &prop;)
1628             action_favorite_icon : Favorite icon, add your HTML tags or ASCII code (Default value: '&#10084')
1629             profile_img_url : If set to 'tweet' the profile image will have tweet URL, otherwise it will be the user's profile URL (Default value: profile)
1630             show_retweeted_text : if set to 'true', this will show the original retweeted text and avoid any truncated text (Default value: false)
1631             */
1632        }
1633    };
1634
1635
1636    /* ---------------------------------------------------------------------------
1637     * FLICKR WIDGET
1638     * --------------------------------------------------------------------------- */
1639    INSPIRO.flickr_widget = function () {
1640
1641        if ($flickr_widget.exists()) {
1642            $flickr_widget.each(function () {
1643
1644                var $elem = $(this),
1645                    $flickrId = $elem.attr('data-flickr-id') || "52617155@N08",
1646                    $flickrImages = $elem.attr('data-flickr-images') || "9";
1647
1648                $flickr_widget.jflickrfeed({
1649                    limit: $flickrImages,
1650                    qstrings: {
1651                        id: $flickrId
1652                    },
1653                    itemTemplate: '<a href="{{image}}" title="{{title}}"><img src="{{image_s}}" alt="{{title}}" /></a>'
1654                }, function () {
1655                    $elem.magnificPopup({
1656                        delegate: 'a',
1657                        type: 'image',
1658                        gallery: {
1659                            enabled: true
1660                        }
1661                    });
1662                });
1663            });
1664        }
1665    };
1666
1667    /* ---------------------------------------------------------------------------
1668     * YOUTUBE BACKGROUND PLAYER
1669     * --------------------------------------------------------------------------- */
1670    INSPIRO.youTubeBgPlayer = function () {
1671
1672        if ($ytPlayer.exists()) {
1673            $ytPlayer.each(function () {
1674
1675
1676                var elem = $(this),
1677                    ytPlayerVideo = elem.attr('data-youtube-url') || null,
1678                    ytPlayerMute = elem.attr('data-youtube-mute') || false,
1679                    ytPlayerRatio = elem.attr('data-youtube-ratio') || '16/9',
1680                    ytPlayerQuality = elem.attr('data-youtube-quality') || 'hd720',
1681                    ytPlayerOpacity = elem.attr('data-youtube-opacity') || 1,
1682                    ytPlayerContainer = elem.attr('data-youtube-container') || 'self',
1683                    ytPlayerOptimize = elem.attr('data-youtube-optimize') || true,
1684                    ytPlayerLoop = elem.attr('data-youtube-loop') || true,
1685                    ytPlayerVolume = elem.attr('data-youtube-volume') || 1,
1686                    ytPlayerStart = elem.attr('data-youtube-start') || 0,
1687                    ytPlayerStop = elem.attr('data-youtube-stop') || 0,
1688                    ytPlayerAutoPlay = elem.attr('data-youtube-autoplay') || false,
1689                    ytPlayerFullScreen = elem.attr('data-youtube-fullscreen') || true,
1690                    ytPlayerControls = elem.attr('data-youtube-control
1690s') || false,
1691                    ytPlayerLogo = elem.attr('data-youtube-controls') || false,
1692                    ytPlayerAutoPause = elem.attr('data-youtube-autopause') || false;
1693
1694
1695                elem.mb_YTPlayer({
1696                    videoURL: ytPlayerVideo,
1697                    mute: ytPlayerMute,
1698                    ratio: ytPlayerRatio,
1699                    quality: ytPlayerQuality,
1700                    opacity: ytPlayerOpacity,
1701                    containment: ytPlayerContainer,
1702                    optimizeDisplay: ytPlayerOptimize,
1703                    loop: ytPlayerLoop,
1704                    vol: ytPlayerVolume,
1705                    startAt: ytPlayerStart,
1706                    stopAt: ytPlayerStop,
1707                    autoPlay: ytPlayerAutoPlay,
1708                    realfullscreen: ytPlayerFullScreen,
1709                    showYTLogo: ytPlayerLogo,
1710                    showControls: ytPlayerControls
1711                });
1712
1713
1714
1715
1716                if (!ytPlayerAutoPlay) {
1717                    elem.find("#youtube-background-controls").addClass("video-is-playing");
1718                }
1719
1720                elem.on("YTPReady", function () {
1721                    $("#youtube-background-controls").on("click", function () {
1722
1723                        if (!$(this).hasClass("video-is-playing")) {
1724                            $(this).addClass("video-is-playing");
1725                            $ytPlayer.YTPPause();
1726                        } else {
1727                            $(this).removeClass("video-is-playing");
1728                            $ytPlayer.YTPPlay();
1729                        }
1730                        return false;
1731                    });
1732
1733                    var elemContainerHeight = elem.height();
1734
1735                    if (ytPlayerAutoPause) {
1736                        $window.on('scroll', function () {
1737                            if ($window.scrollTop() > elemContainerHeight) {
1738                                $("#youtube-background-controls").addClass("video-is-playing");
1739                                $ytPlayer.YTPPause();
1740                            }
1741
1742                        });
1743
1744                    }
1745
1746                });
1747
1748
1749
1750
1751            });
1752        }
1753    }
1754
1755    //----------------------------------------------------/
1756    // Mouse Scroll
1757    //----------------------------------------------------/
1758    INSPIRO.mouseScroll = function () {
1759
1760        if ($body.hasClass('mouse-scroll') && $window.width() > 767) {
1761
1762            var $offset = 0;
1763
1764            if ($header.hasClass('header-transparent')) {
1765                $offset = -$header.height() - 20;
1766            }
1767
1768            $.scrollify({
1769                section: "section",
1770                sectionName: "section-name",
1771                scrollSpeed: 1100,
1772                offset: $offset,
1773                scrollbars: true,
1774            });
1775        }
1776    }
1777
1778    //Window load functions
1779    $window.load(function () {
1780        INSPIRO.progressBar(),
1781            INSPIRO.pieChart(),
1782            INSPIRO.carouselInspiro(),
1783            INSPIRO.masonryIsotope(),
1784            INSPIRO.animations(),
1785            INSPIRO.menuFix()
1786
1787    });
1788
1789
1790    //Document ready functions
1791    $document.ready(
1792        INSPIRO.loader(),
1793        INSPIRO.responsiveClasses(),
1794        INSPIRO.mainMenu(),
1795        INSPIRO.stickyHeader(),
1796        INSPIRO.logoStatus(),
1797        INSPIRO.verticalDotMenu(),
1798        INSPIRO.mouseScroll(),
1799        INSPIRO.screenSizeControl(),
1800        INSPIRO.parallax(),
1801        INSPIRO.naTo(),
1802        INSPIRO.sidePanel(),
1803        INSPIRO.fullScreenPanel(),
1804        INSPIRO.textRotator(),
1805        INSPIRO.accordion(),
1806        INSPIRO.tabs(),
1807        INSPIRO.counters(),
1808        INSPIRO.countdownTimer(),
1809        INSPIRO.youTubeBgPlayer(),
1810        INSPIRO.maps(),
1811        INSPIRO.lightBoxInspiro(),
1812        INSPIRO.resposniveVideos(),
1813        INSPIRO.tooltip(),
1814        INSPIRO.popover(),
1815        INSPIRO.widget_twitter(),
1816        INSPIRO.flickr_widget(),
1817        INSPIRO.goToTop(),
1818        INSPIRO.topBar(),
1819        INSPIRO.inspiroSlider(),
1820        INSPIRO.sliderHeighControl()
1821    );
1822
1823    //Document resize functions
1824    $window.resize(function () {
1825        INSPIRO.logoStatus(),
1826            INSPIRO.screenSizeControl(),
1827            INSPIRO.sliderHeighControl(),
1828            INSPIRO.menuFix()
1829    });
1830
1831    //Document scrool functions
1832    $window.scroll(function () {
1833        INSPIRO.goToTop()
1834    });
1835
1836
1837
1838})(jQuery);

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.