PageSourceSearch

https://criugm.qc.ca/wp-content/themes/criugm%20-%202022-11-07/js/mad.app.js

js criugm.qc.ca collected 2026-10-02 11:25:49 UTC 144,478 bytes, 3,897 lines download raw bytes

1var Mad = (function($){
2    'use strict';
3
4    var App = {},
5        DOMDfd = $.Deferred(),
6        $body = $('body'),
7        $doc = $(document);
8
9    App.modules = {};
10    App.helpers = {};
11    App._localCache = {};
12
13    App.ISTOUCH = Modernizr.touchevents;
14    App.ANIMATIONDURATION = 500;
15    App.ANIMATIONEASING = 'easeOutQuart';
16    App.ANIMATIONSUPPORTED = Modernizr.cssanimations;
17    App.ANIMATIONEND = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
18    App.RTL = getComputedStyle(document.body).direction === 'rtl';
19    App.ISLEGACYBROWSER = !Modernizr.flexbox;
20    App.ISFIREFOX = window.navigator.userAgent.indexOf('Firefox') != -1;
21
22    App.afterDOMReady = function() {
23        var self = this;
24
25        if (this.ISFIREFOX) window.onunload = function(){};
26
27        // Show message to update legacy browser
28        if(this.ISLEGACYBROWSER) {
29            if(this.helpers.showCriticalFullScreenMessage) {
30                this.helpers.showCriticalFullScreenMessage({
31                    before: '<i class="icon icon-sad"></i>',
32                    content: 'Your browser does not support some technologies this site use. Please update your browser or visit the site using more modern browser.'
33                });
34            }
35
36            // Anyway preloader must be used
37            //if(this.modules.preloader) this.modules.preloader();
38
39            return;
40        }
41
42        if(this.modules.backToTop) {
43			this.modules.backToTop({
44				easing: 'easeOutQuint',
45				speed: 550,
46				cssPrefix: 'mad-'
47			});
48        }
49
50        if(this.helpers.toggledFields) this.helpers.toggledFields();
51
52        if(window.MadEventsCalendar) window.MadEventsCalendar.init($('.mad-events-calendar'), {
53            isTouch: self.ISTOUCH,
54            cssPrefix: 'mad-',
55            breakpoint: 768
56        });
57
58
59        if(window.MadSidebarHidden) {
60            new window.MadSidebarHidden({
61                cssPrefix: 'mad-'
62            });
63        }
64
65        if(window.MadStickyHeaderSection) {
66            var $stickySections = $('[class*="mad-header-section--sticky"]:not([class*="mad-header-section--sticky-hidden"])');
67
68            if($stickySections.length) {
69                new window.MadStickyHeaderSection($stickySections, {
70                    animationEasing: self.ANIMATIONEASING,
71                    animationDuration: self.ANIMATIONDURATION
72                });
73            }
74        }
75
76        if(this.modules.dropdown) this.modules.dropdown.init();
77
78        if(this.modules.fancyboxAlbum) this.modules.fancyboxAlbum.init();
79
80        if(this.modules.hiddenFilters) this.modules.hiddenFilters();
81
82        if(this.modules.fieldCounter) this.modules.fieldCounter();
83
84        if(this.modules.fieldDatepicker) this.modules.fieldDatepicker();
85
86        if(this.modules.WPGallery) this.modules.WPGallery.init($('.gallery'));
87
88        if(this.modules.bgMove) this.modules.bgMove();
89
90        if(this.modules.closeBtn) this.modules.closeBtn();
91
92        if(this.modules.hiddenSections) this.modules.hiddenSections();
93
94        if(this.helpers.bookingFormV2V4) this.helpers.bookingFormV2V4();
95        if(this.helpers.bookingFormV3) this.helpers.bookingFormV3();
96        if(this.helpers.calendarWidget) this.helpers.calendarWidget();
97
98        var $datepickers = $('.mad-datepicker'),
99            borderBottomDatepickerContainers = '.mad-booking-form--style-2';
100
101        if($datepickers.length && $.fn.datepicker) {
102            $datepickers.datepicker({
103                showOtherMonths: true,
104                selectOtherMonths: true,
105                isRTL: self.RTL,
106                dayNamesMin: ["S", "M", "T", "W", "T", "F", "S"],
107                prevText: self.RTL ? '<i class="icon licon-arrow-right"></i>' : '<i class="icon licon-arrow-left"></i>',
108                nextText: self.RTL ? '<i class="icon licon-arrow-left"></i>' : '<i class="icon licon-arrow-right"></i>',
109                beforeShow: function(input, instance) {
110                    var $input = $(input);
111
112                    if($input.closest(borderBottomDatepickerContainers
112).length) {
113                        instance.dpDiv.addClass('ui-datepicker--bordered-container');
114                    }
115                    else {
116                        instance.dpDiv.removeClass('ui-datepicker--bordered-container');
117                    }
118                }
119            });
120        }
121
122        var $selects = $('.mad-custom-select2');
123
124        if($selects.length && $.fn.select2) {
125            $selects.select2({
126                width: '100%',
127                theme: 'mad',
128                dir: self.RTL ? 'rtl' : 'ltr'
129            });
130        }
131
132        /* ------------------------------------------------
133			Range Slider
134		------------------------------------------------ */
135
136            var $rangeSliders = $('.mad-range-slider');
137
138            if($.fn.slider && $rangeSliders.length) {
139                $rangeSliders.slider({
140                    range: true,
141                    min: 0,
142                    max: 115,
143                    values: [10, 99],
144                    slide: function(event, ui) {
145                        var $range = $(ui.handle).closest('.mad-range-slider'),
146                            $input = $range.siblings('.mad-range-slider-input');
147
148                        if($range.length && $input.length) {
149                            $input.attr('value', '$' + $range.slider('values', 0) + ' - ' + '$' + $range.slider('values', 1))
150                                .val('Price:' + '$' + $range.slider('values', 0) + ',000' + ' - ' + '$' + $range.slider('values', 1) + ',000');
151                        }
152                    }
153                });
154            }
155
156        /* ------------------------------------------------
157			End of Range Slider
158		------------------------------------------------ */
159
160        /* ------------------------------------------------
161			Twitter
162		------------------------------------------------ */
163
164            var $twitterFeed = $('.mad-twitter-feed');
165
166            if($twitterFeed.length && $.fn.tweetie) {
167                $twitterFeed.tweetie({
168                    url: 'http://velikorodnov.com/html/ewent/vendors/tweetie/api/php/server.php',
169                    type: 'timeline',
170                    template: '<li>\
171                        <div class="mad-tweet">\
172                            <div class="mad-tweet-content">{{tweet.text}}</div>\
173                             \
174                        </div>\
175                    </li>',
176                    dateFormat: '%B %d, %Y',
177                    params: {
178                        count: 2,
179                        screen_name: null,
180                        list_id: null,
181                        slug: null,
182                        q: null,
183                        exclude_replies: false,
184                        include_rts: false
185                    }
186                })
187            }
188
189        /* ------------------------------------------------
190			End of Twitter
191		------------------------------------------------ */
192
193
194        /* ------------------------------------------------
195			Custom Select
196		------------------------------------------------ */
197
198            var $selects = $('.mad-custom-select');
199
200            if($selects.length){
201                $selects.MadCustomSelect({
202                    cssPrefix: 'mad-'
203                });
204            }
205
206		/* ------------------------------------------------
207			End of Custom Select
208		------------------------------------------------ */
209
210
211        /* ------------------------------------------------
212            Newsletter Form
213        ------------------------------------------------ */
214
215            var newsletterForm = $('.mad-newsletter-form');
216
217            if(newsletterForm.length && window.MadNewsletter) {
218                window.MadNewsletter(newsletterForm);
219            }
220
221        /* ------------------------------------------------
222            End of Newsletter Form
223        ------------------------------------------------ */
224
225        /* ------------------------------------------------
226            Contact Form
227        ------------------------------------------------ */
228
229            var contactForm = $('.mad-contact-form');
230
231            if(contactForm.length && window.MadContactForm) {
232                MadContactForm.init(contactForm);
233            }
234
235        /* ------------------------------------------------
236            End of Contact Form
237        ------------------------------------------------ */
238
239        /* ----------------------------------------
240             Fancybox
241         ---------------------------------------- */
242
243            if($.fancybox && $.fancybox.defaults) {
244                $.extend($.fancybox.defaults, {
245                    transitionEffect: "slide",
246                    transitionDuration: self.ANIMATIONDURATION,
247                    animationDuration: self.ANIMATIONDURATION
248                });
249            }
250
251        /* ----------------------------------------
252             End of Fancybox
253         ---------------------------------------- */
254
255        if(this.modules.arcticModals) this.modules.arcticModals.init( $('[data-arctic-modal]') );
256
257        /* ------------------------------------------------
258				Navigation
259		------------------------------------------------ */
260
261            var $nav = $('.mad-navigation'),
262                $verticalNav = $('.mad-navigation-vertical');
263
264            if($nav.length){
265                $nav.MonkeysanNav({
266                    cssPrefix: 'mad-'
267                });
268
269                $nav.on('submenumobileopened.jquery.nav', function() {
270                    self.LinkUnderliner.toUnderline($(this).find('a'));
271                });
272            }
273
274            if($verticalNav.length){
275                $verticalNav.MonkeysanNav({
276					cssPrefix: 'mad-',
277					mobileBreakpoint: 10000
278                });
279                $verticalNav.on('submenumobileopened.jquery.nav', function() {
280                    self.LinkUnderliner.toUnderline($(this).find('a'));
281                });
282            }
283
284        /* ------------------------------------------------
285				End of Navigation
286		------------------------------------------------ */
287
288        /* ------------------------------------------------
289				Custom Scrollbar
290		------------------------------------------------ */
291
292            var $customScrollbar = $('.mad-sidebar-hidden .mad-sidebar-hidden-content .mad-navigation-container'),
293                $customScrollbarVerticalNav = $customScrollbar.children('.mad-navigation-vertical'),
294                $customScrollbar2 = $('.mad-sidebar-hidden--v2');
295            if($customScrollbar.length && $.fn.niceScroll) {
296                $customScrollbar.niceScroll({
297                    scrollspeed: 60,
298                    mousescrollstep: 40,
299                    cursorwidth: 2,
300                    cursorborder: 0,
301                    rtlmode: self.RTL,
302                    railalign: self.RTL ? 'left': 'right',
303                    cursorborderradius: 0,
304                    cursorcolor: "#1c1c1c",
305                    autohidemode: false,
306                    horizrailenabled: false
307                });
308
309                if($customScrollbarVerticalNav.length) {
310                    $customScrollbarVerticalNav.on('navigationopening.jquery.nav submenumobileopening.jquery.nav submenumobileclosing.jquery.nav', function() {
311                        $customScrollbar.getNiceScroll().resize();
312                    });
313                }
314            }
315
316            if($customScrollbar2.length && $.fn.niceScroll) {
317
318                $customScrollbar2.niceScroll({
319                    scrollspeed: 60,
320                    mousescrollstep: 40,
321                    cursorwidth: 2,
322                    cursorborder: 0,
323                    rtlmode: self.RTL,
324                    railalign: self.RTL ? 'left': 'right',
325                    cursorborderradius: 0,
326                    cursorcolor: "#1c1c1c",
327                    autohidemode: false,
328                    horizrailenabled: false
329                });
330            }
331
332            setTimeout(function() {
333                $customScrollbar2.getNiceScroll().resize();
334            }, self.ANIMATIONDURATION);
335
336        /* ------------------------------------------------
337				End of Custom Scrollbar
338		------------------------------------------------ */
339
340        /* ------------------------------------------------
341				Countdown
342		------------------------------------------------ */
343
344			var $countdown = $('.mad-countdown');
345
346			if($countdown.length){
347				$countdown.each(function(){
348					var $this = $(this),
349						endDate = $this.data(),
350						until = new Date(
351							endDate.year,
352							endDate.month || 0,
353							endDate.day || 1,
354							endDate.hours || 0,
355							endDate.minutes || 0,
356							endDate.seconds || 0
357						);
358
359					$this.countdown({
360						until : until,
361						padZeroes: true,
362						format : 'dHMS',
363						labels : ['Years', 'Month', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
364						labels1 : ['Years', 'Month', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds']
365					});
366				});
367			}
368
369		/* ------------------------------------------------
370				End countdown
371		------------------------------------------------ */
372
373        /* ------------------------------------------------
374				Instagram
375		------------------------------------------------ */
376
377            if(window.InstafeedWrapper) {
378                var instafeeds = document.querySelectorAll('.mad-instafeed > .mad-grid'),
379                    galleryInstafeeds = document.querySelectorAll('.mad-instafeed-gallery');
380
381                InstafeedWrapper.setUsersSecureOptions({
382                    'customer': {
383                        userId: 8253949243,
384                        accessToken: '8253949243.1677ed0.92a1c427f7274134a812ee9b13038e10',
385                        clientId: 'a17ccf850aae43a0805c00ac4792a3b9'
386                    }
387                });
388
389                if(instafeeds) {
390                    InstafeedWrapper.init(instafeeds, {
391                        resolution: 'standard_resolution',
392                        template: '<div class="mad-grid-item"><div class="mad-square-image" data-bg-image-src="{{image}}"><a class="mad-ln--independent" rel="instagram" href="{{link}}" target="_blank" title="{{caption}}"></a></div></div>',
393                        after: function(){
394                            var $target = $('#' + this.options.target),
395                                size = $target.data('images-y-size'),
396                                posX = $target.data('images-pos-x') || 'center',
397                                posY = $target.data('images-pos-y') || 'center',
398                                $items = $target.find('.mad-square-image');
399
400                            if($items.length) {
401
402                                $items.addClass('mad-square-image--position-' + posX + '-' + posY);
403
404                                if(size) $items.addClass('mad-square-image--size-' + size);
405                            }
406
407                            self.helpers.dynamicBgImage($target.find('[data-bg-image-src]'));
408                            self.helpers.updateGlobalNiceScroll();
409                        }
410                    });
411                }
412
413                if(galleryInstafeeds) {
414                    InstafeedWrapper.init(galleryInstafeeds, {
415                        resolution: 'standard_resolution',
416                        template: '<div class="mad-grid-item">\
417                            <figure class="mad-gallery-item mad-gallery-item--with-thumb" data-bg-image-src="{{image}}">\
418                                <a data-fancybox-gallery data-caption="{{caption}}" href="{{image}}" title="{{caption}}" class="mad-gallery-item-link mad-ln--independent">\
419                                    <img src="{{image}}" alt="{{caption}}" class="mad-d-none">\
420                                </a>\
421                                <figcaption class="mad-gallery-item-caption">{{caption}}</figure>\
422                            </figure>\
423                        </div>\
424                        ',
425                        after: function() {
426                            var $container = $('#' + this.options.target),
427                                $fancyboxItems = $container.find('[data-fancybox-gallery]'),
428                                $bgItems = $container.find('[data-bg-image-src]');
429
430                            if($fancyboxItems.length && $.fn.fancybox) {
431                                $fancyboxItems.attr('data-fancybox', this.options.target).fancybox({
432                                    animationEffect: "fade"
433                                });
434                            }
435
436                            if($bgItems.length) {
437                                self.helpers.dynamicBgImage($bgItems);
438                            }
439                            self.helpers.updateGlobalNiceScroll();
440                        }
441                    });
442                }
443            };
444
445        /* ------------------------------------------------
446				End of Instagram
447		------------------------------------------------ */
448
449        /* ------------------------------------------------
450				Revolution slider
451		------------------------------------------------ */
452
453            var $revSlider1 = $('#rev-slider-1'),
454                $revSlider2 = $('#rev-slider-2'),
455                $revSlider3 = $('#rev-slider-3'),
456                revApi1,
457                revApi2,
458                revApi3;
459
460            if($revSlider1.length && $.fn.revolution) {
461                revApi1 = $revSlider1.show().revolution({
462
463					sliderType: "standard",
464					sliderLayout: "fullwidth",
465					dottedOverlay: "none",
466					delay: 5000,
467                    disableProgressBar: "on",
468                    spinner: 'spinner3',
469                    gridwidth: [1400, 1024, 1024, 580],
470                    gridheight: [550, 450, 400, 300],
471                    responsiveLevels: [1400, 1024, 813, 580],
472                });
473
474                revApi1.on('revolution.slide.onchange', function() {
475                    self.helpers.updateGlobalNiceScroll();
476                });
477            }
478
479            if($revSlider2.length && $.fn.revolution) {
480                revApi2 = $revSlider2.show().revolution({
481                    fullScreenOffsetContainer: ($(window).width() > 767 && $(window).height() > 600) ? '#mad-header:not(.mad-header--transparent-single)' : '',
482                    sliderLayout: 'fullwidth',
483                    dottedOverlay: 'mad',
484                    disableProgressBar: "on",
485                    spinner: 'spinner3',
486                    gridwidth: [1400, 1024, 813, 580],
487                    gridheight: [1080, 1024, 813, 813],
488                    responsiveLevels: [1400, 1024, 813, 580],
489                    parallax: {
490                        type: 'mouse',
491                        origo: 'slidercenter',
492                        speed: 400,
493                        levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 51, 55],
494                        disable_onmobile: 'on'
495                    }
496                });
497
498                revApi2.on('revolution.slide.onchange', function () {
499                    self.helpers.updateGlobalNiceScroll();
500                });
501            }
502
503            if ($revSlider3.length && $.fn.revolution) {
504                revApi3 = $revSlider3.show().revolution({
505                    fullScreenOffsetContainer: ($(window).width() > 767 && $(window).height() > 600) ? '#mad-header:not(.mad-header--transparent-single)' : '',
506                 
507                    dottedOverlay: 'mad',
508                    disableProgressBar: "on",
509                    spinner: 'spinner3',
510                    gridwidth: [1380, 1024, 813, 580],
511                    gridheight: [945, 945, 813, 580],
512                    responsiveLevels: [1380, 1024, 813, 580],
513                    parallax: {
514                        type: 'mouse',
515                        origo: 'slidercenter',
516                        speed: 400,
517                        levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 51, 55],
518                        disable_onmobile: 'on'
519                    }
520                });
521
522                revApi3.on('revolution.slide.onchange', function () {
523                    self.helpers.updateGlobalNiceScroll();
524                });
525            }
526
527            if(this.helpers.revArrowsOutside) this.helpers.revArrowsOutside();
528			
529
530			$("#rev_slider_corporate").show().revolution({
531				sliderType: "standard",
532				sliderLayout: "fullwidth",
533				dottedOverlay: "none",
534				delay: 5000,
535				navigation: {
536					keyboardNavigation: "off",
537					keyboard_direction: "horizontal",
538					mouseScrollNavigation: "off",
539					mouseScrollReverse: "default",
540					onHoverStop: "off",
541					arrows: {
542						style: "uranus",
543						enable: true,
544						hide_onmobile: false,
545						hide_onleave: false,
546						tmp: '',
547						left: {
548							h_align: "left",
549							v_align: "center",
550							h_offset: 20,
551							v_offset: 0
552						},
553						right: {
554							h_align: "right",
555							v_align: "center",
556							h_offset: 20,
557							v_offset: 0
558						}
559					},
560					bullets: {
561						enable: true,
562						hide_onmobile: false,
563						style: "uranus",
564						hide_onleave: false,
565						direction: "horizontal",
566						h_align: "center",
567						v_align: "bottom",
568						h_offset: 0,
569						v_offset: 20,
570						space: 5,
571						tmp: '<span class="tp-bullet-inner"></span>'
572					}
573				},
574				responsiveLevels: [1240, 1024, 778, 480],
575				visibilityLevels: [1240, 1024, 778, 480],
576				gridwidth: [1920, 1024, 778, 480],
577				gridheight: [700, 600, 500, 450],
578				lazyType: "none",
579				shadow: 0,
580				spinner: "spinner3",
581				stopLoop: "off",
582				stopAfterLoops: -1,
583				stopAtSlide: -1,
584				shuffle: "off",
585				autoHeight: "off",
586				fullScreenAutoWidth: "off",
587				fullScreenAlignForce: "off",
588				fullScreenOffsetContainer: "",
589				fullScreenOffset: "",
590				disableProgressBar: "on",
591				hideThumbsOnMobile: "off",
592				hideSliderAtLimit: 0,
593				hideCaptionAtLimit: 0,
594				hideAllCaptionAtLilmit: 0,
595				debugMode: true,
596				fallbacks: {
597					simplifyAll: "off",
598					nextSlideOnWindowFocus: "off",
599					disableFocusListener: false,
600				}
601			});
602		
603
604        /* ------------------------------------------------
605				End of Revolution slider
606		------------------------------------------------ */
607        /* ------------------------------------------------
608				Accordions & Toggles
609		------------------------------------------------ */
610
611            var $accordions = $('.mad-panels--accordion'),
612                $toggles = $('.mad-panels--toggles');
613
614            if($accordions.length) {
615                $accordions.MonkeysanAccordion({
616                    easing: self.ANIMATIONEASING,
617					speed: self.ANIMATIONDURATION,
618					cssPrefix: 'mad-',
619                    afterOpen: function() {
620                        self.helpers.updateGlobalNiceScroll();
621                    },
622                    afterClose: function() {
623                        self.helpers.updateGlobalNiceScroll();
624                    }
625                });
626            }
627
628            if($toggles.length) {
629                $toggles.MonkeysanAccordion({
630                    easing: self.ANIMATIONEASING,
631					speed: self.ANIMATIONDURATION,
632                    toggle: true,
633					cssPrefix: 'mad-',
634                    afterOpen: function() {
635                        self.helpers.updateGlobalNiceScroll();
636                    },
637                    afterClose: function() {
638                        self.helpers.updateGlobalNiceScroll();
639                    }
640                });
641            }
642
643        /* ------------------------------------------------
644				End of Accordions & Toggles
645		------------------------------------------------ */
646
647          /* ----------------------------------------
648                  Alert Boxes
649           ---------------------------------------- */
650
651               $doc.on('pushed.mad.alert closed.mad.alert', function(event) {
652                   self.helpers.updateGlobalNiceScroll();
653               });
654
655                var $alertBoxes = $('.mad-alert-box');
656
657                if($alertBoxes.filter('.mad-alert-box--success').length) {
658                    MadAlertBox.init($alertBoxes.filter('.mad-alert-box--success'), {
659                        duration: self.ANIMATIONDURATION,
660                        cssPrefix: 'mad-',
661                        easing: self.ANIMATIONEASING,
662                        type: 'success'
663                    });
664                }
665
666                if($alertBoxes.filter('.mad-alert-box--warning').length) {
667                    MadAlertBox.init($alertBoxes.filter('.mad-alert-box--warning'), {
668                        duration: self.ANIMATIONDURATION,
669                        cssPrefix: 'mad-',
670                        easing: self.ANIMATIONEASING,
671                        type: 'warning'
672                    });
673                }
674
675                if($alertBoxes.filter('.mad-alert-box--info').length) {
676                    MadAlertBox.init($alertBoxes.filter('.mad-alert-box--info'), {
677                        duration: self.ANIMATIONDURATION,
678                        cssPrefix: 'mad-',
679                        easing: self.ANIMATIONEASING,
680                        type: 'info'
681                    });
682                }
683
684                if($alertBoxes.filter('.mad-alert-box--error').length) {
685                    MadAlertBox.init($alertBoxes.filter('.mad-alert-box--error'), {
686                        duration: self.ANIMATIONDURATION,
687                        cssPrefix: 'mad-',
688                        easing: self.ANIMATIONEASING,
689                        type: 'error'
690                    });
691                }
692
693           /* ----------------------------------------
694                  End of Alert Boxes
695            ---------------------------------------- */
696
697            /* ----------------------------------------
698                    Tooltips
699             ---------------------------------------- */
700
701                if( $('[data-tooltip]').length && $.fn.MonkeysanTooltip ) {
702                    $('[data-tooltip]').MonkeysanTooltip({
703                        animationIn: 'fadeInDown',
704                        animationOut: 'fadeOutUp',
705                        tooltipPosition: 'top',
706                        jQueryAnimationEasing: self.ANIMATIONEASING,
707                        jQueryAnimationDuration: self.ANIMATIONDURATION,
708                        skin: 'mad'
709                    });
710                }
711
712             /* ----------------------------------------
713                    End of Tooltips
714              ---------------------------------------- */
715
716             /* ----------------------------------------
717                    IsotopeWrapper
718              ---------------------------------------- */
719        
720                    var $isotope = $('.mad-grid--isotope:not(.mad-sponsors)'),
721                         $isotopeLazy = $('.mad-grid--isotope.mad-sponsors');
722
723                    if ($isotope.length && window.MadIsotopeWrapper) {
724                        $isotope.each(function (index, container) {
725                            var $container = $(container),
726                                $stretchedSection = $container.closest('.mad-section--stretched-content, .mad-section--stretched-content-no-px');
727
728                            if ($stretchedSection.length) {
729                                $stretchedSection.on('stretched.mad.Section', function () {
730                                    if ($container.data('IsotopeWrapper')) return;
731
732                                    MadIsotopeWrapper.init($container, {
733                                        itemSelector: '.mad-grid-item',
734                                        transitionDuration: self.ANIMATIONDURATION
735                                    });
736                                });
737                            }
738                            else {
739                                MadIsotopeWrapper.init($container, {
740                                    itemSelector: '.mad-grid-item',
741                                    transitionDuration: self.ANIMATIONDURATION
742                                });
743                            }
744                        });
745                    }
746
747                    if ($isotopeLazy.length && window.MadIsotopeWrapper) {
748                        $isotopeLazy.each(function (index, container) {
749                            var $container = $(container),
750                                $stretchedSection = $container.closest('.mad-section--stretched-content, .mad-section--stretched-content-no-px');
751
752                            if ($stretchedSection.length) {
753                                $stretchedSection.on('stretched.mad.Section', function () {
754                                    if ($container.data('IsotopeWrapper')) return;
755
756                                    setTimeout(function () {
757                                        MadIsotopeWrapper.init($container, {
758                                            itemSelector: '.mad-grid-item',
759                                            filter: '.mad-category-platinum',
760                                            transitionDuration: self.ANIMATIONDURATION
761                                        });
762                                    }, 500);
763                                });
764                            }
765                            else {
766                                setTimeout(function () {
767                                    MadIsotopeWrapper.init($container, {
768                                        itemSelector: '.mad-grid-item',
769                                        filter: '.mad-category-platinum',
770                                        transitionDuration: self.ANIMATIONDURATION
771                                    });
772                                }, 500);
773                            }
774                        });
775                    }
776
777                    $(window).on('load', function() {
778                        if ($isotope.length && window.MadIsotopeWrapper) {
779                            $isotope.each(function (index, container) {
780                                var $container = $(container),
781                                    $stretchedSection = $container.closest('.mad-section--stretched-content, .mad-section--stretched-content-no-px');
782
783                                if ($stretchedSection.length) {
784                                    $stretchedSection.on('stretched.mad.Section', function () {
785                                        if ($container.data('IsotopeWrapper')) return;
786
787                                        MadIsotopeWrapper.init($container, {
788                                            itemSelector: '.mad-grid-item',
789                                            transitionDuration: self.ANIMATIONDURATION
790                                        });
791                                    });
792                                }
793                                else {
794                                    MadIsotopeWrapper.init($container, {
795                                        itemSelector: '.mad-grid-item',
796                                        transitionDuration: self.ANIMATIONDURATION
797                                    });
798                                }
799                            });
800                        }
801                    })
802
803              /* ----------------------------------------
804                    End of IsotopeWrapper
805              ---------------------------------------- */
806
807              /* ----------------------------------------
808                    Dynamic background image
809               ---------------------------------------- */
810
811                    var $backgrounds = $('[data-bg-image-src]:not([class*="mad-colorizer--scheme-"])');
812
813                    if($backgrounds.length && this.helpers
813.dynamicBgImage) {
814                        this.helpers.dynamicBgImage($backgrounds);
815                    }
816
817               /* ----------------------------------------
818                    End of Dynamic background image
819                ---------------------------------------- */
820
821              /* ----------------------------------------
822                    Owl Carousel
823               ---------------------------------------- */
824
825                    // owl carousel adaptive
826                    if($('.owl-carousel').length) this.helpers.owlAdaptive();
827
828                    var $simpleSlideshow = $('.mad-simple-slideshow'),
829                        $testimonialsCarousel = $('.mad-testimonials-inner.owl-carousel');
830
831                    if($simpleSlideshow.length && $.fn.owlCarousel) {
832                        $simpleSlideshow.each(function(index, carousel){
833                            var $carousel = $(carousel),
834                                $stretchedSection = $carousel.closest('.mad-section--stretched-content, .mad-section--stretched-content-no-px');
835
836                            if($stretchedSection.length) {
837                                $stretchedSection.each(function(scindex, scelement){
838                                    $(scelement).on('stretched.mad.Section', function() {
839                                        $carousel.owlCarousel(self.helpers.owlSettings({
840                                            margin: 1,
841                                            loop: true,
842                                            autoplay: $carousel.hasClass('mad-simple-slideshow--autoplay')
843                                        }));
844                                    });
845                                });
846                            }
847                            else {
848
849                                $carousel.owlCarousel(self.helpers.owlSettings({
850                                    margin: 1,
851                                    loop: true,
852                                    autoplay: $carousel.hasClass('mad-simple-slideshow--autoplay')
853                                }));
854                            }
855                        });
856                    }
857
858                    if($testimonialsCarousel.length && $.fn.owlCarousel) {
859                        $testimonialsCarousel.each(function(index, carousel) {
860                            var $carousel = $(carousel),
861                                $stretchedSection = $carousel.closest('.mad-section--stretched-content, .mad-section--stretched-content-no-px');
862
863                            if($stretchedSection.length) {
864                                $stretchedSection.on('stretched.mad.Section', function() {
865                                    if($carousel.data('owl.carousel')) return;
866                                    $carousel.owlCarousel(self.helpers.owlSettings({
867                                        margin: 0,
868                                        loop: true,
869                                        nav: true,
870                                        dots: true
871                                    }));
872                                });
873                            }
874                            else {
875                                $carousel.owlCarousel(self.helpers.owlSettings({
876                                    margin: 0,
877                                    loop: true,
878                                    nav: true,
879                                    dots: true
880                                }));
881                            }
882                        });
883                    }
884
885                    this.helpers.gridOwl.extendConfigFor('.mad-testimonials', {
886                        nav: true,
887                        dots: false,
888                        startPosition: 1,
889                        autoplay: true,
890                        loop: true
891                    });
892
893                    this.helpers.gridOwl.extendConfigFor('.mad-tabbed-carousel-thumbs', {
894                        nav: true,
895                        dots: false,
896                        margin: 0,
897                        loop: false, // !important
898                        autoplay: false,
899                        responsive: {
900                            0: {
901                                items: 1
902                            },
903                            480: {
904                                items: 2
905                            },
906                            1200: {
907                                items: 3
908                            },
909                            1300: {
910                                items: 4
911                            }
912                        },
913                        responsiveWithSidebar: {
914                            0: {
915                                items: 1
916                            },
917                            480: {
918                                items: 2
919                            },
920                            1350: {
921                                items: 3
922                            }
923                        }
924                    });
925
926                    // Initialization owl carousels placed in the stretched sections
927                    $('[class*="mad-section--stretched-content"]').on('stretched.mad.Section', function(event, $section) {
928                        var $gridOwlCarousels = $section.find('.mad-grid.owl-carousel'),
929                            $simpleThumbs = $section.find('.mad-simple-slideshow-thumbs.owl-carousel');
930
931                        if($gridOwlCarousels.length) self.helpers.gridOwl.add($gridOwlCarousels);
932
933                        if($simpleThumbs.length) {
934                            $simpleThumbs.owlCarousel(self.helpers.owlSettings({
935                                responsive: {
936                                    0: {
937                                        items: 2
938                                    },
939                                    380: {
940                                        items: 3
941                                    },
942                                    992: {
943                                        items: 4
944                                    },
945                                    1200: {
946                                        items: 6
947                                    }
948                                },
949                                margin: 10,
950                                loop: false
951                            }));
952                        }
953                    });
954
955                    // Initialization owl carousels placed in the normal sections
956                    var $simpleThumbs = $('.mad-simple-slideshow-thumbs.owl-carousel').filter(function(index, element){
957                        return !$(element).closest('[class*="mad-section--stretched-content"]').length;
958                    });
959
960                    if($simpleThumbs.length) {
961                        $simpleThumbs.owlCarousel(self.helpers.owlSettings({
962                            responsive: {
963                                0: {
964                                    items: 2
965                                },
966                                380: {
967                                    items: 3
968                                },
969                                992: {
970                                    items: 4
971                                },
972                                1200: {
973                                    items: 6
974                                }
975                            },
976                            margin: 10,
977                            loop: false
978                        }));
979                    }
980
981                    this.helpers.gridOwl.add($('.mad-grid.owl-carousel').filter(function(index, element){
982                        return !$(element).closest('[class*="mad-section--stretched-content"]').length;
983                    }));
984
985                    this.helpers.owlSyncTabbed.init($("[data-tabbed-sync]"));
986                    this.helpers.owlSync.init();
987
988               /* ----------------------------------------
989                    End of Owl Carousel
990                ---------------------------------------- */
991
992               /* ----------------------------------------
993                    Rating
994                ---------------------------------------- */
995
996                    var $ratingFields = $('.mad-rating-field'),
997                        $ratings;
998
999                    if($ratingFields.length) {
1000                        $ratings = $ratingFields.find('.mad-rating');
1001
1002                        if($ratings.length) {
1003                            $ratings.on('built.mad.Rating', function(event, $rating) {
1004                                var $tabs = $rating.closest('.mad-tabs'),
1005                                    Tabs;
1006
1007                                if($tabs.length) {
1008                                    Tabs = $tabs.data('tabs');
1009
1010                                    if(Tabs) Tabs.updateContainer();
1011                                }
1012                            });
1013                        }
1014                    }
1015
1016
1017                    if(this.helpers.rating) this.helpers.rating($('.mad-rating:not(.mad-rating--independent)'), {
1018                        topLevelElements: '<i class="icon licon-star"></i>',
1019                        bottomLevelElements: '<i class="icon licon-star-empty"></i>'
1020                    });
1021
1022                    if(this.helpers.rating) this.helpers.rating($('.mad-rating--independent'), {
1023                        topLevelElements: '<i class="icon licon-star"></i>',
1024                        bottomLevelElements: '<i class="icon licon-star"></i>'
1025                    });
1026
1027                    if(this.helpers.ratingField) this.helpers.ratingField($('.mad-rating-field'));
1028
1029               /* ----------------------------------------
1030                    End of Rating
1031                ---------------------------------------- */
1032
1033               /* ----------------------------------------
1034                    Tabbed Grid
1035                ---------------------------------------- */
1036
1037                    if(window.MadTabbedGrid) {
1038                        window.MadTabbedGrid.init($('.mad-grid--tabbed'), {
1039                            cssPrefix: 'mad-',
1040                            easing: self.ANIMATIONEASING,
1041                            duration: self.ANIMATIONDURATION
1042                        });
1043
1044                        $('[class*="mad-section--stretched-content"]').on('stretched.mad.Section', function(event, $section) {
1045                            var $gridTabbed = $section.find('.mad-grid--tabbed');
1046
1047                            setTimeout(function(){
1048                                if($gridTabbed.length) $gridTabbed.data('TabbedGrid').resize();
1049                            }, self.ANIMATIONDURATION);
1050                        });
1051
1052                        $('.mad-grid--tabbed').on('grid.resized.tabbedgrid item.shown.tabbedgrid', function(event, $grid) {
1053                            if($grid.data('TabsResizeTimeOutId')) clearTimeout($grid.data('TabsResizeTimeOutId'));
1054                            self.helpers.updateGlobalNiceScroll();
1055
1056                            $grid.data('TabsResizeTimeOutId', setTimeout(function(){
1057                                var $tabs = $grid.closest('.mad-tabs'),
1058                                    Tabs;
1059                                if(!$tabs.length) return;
1060
1061                                Tabs = $tabs.data('tabs');
1062
1063                                if(Tabs) Tabs.updateContainer();
1064                            }, 100));
1065                        });
1066                    }
1067
1068               /* ----------------------------------------
1069                    End of Tabbed Grid
1070                ---------------------------------------- */
1071
1072                if(this.helpers.touchHoverEmulator) this.helpers.touchHoverEmulator($('.mad-entities--style-17'), '.mad-entity-link', '.mad-entity');
1073
1074        /* ----------------------------------------
1075               Self Hosted Video
1076         ---------------------------------------- */
1077
1078           var $selfHostedVideos = $('.mad-selfhosted-video');
1079
1080           if($selfHostedVideos.length) {
1081               $selfHostedVideos.on('click.MadSelfHostedVideo', function(event) {
1082                   var $this = $(this),
1083                       $state = $this.find('.mejs__overlay-play');
1084
1085                   if($state.length) {
1086                       setTimeout(function() {
1087                           $this[!$state.is(':visible') ? 'addClass' : 'removeClass']('mad-selfhosted-video--playing');
1088                       },0);
1089                   }
1090               });
1091           }
1092
1093        /* ----------------------------------------
1094               End of Self Hosted Video
1095         ---------------------------------------- */
1096
1097         $body.on('spaceadded.mad.stickysection spaceremoved.mad.stickysection', function(){
1098             self.helpers.updateGlobalNiceScroll();
1099         });
1100
1101         $doc.on('container.updated.mokeysan.tabs', function(event, $container) {
1102             self.helpers.updateGlobalNiceScroll();
1103         });
1104
1105         DOMDfd.resolve();
1106    };
1107
1108    App.afterOuterResourcesLoaded = function() {
1109
1110        var self = this;
1111
1112        // Stop initializing any modules in case legacy browser is using
1113        if(this.ISLEGACYBROWSER) return;
1114
1115        setTimeout(function(){ if(self.LinkUnderliner) self.LinkUnderliner.init($('a, .mad-btn--link')); }, 100);
1116
1117        var $sections = $('.mad-section');
1118
1119        if(this.helpers.Colorizer) this.helpers.Colorizer.init($('[class*="mad-colorizer--scheme-"]'));
1120
1121        if(this.modules.Section && $sections.length) {
1122            this.modules.Section.init($sections);
1123        }
1124
1125        if(this.helpers.Breadcrumb) this.helpers.Breadcrumb.init($('.mad-header--trans
1125parent + .mad-breadcrumb[data-bg-image-src]'));
1126
1127        /* ----------------------------------------
1128            SameHeight
1129        ---------------------------------------- */
1130
1131            if($.fn.MonkeysanSameHeight) {
1132
1133                var $sameheightContainers = $('.mad-same-height'),
1134                    $pricingTables = $('.mad-flexbox .mad-pricing-tables');
1135
1136                if( $sameheightContainers.length ) {
1137
1138                    $sameheightContainers.each(function(index, container){
1139                        var $container = $(container),
1140                            $items = $container.find('.mad-grid-item');
1141
1142                        if($items.length) {
1143                            $container.MonkeysanSameHeight({
1144                                target: '.mad-grid-item',
1145                                isIsotope: $container.find('.mad-grid--isotope').length
1146                            });
1147                        }
1148                    });
1149                }
1150
1151                if( $pricingTables.length ) {
1152
1153                    $pricingTables.each(function(index, container){
1154                        var $container = $(container),
1155                            $items = $container.find('.mad-grid-item');
1156
1157                        if($items.length) {
1158                            $container.MonkeysanSameHeight({
1159                                target: '.mad-pricing-table',
1160                                isIsotope: $container.find('.mad-grid--isotope').length,
1161                                columns: $items.length ? Math.ceil( $container.outerWidth() / $items.first().outerWidth() ) : null
1162                            });
1163                        }
1164                    });
1165                }
1166            }
1167
1168        /* ----------------------------------------
1169            End of SameHeight
1170        ---------------------------------------- */
1171
1172        if(this.helpers.fullScreenArea) this.helpers.fullScreenArea.init({
1173            except: $('#mad-header:not(.mad-header--transparent)').add($('#mad-footer'))
1174        });
1175
1176        /* ----------------------------------------
1177                Tabs & Tour Sections
1178         ---------------------------------------- */
1179
1180            var $tabs = $('.mad-tabs');
1181
1182            if($tabs.length) {
1183                $tabs.MonkeysanTabs({
1184					speed: self.ANIMATIONDURATION,
1185                    easing: self.ANIMATIONEASING,
1186					cssPrefix: 'mad-',
1187                    afterOpen: function() {
1188                        self.helpers.updateGlobalNiceScroll();
1189                    },
1190                    afterClose: function() {
1191                        self.helpers.updateGlobalNiceScroll();
1192                    }
1193				});
1194            }
1195
1196         /* ----------------------------------------
1197                End of Tabs & Tour Sections
1198          ---------------------------------------- */
1199
1200         //if(this.modules.preloader) this.modules.preloader();
1201
1202          var $parallaxSections = $('.mad-colorizer--parallax .mad-colorizer-bg-image');
1203
1204          if($parallaxSections.length) {
1205              $parallaxSections.parallax("50%",.4);
1206          }
1207    };
1208
1209    App.LinkUnderliner = {
1210        _$collection: $(),
1211		init: function($collection) {
1212			var self = this,
1213				$currentFilteredCollection;
1214
1215			if(!$.isjQuery($collection) || !$collection.length) return;
1216
1217			if(!this._bindedEvents) this._bindEvents();
1218
1219			$currentFilteredCollection = $();
1220
1221			$collection.each(function(index, element){
1222				var $element = $(element);
1223
1224				if(self._$collection.filter($element).length) return;
1225
1226				self._$collection = self._$collection.add($element);
1227				$currentFilteredCollection = $currentFilteredCollection.add($element);
1228			});
1229
1230			return this.toUnderline($currentFilteredCollection);
1231		},
1232		isRTL: function() {
1233			return getComputedStyle(document.body).direction === 'rtl';
1234		},
1235		_bindEvents: function() {
1236			var self = this;
1237
1238			$(window).on('resize.MadLinksUnderline', function() {
1239				if(self.resizeTimeOutId) clearTimeout(self.resizeTimeOutId);
1240
1241				self.resizeTimeOutId = setTimeout(function(){
1242					self.toUnderline(self._$collection);
1243				}, 100);
1244			});
1245		},
1246		toUnderline: function($collection) {
1247			var self = this;
1248
1249			if(!$.isjQuery($collection) || !$collection.length) return;
1250
1251			return $collection.each(function(index, element){
1252				var $element = $(element),
1253					transitionDuration = getComputedStyle($element.get(0)).transitionDuration,
1254					transitionDurationMS = parseFloat(transitionDuration, 10) * 1000;
1255
1256				if(transitionDurationMS) {
1257					setTimeout(function(){
1258						self.setUnderlineToElement($element);
1259					}, transitionDurationMS);
1260				}
1261				else {
1262					self.setUnderlineToElement($element);
1263				}
1264			});
1265		},
1266		setUnderlineToElement: function($element) {
1267			var backgroundPosition = $element.css('background-position').split(' '),
1268				resultLineHeight;
1269
1270			$element.css('white-space', 'nowrap');
1271			resultLineHeight = $element.outerHeight() - 1;
1272			$element.css('white-space', '');
1273
1274			if(this.isRTL() && backgroundPosition[0]) backgroundPosition[0] = '100%';
1275
1276			if(backgroundPosition[1]) backgroundPosition[1] = resultLineHeight + 'px';
1277
1278			$element.css('background-position', backgroundPosition.join(' '));
1279		}
1280    };
1281
1282    /* ----------------------------------------
1283            Back to top
1284     ---------------------------------------- */
1285
1286        App.modules.backToTop = function(config) {
1287
1288             var backToTop = {
1289
1290                 init: function(config){
1291
1292                     var self = this;
1293
1294                     if(config) this.config = $.extend(this.config, config);
1295
1296                     this.btn = $('<button></button>', {
1297                         class: self.config.cssPrefix+'back-to-top animated stealthy',
1298                         html: '<span class="icon licon-chevron-up"></span>'
1299                     });
1300
1301                     this.bindEvents();
1302
1303                     $body.append(this.btn);
1304
1305                 },
1306
1307                 config: {
1308                     breakpoint: 700,
1309                     showClass: 'zoomIn',
1310                     hideClass: 'zoomOut',
1311                     easing: 'linear',
1312                     speed: 500,
1313                     cssPrefix: ''
1314                 },
1315
1316                 bindEvents: function(){
1317
1318                     var page = $('html, body'),
1319                         self = this;
1320
1321                     this.btn.on('click', function(e){
1322
1323                         $body.getNiceScroll().stop();
1324
1325                         page.stop().animate({
1326
1327                             scrollTop: 0
1328
1329                         }, {
1330                             easing: self.config.easing,
1331                             duration: self.config.speed
1332                         });
1333
1334                     });
1335
1336                     this.btn.on(App.ANIMATIONEND, function(e){
1337
1338                         e.preventDefault();
1339
1340                         var $this = $(this);
1341
1342                         if($this.hasClass(self.config.hideClass)){
1343
1344                             $this
1345                                 .addClass('stealthy')
1346                                 .removeClass(self.config.hideClass + " " + self.config.cssPrefix + "inview");
1347
1348                         }
1349
1350                     });
1351
1352                     $(window).on('scroll.backtotop', { self: this}, this.toggleBtn);
1353
1354                 },
1355
1356                 toggleBtn: function(e){
1357
1358                     var $this = $(this),
1359                         self = e.data.self;
1360
1361                     if($this.scrollTop() > self.config.breakpoint && !self.btn.hasClass(self.config.cssPrefix + 'inview')){
1362
1363                         self.btn
1364                                 .addClass(self.config.cssPrefix + 'inview')
1365                                 .removeClass('stealthy');
1366
1367                         if(App.ANIMATIONSUPPORTED){
1368                             self.btn.addClass(self.config.showClass);
1369                         }
1370
1371                     }
1372                     else if($this.scrollTop() < self.config.breakpoint && self.btn.hasClass(self.config.cssPrefix + 'inview')){
1373
1374                         self.btn.removeClass(self.config.cssPrefix + 'inview');
1375
1376                         if(!App.ANIMATIONSUPPORTED){
1377                             self.btn.addClass('stealthy');
1378                         }
1379                         else{
1380                             self.btn.removeClass(self.config.showClass)
1381                                     .addClass(self.config.hideClass);
1382                         }
1383
1384                     }
1385
1386                 }
1387
1388             };
1389
1390             backToTop.init(config);
1391
1392             return this;
1393
1394         };
1395
1396    /* ----------------------------------------
1397            End of Back to top
1398     ---------------------------------------- */
1399
1400    /* ----------------------------------------
1401            Preloader
1402     ---------------------------------------- 
1403
1404        App.modules.preloader = function() {
1405            var $preloader = $('.mad-preloader'),
1406                leftPos = parseInt($preloader.css('margin-left'), 10),
1407                topPos = parseInt($preloader.css('margin-top'), 10),
1408                $w = $(window),
1409                $nav = $('.mad-navigation, .mad-navigation-vertical');
1410
1411            if($nav.length) {
1412                $nav.off('click.MadPreloader').on('click.MadPreloader', 'a', function(event){
1413
1414                    var $this = $(this),
1415                        $circle = $('<div></div>', {
1416                            style: 'left: '+ event.clientX +'px; top: '+ event.clientY +'px;',
1417                            class: 'mad-preloader-circle'
1418                        });
1419
1420                    if($body.hasClass('mad-body--moving-to-another-page')) {
1421                        $circle.appendTo($body);
1422
1423                        setTimeout(function(){
1424                            $circle.addClass('mad-preloader-circle--appearing');
1425                        }, 20);
1426                    }
1427                });
1428            }
1429
1430            if(!$preloader.length) return;
1431
1432            $body.off('mousemove.MadPreloader').on('mousemove.MadPreloader', function(event) {
1433                $preloader.css({
1434                    'margin-left': leftPos - ($w.width() / 2 - event.pageX),
1435                    'margin-top': topPos - ($w.height() / 2 - (event.pageY - $w.scrollTop())),
1436                });
1437            }).jQueryImagesLoaded().then(function(){
1438                var $niceScrollRails = $('.nicescroll-rails');
1439
1440                $preloader.addClass('mad-preloader--disappearing');
1441                setTimeout(function() {
1442                    $preloader.remove();
1443                    $body.off('mousemove.MadPreloader');
1444                    App.helpers.updateGlobalNiceScroll();
1445                    if($niceScrollRails.length) $niceScrollRails.css('visibility', 'visible');
1446                }, 700);
1447                // can be removed in production (demo only):
1448                if(window.location.hash == '#mad-footer') {
1449                    $('html, body').stop().animate({
1450                        scrollTop: $doc.height()
1451                    }, {
1452                        duration: self.ANIMATIONDURATION,
1453                        easing: self.ANIMATIONEASING
1454                    });
1455                }
1456            });
1457        };
1458		*/
1459
1460    /* ----------------------------------------
1461            End of Preloader
1462     ---------------------------------------- */
1463
1464    /* ----------------------------------------
1465            Field Counter
1466     ---------------------------------------- */
1467
1468        App.modules.fieldCounter = function() {
1469            $body.on('click.MadFieldCounter', '.mad-field-counter-control', function(e) {
1470                var $this = $(this),
1471                    $field = $this.siblings('.mad-field-counter-target'),
1472                    $value = $this.siblings('.mad-field-counter-value'),
1473                    val = +$field.val();
1474
1475                if($this.hasClass('mad-field-counter-control--decrease') && val != 0) {
1476                    val--;
1477                }
1478                else if($this.hasClass('mad-field-counter-control--increase')) {
1479                    val++;
1480                }
1481
1482                $field.val(val);
1483                $value.text(val);
1484
1485                e.preventDefault();
1486            });
1487        };
1488
1489    /* ----------------------------------------
1490            End of Field Counter
1491     ---------------------------------------- */
1492
1493    /* ----------------------------------------
1494            WPGallery
1495     ---------------------------------------- */
1496
1497        App.modules.WPGallery = {};
1498        App.modules.WPGallery._cache = [];
1499
1500        App.modules.WPGallery.init = function($collection) {
1501            var self = this;
1502
1503            if(!$.isjQuery($collection, true)) return $collection;
1504
1505            return $collection.each(function(index, gallery){
1506                var $gallery = $(gallery);
1507
1508                if(self.isInitialized($gallery)) return;
1509
1510                self.initializeSingle($gallery);
1511            });
1512        };
1513
1514        App.modules.WPGallery.isInitialized = function($gallery) {
1515            return !$.isjQuery($gallery, true) || $gallery.data('mad-wp-gallery-initialized');
1516        };
1517
1518        App.modules.WPGallery.initializeSingle = function($gallery) {
1519            var $items,
1520                id;
1521
1522            if(!$.isjQuery($gallery, true)) return $gallery;
1523
1524            $items = $gallery.find('a[href$=".jpg"], a[href$=".png"], a[href$=".jpeg"], a[href$=".gif"]');
1525
1526            if($items.length) {
1527                id = App.helpers.getRandomId('gallery');
1528
1529                $items.data('fancybox', id).attr('data-fancybox', id);
1530
1531                $gallery.data('mad-wp-gallery-initialized', true);
1532            }
1533
1534            return $gallery;
1535        };
1536
1537    /* ----------------------------------------
1538            End of WPGallery
1539     ---------------------------------------- */
1540
1541
1542    /* ----------------------------------------
1543            Field Datepicker
1544     ---------------------------------------- */
1545
1546        App.modules.fieldDatepicker = function() {
1547            $body.on('change.MadFieldDatepicker', 'input.mad-field-datepicker-invoker', function(event) {
1548                var $field = $(this),
1549                    $markupField = $field.siblings('.mad-field-datepicker'),
1550                    $day,
1551                    $yearAndMonth,
1552                    $dayName,
1553                    currentDate = moment($field.datepicker("getDate"));
1554
1555                if($markupField.length && $markupField.hasClass('mad-field-datepicker--style-1')) {
1556                    $day = $markupField.find('.mad-field-datepicker-day');
1557                    $yearAndMonth = $markupField.find('.mad-field-datepicker-month-year');
1558                    $dayName = $markupField.find('.mad-field-datepicker-dayname');
1559
1560                    if($day.length) {
1561                        $day.text(currentDate.date());
1562                    }
1563
1564                    if($yearAndMonth.length) {
1565                        $yearAndMonth.text(currentDate.format('MMMM, YYYY'));
1566                    }
1567
1568                    if($dayName.length) {
1569                        $dayName.text(currentDate.format('dddd'));
1570                    }
1571                }
1572                else if($markupField.length && ($markupField.hasClass('mad-field-datepicker--style-2') || $markupField.hasClass('mad-field-datepicker--style-3') || $markupField.hasClass('mad-field-datepicker--style-4'))) {
1573                    $markupField.text(currentDate.format('dddd Do MMMM, YYYY'));
1574                }
1575            });
1576        };
1577
1578    /* ----------------------------------------
1579            End of Field Datepicker
1580     ---------------------------------------- */
1581
1582    /* ----------------------------------------
1583            Hidden Filters
1584     ---------------------------------------- */
1585
1586        App.modules.hiddenFilters = function() {
1587            $body.on('click.MadHiddenFilters', '.mad-hidden-filters-show', function(e) {
1588                var $this = $(this),
1589                    $shownElement = $this.closest('.mad-hidden-filters-shown'),
1590                    $hiddenElement,
1591                    $hiddenElementActionButton;
1592
1593                if($shownElement.length) {
1594                    $hiddenElement = $shownElement.siblings('.mad-hidden-filters-hidden');
1595
1596                    $shownElement.removeClass('mad-hidden-filters--visible').attr('aria-hidden', 'true');
1597                    $this.attr('aria-expanded', 'false');
1598
1599                    if($hiddenElement.length) {
1600                        $hiddenElement.addClass('mad-hidden-filters--visible').attr('aria-hidden', 'false');
1601
1602                        $hiddenElementActionButton = $hiddenElement.find('.mad-hidden-filters-hide');
1603
1604                        if($hiddenElementActionButton.length) $hiddenElementActionButton.attr('aria-expanded', 'true');
1605                    }
1606                }
1607                e.preventDefault();
1608            }).on('click.MadHiddenFilters', '.mad-hidden-filters-hide', function(e) {
1609                var $this = $(this),
1610                    $hiddenElement = $this.closest('.mad-hidden-filters-hidden'),
1611                    $shownElement,
1612                    $shownElementActionButton;
1613
1614                if($hiddenElement.length) {
1615                    $shownElement = $hiddenElement.siblings('.mad-hidden-filters-shown');
1616
1617                    $hiddenElement.removeClass('mad-hidden-filters--visible').attr('aria-hidden', 'true');
1618                    $this.attr('aria-expanded', 'false');
1619
1620                    if($shownElement.length) {
1621                        $shownElement.addClass('mad-hidden-filters--visible').attr('aria-hidden', 'false');
1622
1623                        $shownElementActionButton = $shownElement.find('.mad-hidden-filters-show');
1624
1625                        if($shownElementActionButton.length) $shownElementActionButton.attr('aria-expanded', 'true');
1626                    }
1627                }
1628
1629                e.preventDefault();
1630            });
1631        };
1632
1633    /* ----------------------------------------
1634            End of Hidden Filters
1635     ---------------------------------------- */
1636
1637    /* ----------------------------------------
1638            Fancybox Album
1639     ---------------------------------------- */
1640
1641        App.modules.fancyboxAlbum = {};
1642
1643        App.modules.fancyboxAlbum.init = function() {
1644            $body.off('click.MadFancyboxAlbum').on('click.MadFancyboxAlbum', '[data-fancybox-album-src]', function(event) {
1645                var $this = $(this),
1646                    srcs;
1647
1648                if($.fn.fancybox) {
1649                    srcs = $this.data('fancybox-album-src');
1650                    if(srcs) $.fancybox.open(srcs);
1651                }
1652
1653                event.preventDefault();
1654            });
1655        };
1656
1657    /* ----------------------------------------
1658            End of Fancybox Album
1659     ---------------------------------------- */
1660
1661    /* ----------------------------------------
1662            Dropdown
1663     ---------------------------------------- */
1664
1665        App.modules.dropdown = {};
1666
1667        App.modules.dropdown.config = {
1668            uncloseable: '.mad-dropdown, .select2-container--mad',
1669            cssPrefix: 'mad-',
1670            availableError: 30,
1671            rtl: App.RTL,
1672            classMap: {
1673                active: 'dropdown--opened',
1674                container: 'dropdown',
1675                title: 'dropdown-title',
1676                element: 'dropdown-element',
1677                leftPlaced: 'dropdown-element--x-left',
1678                rightPlaced: 'dropdown-element--x-right',
1679                topPlaced: 'dropdown-element--y-top'
1680            }
1681        };
1682
1683        App.modules.dropdown.init = function(config) {
1684            if(this._initialized) return;
1685
1686            if($.isPlainObject(config)) $.extend(true, this.config, config);
1687
1688            Object.defineProperties(this, {
1689                activeClass: {
1690                    get: function() {
1691                        return this.config.cssPrefix + this.config.classMap.active;
1692                    }
1693                },
1694                containerClass: {
1695                    get: function() {
1696                        return this.config.cssPrefix + this.config.classMap.container;
1697                    }
1698                },
1699                titleClass: {
1700                    get: function() {
1701                        return this.config.cssPrefix + this.config.classMap.title;
1702                    }
1703                },
1704                elementClass: {
1705                    get: function() {
1706                        return this.config.cssPrefix + this.config.classMap.element;
1707                    }
1708                },
1709                rightPlacedClass: {
1710                    get: function() {
1711                        return this.config.cssPrefix + this.config.classMap.rightPlaced;
1712                    }
1713                },
1714                leftPlacedClass: {
1715                    get: function() {
1716                        return this.config.cssPrefix + this.config.classMap.leftPlaced;
1717                    }
1718                },
1719                topPlacedClass: {
1720                    get: function() {
1721                        return this.config.cssPrefix + this.config.classMap.topPlaced;
1722                    }
1723                },
1724                $dropdowns: {
1725                    get: function() {
1726                        return $('.' + this.containerClass);
1727                    }
1728                }
1729            });
1730
1731            this._bindEvents();
1732        };
1733
1734        App.modules.dropdown._bindEvents = function() {
1735            var self = this;
1736
1737            $doc.off('click.MadDropdown').on('click.MadDropdown', function(e) {
1738                var $target = $(e.target);
1739
1740                if(!$target.closest(self.config.uncloseable).length) {
1741                    self.close(self.$dropdowns);
1742                }
1743            }).on('keydown.MadDropdown', function(event) {
1744                if(event.keyCode && event.keyCode == 27) {
1745                    self.close(self.$dropdowns);
1746                }
1747            });
1748
1749            $body.off('click.MadDropdown').on('click.MadDropdown', '.' + self.titleClass, function(e) {
1750                var $dropdown = $(this).closest('.' + self.containerClass),
1751                    $others = self.$dropdowns.not($dropdown);
1752
1753                if($dropdown.length) {
1754                    self.toggle($dropdown);
1755                    e.preventDefault();
1756                }
1757
1758                self.close($others);
1759            });
1760
1761            this._initialized = true;
1762        };
1763
1764        App.modules.dropdown.close = function($dropdowns) {
1765            if(!$.isjQuery($dropdowns, true)) return;
1766
1767            $dropdowns.removeClass(this.activeClass)
1768                      .find('.' + this.elementClass)
1769                      .attr('aria-hidden', 'true')
1770                      .end()
1771                      .find('.' + this.titleClass)
1772                      .attr('aria-expanded', 'false');
1773        };
1774
1775        App.modules.dropdown.open = function($dropdowns) {
1776            if(!$.isjQuery($dropdowns, true)) return;
1777
1778            this.fixPosition($dropdowns);
1779
1780            $dropdowns.addClass(this.activeClass)
1781                      .find('.' + this.elementClass)
1782                      .attr('aria-hidden', 'false')
1783                      .end()
1784                      .find('.' + this.titleClass)
1785                      .attr('aria-expanded', 'true');
1786        };
1787
1788        App.modules.dropdown.fixPosition = function($dropdowns) {
1789            var self = this,
1790                $w = $(window);
1791
1792            if(!$.isjQuery($dropdowns, true)) return;
1793
1794            return $dropdowns.each(function(index, dropdown) {
1795                var $dropdown = $(dropdown),
1796                    $element = $dropdown.find('.' + self.elementClass),
1797                    dOffset;
1798
1799                $element.removeClass(self.leftPlacedClass)
1800                        .removeClass(self.rightPlacedClass)
1801                        .removeClass(self.topPlacedClass);
1802
1803                dOffset = $element.offset();
1804
1805                // x
1806                if(dOffset.left - self.config.availableError < 0) {
1807                    $element.addClass(self.leftPlacedClass);
1808                }
1809                else if(dOffset.left + $element.outerWidth() + self.config.availableError > $w.width()) {
1810                    $element.addClass(self.rightPlacedClass);
1811                }
1812
1813                // y
1814                if(dOffset.top + $element.outerHeight() + self.config.availableError > $w.scrollTop() + $w.height()) {
1815                    $element.addClass(self.topPlacedClass);
1816                }
1817            });
1818        };
1819
1820        App.modules.dropdown.toggle = function($dropdowns) {
1821            if(!$.isjQuery($dropdowns, true)) return;
1822            var self = this;
1823
1824            return $dropdowns.each(function(index, dropdown){
1825                var $dropdown = $(dropdown);
1826
1827                if($dropdown.hasClass(self.activeClass)) self.close($dropdown);
1828                else self.open($dropdown);
1829            });
1830        };
1831
1832    /* ----------------------------------------
1833            End of Dropdown
1834     ---------------------------------------- */
1835    /* ----------------------------------------
1836            Arctic Modal
1837     ---------------------------------------- */
1838
1839        App.modules.arcticModals = {
1840             _config: {
1841                 type: 'html',
1842      
1842           closeOnOverlayClick: true,
1843                 overlay: {
1844                    css: {
1845                        opacity: 0,
1846                        backgroundColor: '#000000'
1847                    }
1848                 },
1849                 clickableElements: null
1850             },
1851             _collection: $(),
1852             init: function( collection, config ) {
1853
1854                 if( !collection || !collection.length ) return;
1855
1856                 config = $.isPlainObject( config ) ? $.extend(true, {}, this._config, config) : this._config;
1857
1858                 config = this._prepareCallbacks( config );
1859
1860                 if( config && config.clickableElements ) {
1861                     $body.on('click.MadArcticModals', '.arcticmodal-container', function(e){
1862                         var $target = $(e.target);
1863                         if( !$target.closest( config.clickableElements ).length ) {
1864                             $.arcticmodal('close');
1865                         }
1866                     });
1867                 }
1868
1869                 collection.on('click.MadArcticModals', function(e) {
1870
1871                     var $this = $(this);
1872
1873                     if( $this.data('arctic-modal-type') == 'ajax' ) {
1874                         if(!$this.data('arctic-modal-ajax-action')) {
1875                             return;
1876                         }
1877
1878                         $.arcticmodal($.extend(true, {}, config, {
1879                             type: 'ajax',
1880                             url: MadAJAXData.url,
1881                             ajax: {
1882                                 cache: false,
1883                                 dataType: 'html',
1884                                 data: {
1885                                     action: $this.data('arctic-modal-ajax-action'),
1886                                     data: $this.data('arctic-modal-ajax-data'),
1887                                     AJAX_token: MadAJAXData.AJAX_token
1888                                 },
1889                                 success: function(data, el, response) {
1890                                     data.body.html( response );
1891                                 }
1892                             }
1893                         }));
1894                     }
1895                     else {
1896                         $($this.data('arctic-modal')).arcticmodal(config);
1897                     }
1898
1899                     e.preventDefault();
1900                 });
1901             },
1902             _prepareCallbacks: function(config) {
1903                var beforeOpenCallback = config.beforeOpen || function(){},
1904                	beforeCloseCallback = config.beforeClose || function(){},
1905                	afterOpenCallback = config.afterOpen || function(){},
1906                	afterCloseCallback = config.afterClose || function(){};
1907
1908                config.beforeOpen = function() {
1909
1910                	beforeOpenCallback.apply(this, Array.prototype.slice(arguments, 0));
1911                };
1912
1913                config.afterOpen = function () {
1914                	if(App.LinkUnderliner) {
1915                        App.LinkUnderliner.init(this.body.find('a'));
1916                	}
1917                	afterOpenCallback.apply(this, Array.prototype.slice(arguments, 0));
1918                };
1919
1920                config.beforeClose = function(event) {
1921
1922                	beforeCloseCallback.apply(this, Array.prototype.slice(arguments, 0));
1923                };
1924
1925                config.afterClose = function(event) {
1926                    $body.css('overflow', '');
1927
1928                	afterCloseCallback.apply(this, Array.prototype.slice(arguments, 0));
1929                };
1930
1931                return config;
1932
1933			}
1934        };
1935
1936    /* ----------------------------------------
1937            End of Arctic Modal
1938     ---------------------------------------- */
1939
1940    /* ----------------------------------------
1941        Alert Message Module
1942    ---------------------------------------- */
1943
1944        App.modules.alertMessage = function(options) {
1945            if(!('Handlebars' in window)) return;
1946            var config = {
1947                target: $body.children().last(),
1948                type: 'info',
1949                timeout: 4000
1950            };
1951            config = options && $.isPlainObject(options) ? $.extend(true, {}, config, options) : config;
1952
1953            var template =
1954                '<div class="mad-alert-box mad-alert-box--{{type}}" style="display: none;">\
1955                    <div class="mad-alert-box-inner">\
1956                        {{message}}\
1957                    </div>\
1958                </div>';
1959
1960            var messageBox = $(Handlebars.compile(template)(config));
1961            messageBox.data('timeOut', setTimeout(function(){
1962                messageBox.stop().slideUp({
1963                    duration: 350,
1964                    easing: 'linear',
1965                    complete: function() {
1966                        $(this).remove();
1967                        App.helpers.updateGlobalNiceScroll();
1968                    },
1969                    step: function() {
1970                        var $this = $(this),
1971                            $niceScrolled = $this.closest('.mad--nice-scrolled');
1972
1973                        if($niceScrolled.length) {
1974                            $niceScrolled.getNiceScroll().resize();
1975                        }
1976                        App.helpers.updateGlobalNiceScroll();
1977
1978                    }
1979                });
1980            }, config.timeout)).insertAfter(config.target).stop().slideDown({
1981                duration: 350,
1982                easing: 'linear',
1983                step: function() {
1984                    var $this = $(this),
1985                        $niceScrolled = $this.closest('.mad--nice-scrolled');
1986
1987                    if($niceScrolled.length) {
1988                        $niceScrolled.getNiceScroll().resize();
1989                    }
1990                    App.helpers.updateGlobalNiceScroll();
1991
1992                },
1993                completer: function() {
1994                    App.helpers.updateGlobalNiceScroll();
1995                }
1996            });
1997        };
1998
1999    /* ----------------------------------------
2000        End of Alert Message Module
2001    ---------------------------------------- */
2002
2003
2004    /* ----------------------------------------
2005            Section Module
2006     ---------------------------------------- */
2007
2008        App.modules.Section = {};
2009        App.modules.Section._$collection = $();
2010        App.modules.Section.config = {
2011            cssPrefix: 'mad-',
2012            resizeDelay: 10,
2013            boddyPaddings: false,
2014            classMap: {
2015                loading: 'section--loading',
2016                stretched: 'section--stretched',
2017                stretchedContent: 'section--stretched-content',
2018                stretchedContentNoPadding: 'section--stretched-content-no-px',
2019                bgColorElementClass: 'colorizer-bg-color',
2020                bgImageElementClass: 'colorizer-bg-image'
2021            }
2022        };
2023
2024        Object.defineProperties(App.modules.Section, {
2025            bgColorElementClass: {
2026                get: function() {
2027                    return this.config.cssPrefix + this.config.classMap.bgColorElementClass;
2028                }
2029            },
2030            bgImageElementClass: {
2031                get: function() {
2032                    return this.config.cssPrefix + this.config.classMap.bgImageElementClass;
2033                }
2034            },
2035            stretchedClass: {
2036                get: function() {
2037                    return this.config.cssPrefix + this.config.classMap.stretched;
2038                }
2039            },
2040            stretchedContentClass: {
2041                get: function() {
2042                    return this.config.cssPrefix + this.config.classMap.stretchedContent;
2043                }
2044            },
2045            stretchedContentNoPaddingClass: {
2046                get: function() {
2047                    return this.config.cssPrefix + this.config.classMap.stretchedContentNoPadding;
2048                }
2049            },
2050            loadingClass: {
2051                get: function() {
2052                    return this.config.cssPrefix + this.config.classMap.loading;
2053                }
2054            }
2055        });
2056
2057        App.modules.Section.changeConfig = function(config) {
2058            return $.extend(true, this.config, config);
2059        };
2060
2061        App.modules.Section.init = function($collection) {
2062            var self = this;
2063
2064            if(!$.isjQuery($collection, true)) return;
2065
2066            if(!this._bindedGlobalEvents) this._bindGlobalEvents();
2067
2068            return $collection.each(function(index, section){
2069                var $section = $(section);
2070
2071                if(self._$collection.filter($section).length) return;
2072
2073                self.build($section);
2074                self._$collection = self._$collection.add($section);
2075            });
2076        };
2077
2078        App.modules.Section._bindGlobalEvents = function () {
2079            var self = this;
2080
2081            $(window).on('resize.App.modules.Section', function() {
2082                if(self._resizeTimeOutId) clearTimeout(self._resizeTimeOutId);
2083
2084                self._resizeTimeOutId = setTimeout(function(){
2085                    self.rebuild();
2086                }, self.config.resizeDelay);
2087            });
2088        };
2089
2090        App.modules.Section.rebuild = function() {
2091            var self = this;
2092
2093            return this._$collection.each(function(index, section){
2094                var $section = $(section);
2095
2096                self.reset($section).build($section);
2097            });
2098        };
2099
2100        App.modules.Section.reset = function($section) {
2101            if(!$.isjQuery($section, true)) return;
2102
2103            $section.css({
2104                'margin-left': '',
2105                'margin-right': ''
2106            });
2107
2108            return this;
2109        };
2110
2111        App.modules.Section.build = function($section) {
2112            if(!$.isjQuery($section, true)) return;
2113
2114            if($section.hasClass(this.stretchedClass)) {
2115                this.stretch($section);
2116            }
2117            else if($section.hasClass(this.stretchedContentClass) || $section.hasClass(this.stretchedContentNoPaddingClass)) {
2118                this.stretchContent($section);
2119            }
2120
2121            return this;
2122        };
2123
2124        App.modules.Section.getDocumentGeometry = function() {
2125            return {
2126                'padding-left': parseInt($body.css('padding-left'), 10),
2127                'padding-right': parseInt($body.css('padding-right'), 10)
2128            };
2129        };
2130
2131        App.modules.Section.stretch = function($section) {
2132            var $bgs, xOffsetDiff, documentGeometry;
2133
2134            if(!$.isjQuery($section, true)) return;
2135
2136            $bgs = $section.find('.' + this.bgColorElementClass + ', .' + this.bgImageElementClass);
2137
2138            if(!$bgs.length) return;
2139
2140            xOffsetDiff = $section.offset().left;
2141            documentGeometry = this.getDocumentGeometry();
2142
2143            if(xOffsetDiff > 0) {
2144                $bgs.css({
2145                    left: (xOffsetDiff - documentGeometry['padding-left']) / -1,
2146                    right: (xOffsetDiff - documentGeometry['padding-right']) / -1
2147                });
2148            }
2149
2150            $section.removeClass(this.loadingClass).trigger('stretched.mad.Section', [$
2150section]);
2151
2152            return $section;
2153        };
2154
2155        App.modules.Section.stretchContent = function($section) {
2156            var xOffsetDiff, documentGeometry;
2157
2158            if(!$.isjQuery($section) || !$section.length) return;
2159
2160            xOffsetDiff = $section.offset().left;
2161            documentGeometry = this.getDocumentGeometry();
2162
2163            if(xOffsetDiff > 0) {
2164                $section.css({
2165                    'margin-left': (xOffsetDiff - documentGeometry['padding-left']) / -1,
2166                    'margin-right': (xOffsetDiff - documentGeometry['padding-right']) / -1
2167                });
2168            }
2169
2170            $section.removeClass(this.loadingClass).trigger('stretched.mad.Section', [$section]);
2171
2172            return $section;
2173        };
2174
2175     /* ----------------------------------------
2176            End of Section Module
2177      ---------------------------------------- */
2178
2179     /* ----------------------------------------
2180            Nice Scroll updater
2181      ---------------------------------------- */
2182
2183        App.helpers.updateGlobalNiceScroll = function() {
2184            $body.getNiceScroll().resize();
2185        };
2186
2187     /* ----------------------------------------
2188            End of Nice Scroll updater
2189      ---------------------------------------- */
2190
2191     /* ----------------------------------------
2192            ID Randomizer
2193      ---------------------------------------- */
2194
2195        App.helpers.getRandomId = function(idPart) {
2196            if(!('ids' in App._localCache)) App._localCache['ids'] = [];
2197            idPart = idPart || 'identifier';
2198
2199            var id = idPart + '-' + +(new Date());
2200
2201            if(App._localCache['ids'].indexOf(id) != -1) {
2202                id = App.helpers.getRandomId(idPart);
2203            }
2204
2205            App._localCache['ids'].push(id);
2206
2207            return id;
2208        };
2209
2210     /* ----------------------------------------
2211            End of ID Randomizer
2212      ---------------------------------------- */
2213
2214
2215     /* ----------------------------------------
2216            Colorizer
2217      ---------------------------------------- */
2218
2219        App.helpers.Colorizer = {};
2220        App.helpers.Colorizer.config = {
2221            cssPrefix: 'mad-',
2222            classMap: {
2223                bgColorElement: 'colorizer-bg-color',
2224                bgImageElement: 'colorizer-bg-image',
2225                parallax: 'colorizer--parallax'
2226            },
2227            afterInit: function() {}
2228        };
2229
2230        Object.defineProperties(App.helpers.Colorizer, {
2231            bgColorElementClass: {
2232                get: function() {
2233                    return this.config.cssPrefix + this.config.classMap.bgColorElement;
2234                }
2235            },
2236            bgImageElementClass: {
2237                get: function() {
2238                    return this.config.cssPrefix + this.config.classMap.bgImageElement;
2239                }
2240            },
2241            parallaxClass: {
2242                get: function() {
2243                    return this.config.cssPrefix + this.config.classMap.parallax;
2244                }
2245            }
2246        });
2247
2248        /**
2249         *
2250         * @param {jQuery} $collection - collection of elements to colorize
2251         * @returns {jQuery} $collection
2252         */
2253        App.helpers.Colorizer.init = function($collection, config) {
2254            var self = this;
2255
2256            if(!$.isjQuery($collection, true)) return $collection;
2257
2258            this.config = $.extend(true, {}, this.config, config);
2259
2260            $collection.each(function(index, element) {
2261                var $element = $(element);
2262
2263                if(!self.hasBGColorElement($element)) {
2264                    self.appendBGColorElement($element);
2265                }
2266
2267                if(!self.hasBGImageElement($element) && $element.data('bg-image-src')) {
2268                    self.appendBGImageElement($element);
2269                }
2270            });
2271
2272            this.config.afterInit.call(this);
2273
2274            return $collection;
2275        };
2276
2277        /**
2278         *
2279         * @param {jQuery} $element
2280         * @returns {Boolean}
2281         */
2282        App.helpers.Colorizer.hasBGColorElement = function($element) {
2283            return $element.children('.' + this.bgColorElementClass).length;
2284        };
2285
2286        /**
2287         *
2288         * @param {jQuery} $element
2289         * @returns {Boolean}
2290         */
2291        App.helpers.Colorizer.hasBGImageElement = function($element) {
2292            return $element.children('.' + this.bgImageElementClass).length;
2293        };
2294
2295        /**
2296         *
2297         * @param {jQuery} $element
2298         * @returns {jQuery}
2299         */
2300        App.helpers.Colorizer.appendBGColorElement = function($element) {
2301            var self = this,
2302                $bgColorElement = $('<div></div>', {
2303                    class: self.bgColorElementClass
2304                });
2305
2306            return $element.prepend($bgColorElement);
2307        };
2308
2309        /**
2310         *
2311         * @param {jQuery} $element
2312         * @returns {jQuery}
2313         */
2314        App.helpers.Colorizer.appendBGImageElement = function($element) {
2315            var self = this,
2316                src = $element.data('bg-image-src'),
2317                $bgImageElement = $('<div></div>', {
2318                    class: self.bgImageElementClass
2319                });
2320
2321            $bgImageElement.css('background-image',  'url("'+src+'")');
2322            $element.prepend($bgImageElement);
2323
2324            return $element;
2325        };
2326
2327     /* ----------------------------------------
2328            End of Colorizer
2329      ---------------------------------------- */
2330
2331
2332     /* ----------------------------------------
2333            Breadcrumb
2334      ---------------------------------------- */
2335
2336        App.helpers.Breadcrumb = {};
2337        App.helpers.Breadcrumb.$collection = $();
2338        App.helpers.Breadcrumb.$w = $(window);
2339
2340        App.helpers.Breadcrumb.config = {
2341            until: 767,
2342            cssPrefix: 'mad-',
2343            resizeTimeoutDelay: 10,
2344            classMap: {
2345                bgColorElement: 'colorizer-bg-color',
2346                bgImageElement: 'colorizer-bg-image'
2347            }
2348        };
2349
2350        Object.defineProperties(App.helpers.Breadcrumb, {
2351            bgColorElementClass: {
2352                get: function() {
2353                    return this.config.cssPrefix + this.config.classMap.bgColorElement;
2354                }
2355            },
2356            bgImageElementClass: {
2357                get: function() {
2358                    return this.config.cssPrefix + this.config.classMap.bgImageElement;
2359                }
2360            },
2361            bgsSelectors: {
2362                get: function() {
2363                    return '.' + this.bgColorElementClass + ', .' + this.bgImageElementClass;
2364                }
2365            }
2366        });
2367
2368        App.helpers.Breadcrumb.init = function($breadcrumbs) {
2369            var self = this;
2370
2371            if(!$.isjQuery($breadcrumbs, true)) return;
2372
2373            this._bindEvents();
2374
2375            $breadcrumbs.each(function(index, element) {
2376                var $element = $(element);
2377
2378                if(self.$collection.filter($element).length) return;
2379
2380                self.initCertainElement($element);
2381            });
2382        };
2383
2384        App.helpers.Breadcrumb._bindEvents = function() {
2385            var self = this;
2386
2387            if(!this._eventsBinded) {
2388                $body.on('spaceremoved.mad.stickysection', function() {
2389                    self.$collection.each(function(index, element){
2390                        self.stretch($(element));
2391                    });
2392                });
2393
2394                this.$w.on('resize', function() {
2395                    if(self._resizeTimeOutId) clearTimeout(self._resizeTimeOutId);
2396
2397                    self._resizeTimeOutId = setTimeout(function(){
2398                        self.$collection.each(function(index, element){
2399                            self.stretch($(element));
2400                        });
2401                    }, self.config.resizeTimeoutDelay);
2402                });
2403            }
2404        };
2405
2406        App.helpers.Breadcrumb.initCertainElement = function($breadcrumb) {
2407            this.$collection = this.$collection.add($breadcrumb);
2408
2409            this.stretch($breadcrumb);
2410        };
2411
2412        App.helpers.Breadcrumb.stretch = function($breadcrumb) {
2413            var $prev = $breadcrumb.prev(),
2414                prevOH,
2415                $bgs,
2416                $stickedSections;
2417
2418            if($.isjQuery($prev, true)) {
2419                prevOH = $prev.outerHeight();
2420                $bgs = $breadcrumb.find(this.bgsSelectors);
2421                $stickedSections = $('.mad-header-section--sticked');
2422
2423                if($bgs.length) {
2424                    $bgs.css({
2425                        top: -prevOH
2426                    });
2427                }
2428                if($stickedSections.length) {
2429                    $bgs.css({
2430                        top: $stickedSections.outerHeight() * -1
2431                    });
2432                }
2433            }
2434
2435            return $breadcrumb;
2436        };
2437
2438     /* ----------------------------------------
2439            End of Breadcrumb
2440      ---------------------------------------- */
2441
2442
2443    /* ----------------------------------------
2444        Critical Error
2445    ---------------------------------------- */
2446
2447        App.helpers.showCriticalFullScreenMessage = function(config) {
2448            var _config = {
2449                after: '',
2450                before: '',
2451                content: '',
2452                cssPrefix: 'mad-',
2453                cssClass: ''
2454            },
2455            template = '<div class="%cssPrefix%fullscreen-message %cssClass% %cssPrefix%aligner">\
2456                            <div class="%cssPrefix%aligner-outer">\
2457                                <div class="%cssPrefix%aligner-inner">\
2458                                    <div class="%cssPrefix%fullscreen-message-before">%before%</div>\
2459                                    <div class="%cssPrefix%fullscreen-message-content">%content%</div>\
2460                                    <div class="%cssPrefix%fullscreen-message-after">%after%</div>\
2461                                </div>\
2462                            </div>\
2463                        </div>';
2464
2465
2466            config = $.extend(_config, config);
2467
2468            for(var option in config) {
2469                template = template.replace(new RegExp('%' + option + '%', 'g'), config[option]);
2470            }
2471
2472            $body.html('').addClass(config.cssPrefix + 'body--has-critical-fullscreen-message').append(template);
2473        };
2474
2475    /* ----------------------------------------
2476        End of Critical Error
2477    ---------------------------------------- */
2478
2479
2480      /* ----------------------------------------
2481            Dynamic background image
2482       ---------------------------------------- */
2483
2484            App.helpers.dynamicBgImage = function(collection) {
2485                collection = $.isjQuery(collection) ? collection : $('[data-bg-image-src]');
2486                if(!collection.length) return;
2487
2488                return collection.each(function(i, el){
2489                    var $this = $(el);
2490                    if( !$this.data('bg-image-src') ) return;
2491
2492                    $this.css('background-image', 'url("'+ $this.data('bg-image-src') +'")');
2493                });
2494            },
2495
2496       /* ----------------------------------------
2497            End of Dynamic background image
2498        ---------------------------------------- */
2499
2500        /* ----------------------------------------
2501            Booking Form V2V4
2502         ---------------------------------------- */
2503
2504            App.helpers.bookingFormV2V4 = function() {
2505                $body.on('click.MadBookingFormV2V4', '.mad-booking-form--style-2 .form-control, .mad-booking-form--style-4 .form-control', function(event) {
2506                    var $current = $(this),
2507                        $form = $current.closest('.mad-booking-form--style-2, .mad-booking-form--style-4');
2508
2509                    $current.addClass('form-control--over');
2510
2511                    $form.find('.form-control').not($current).removeClass('form-control--over');
2512                });
2513
2514                $doc.on('click.MadBookingFormV2V4', function(event) {
2515                    var $target = $(event.target);
2516
2517                    if(!$target.closest('.mad-booking-form--style-2, .mad-booking-form--style-4').length) {
2518                        $('.mad-booking-form--style-2 .form-control--over, .mad-booking-form--style-4 .form-control--over').removeClass('form-control--over');
2519                    }
2520                });
2521            };
2522
2523        /* ----------------------------------------
2524            End of Booking Form V2
2525         ---------------------------------------- */
2526
2527         /* ----------------------------------------
2528             Booking Form V3
2529          ---------------------------------------- */
2530
2531             App.helpers.bookingFormV3 = function() {
2532                 $body.on('click.MadBookingFormV3', '.mad-booking-form--style-3 [class*="form-col"]', function(event) {
2533                     var $current = $(this),
2534                         $form = $current.closest('.mad-booking-form--style-3');
2535
2536                     $current.addClass('form-col--over');
2537
2538                     $form.find('[class*="form-col"]').not($current).removeClass('form-col--over');
2539                 });
2540
2541                 $doc.on('click.MadBookingFormV3', function(event) {
2542                     var $target = $(event.target);
2543
2544                     if(!$target.closest('.mad-booking-form--style-3').length) {
2545                         $('.mad-booking-form--style-3 .form-col--over').removeClass('form-col--over');
2546                     }
2547                 });
2548             };
2549
2550         /* ----------------------------------------
2551             End of Booking Form V3
2552          ---------------------------------------- */
2553
2554         /* ----------------------------------------
2555             Toggled fields
2556          ---------------------------------------- */
2557
2558            App.helpers.toggledFields = function() {
2559                $body.off('click.MadToggledFields').on('click.MadToggledFields', '.mad-toggled-fields-invoker', function(event) {
2560                    var $this = $(this),
2561                        $fields = $this.siblings('.mad-toggled-fields');
2562
2563                    $this.toggleClass('mad-toggled-fields-invoker--opened');
2564
2565                    if($fields.length) {
2566                        $fields.stop().slideToggle({
2567                            duration: App.ANIMATIONDURATION,
2568                            easing: App.ANIMATIONEASING,
2569                        });
2570                    }
2571                });
2572            };
2573
2574         /* ----------------------------------------
2575             End of Toggled fields
2576          ---------------------------------------- */
2577
2578
2579         /* ----------------------------------------
2580             Calendar Widget
2581          ---------------------------------------- */
2582
2583            App.helpers.calendarWidget = function() {
2584                var $calendar = $('.calendar_wrap'),
2585                    $caption,
2586                    $prev,
2587                    $next;
2588                if(!$calendar.length || $calendar.hasClass('mad-calendar-rendered')) return;
2589
2590                $caption = $calendar.find('caption');
2591
2592                if(!$caption.length) return;
2593
2594                $prev = $calendar.find('#prev > a');
2595                $next = $calendar.find('#next > a');
2596
2597                if($prev.length) {
2598                    $('<a></a>', {
2599                        class: 'calendar-caption-prev mad-ln--independent',
2600                        html: App.RTL ? '<i class="icon licon-arrow-right"></i>' : '<i class="icon licon-arrow-left"></i>',
2601                        href: $prev.attr('href')
2602                    }).appendTo($caption);
2603                }
2604
2605                if($next.length) {
2606                    $('<a></a>', {
2607                        class: 'calendar-caption-next mad-ln--independent',
2608                        html: App.RTL ? '<i class="icon licon-arrow-left"></i>' : '<i class="icon licon-arrow-right"></i>',
2609                        href: $next.attr('href')
2610                    }).appendTo($caption);
2611                }
2612
2613                $calendar.addClass('mad-calendar-rendered');
2614            };
2615
2616         /* ----------------------------------------
2617             End of Calendar Widget
2618          ---------------------------------------- */
2619
2620
2621        /* ----------------------------------------
2622            Owl Carousel helpers
2623         ---------------------------------------- */
2624
2625             App.baseOwlSettings = {
2626                 items: 1,
2627                 margin: 30,
2628                 nav: true,
2629                 rtl: App.RTL,
2630                 navText: App.RTL ? ['<i class="icon licon-arrow-right"></i>', '<i class="icon licon-arrow-left"></i>'] : ['<i class="icon licon-arrow-left"></i>', '<i class="icon licon-arrow-right"></i>'],
2631                 dots: false,
2632                 autoplayHoverPause: true,
2633                 smartSpeed: App.ANIMATIONDURATION,
2634                 fluidSpeed: App.ANIMATIONDURATION,
2635                 autoplaySpeed: App.ANIMATIONDURATION,
2636                 navSpeed: App.ANIMATIONDURATION,
2637                 dotsSpeed: App.ANIMATIONDURATION,
2638                 dragEndSpeed: App.ANIMATIONDURATION,
2639                 onInitialized: function() {
2640                     App.helpers.updateGlobalNiceScroll();
2641                 }
2642             };
2643
2644             App.helpers.owlAdaptive = function(collection) {
2645
2646                 collection = collection ? collection : $('.owl-carousel');
2647                 if(!collection.length) return;
2648
2649
2650                 collection.each(function(i, el){
2651
2652                     var $this = $(el);
2653
2654                     $this.on('initialized.owl.carousel', function(e){
2655
2656                         App.helpers.owlUpdateIsotopeParent($this);
2657
2658                     });
2659
2660                     $this.on('resized.owl.carousel', function(e){
2661
2662                         App.helpers.owlContainerHeight($this, true);
2663
2664                     });
2665
2666                     $this.on('changed.owl.carousel', function(e){
2667
2668                         App.helpers.owlContainerHeight($this);
2669
2670                     });
2671
2672                 });
2673
2674             };
2675
2676             App.helpers.owlContainerHeight = function(owl, resized) {
2677
2678                 if(owl.hasClass('owl-carousel--vadaptive')) return;
2679
2680                 setTimeout(function(){
2681
2682                     var max = 0,
2683                         items = owl.find('.owl-item'),
2684                         activeItems = items.filter('.active').children();
2685
2686                     items.children().css('height', 'auto');
2687
2688                     activeItems.each(function(i, el){
2689
2690                         var $this = $(el),
2691                             height = $this.outerHeight();
2692
2693                         if(height > max) max = height;
2694
2695                     });
2696
2697                     owl.find('.owl-stage-outer').stop().animate({
2698                         height: max
2699                     }, {
2700                         duration: 150,
2701                         complete: function() {
2702                            if(!resized) return;
2703                            App.helpers.owlUpdateIsotopeParent($(this));
2704                         }
2705                     });
2706
2707                 }, 20);
2708
2709             };
2710
2711             App.helpers.owlUpdateIsotopeParent = function($owl) {
2712                 var $isotope = $owl.closest('.mad-grid--isotope');
2713                 if($isotope.length) $isotope.isotope('layout');
2714             };
2715
2716             App.helpers.owlNav = function(owl) {
2717
2718                 setTimeout(function(){
2719
2720                     var settings = owl.data('owl.carousel').settings;
2721                     if(settings.autoplay || settings.loop) return;
2722
2723                     var prev = owl.find('.owl-prev'),
2724                         next = owl.find('.owl-next');
2725
2726                     if(owl.find('.owl-item').first().hasClass('active')) prev.addClass('mad-disabled');
2727                     else prev.removeClass('mad-disabled');
2728
2729                     if(owl.find('.owl-item').last().hasClass('active')) next.addClass('mad-disabled');
2730                     else next.removeClass('mad-disabled');
2731
2732                 }, 100);
2733
2734             };
2735
2736            App.helpers.owlSettings = function(settings) {
2737
2738                return $.extend(true, {}, App.baseOwlSettings, settings);
2739
2740            };
2741
2742             App.helpers.owlSync = {
2743
2744				init: function() {
2745
2746					this.collection = $('.owl-carousel[data-sync]');
2747					if(!this.collection.length) return;
2748
2749					this.prepare();
2750				},
2751
2752				prepare: function(){
2753
2754					this.collection.each(function(i, el){
2755
2756						var $this = $(el),
2757							sync = $($this.data('sync'));
2758
2759						sync.on('changed.owl.carousel', function(e){
2760
2761							var index = e.item.index;
2762
2763							if(!sync.data('afterClicked')) $this.trigger('to.owl.carousel', [index, 350, true]);
2764
2765							sync.data('afterClicked', false);
2766
2767						});
2768
2769						$this.on('prev.owl.carousel', function(){
2770
2771							sync.trigger('prev.owl.carousel');
2772
2773						});
2774
2775						$this.on('next.owl.carousel', function(){
2776
2777							sync.trigger('next.owl.carousel');
2778
2779						});
2780
2781						$this.on('click.owlSync', '.owl-item', function(e){
2782
2783							e.preventDefault();
2784
2785							var index = $(this).index();
2786
2787							sync.data('afterClicked', true);
2788
2789							sync.trigger('to.owl.carousel', [index, 350, true]);
2790
2791						});
2792
2793					});
2794
2795				}
2796
2797			};
2798
2799         /* ----------------------------------------
2800            End of Owl Carousel helpers
2801          ---------------------------------------- */
2802
2803         /* ----------------------------------------
2804               Rating
2805          ---------------------------------------- */
2806
2807            function MadRating($element, config) {
2808                this.$element = $element;
2809                this.config = $.extend(MadRating.config, config);
2810
2811                Object.defineProperties(this, {
2812                    bottomLevelElementClass: {
2813                        get: function() {
2814                            return this.config.cssPrefix + this.config.classMap.bottomLevelElement;
2815                        }
2816                    },
2817                    topLevelElementClass: {
2818                        get: function() {
2819                            return this.config.cssPrefix + this.config.classMap.topLevelElement;
2820                        }
2821                    }
2822                });
2823            };
2824
2825            MadRating.config = {
2826                cssPrefix: 'mad-',
2827                bottomLevelElements: '<i class="icon licon-star-empty"></i>',
2828                topLevelElements: '<i class="icon licon-star"></i>',
2829                estimate: 5,
2830                rtl: App.RTL,
2831                classMap: {
2832                    bottomLevelElement: 'rating-bottom-level',
2833                    topLevelElement: 'rating-top-level'
2834                }
2835            };
2836
2837            MadRating.prototype.init = function() {
2838                this._buildMarkup();
2839
2840                return this;
2841            };
2842
2843            MadRating.prototype._buildMarkup = function() {
2844                var _self = this;
2845
2846                if(this._markupBuilded) return;
2847
2848                this.$element.css({
2849                    'position': 'relative',
2850                    'display': 'inline-block'
2851                });
2852
2853                if(this.config.topLevelElements) {
2854                    this.$topLevelEl = $('<div></div>', {
2855                        class: _self.topLevelElementClass,
2856                        style: 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; white-space: nowrap; overflow: hidden;'
2857                    });
2858
2859                    for(var i = 0; i < 5; i++) this.$topLevelEl.append(this.config.topLevelElements);
2860
2861                    this.$element.append(this.$topLevelEl);
2862                }
2863
2864                if(this.config.bottomLevelElements) {
2865                    this.$bottomLevelEl = $('<div></div>', {
2866                        class: _self.bottomLevelElementClass,
2867                        style: 'position: relative; z-index: 1;'
2868                    });
2869
2870                    for(var i = 0; i < 5; i++) this.$bottomLevelEl.append(this.config.bottomLevelElements);
2871
2872                    this.$element.append(this.$bottomLevelEl);
2873                }
2874
2875
2876                this.update(this.config.estimate);
2877
2878                this._markupBuilded = true;
2879
2880                this.$element.trigger('built.mad.Rating', [this.$element]);
2881            };
2882
2883            MadRating.prototype.update = function(estimate) {
2884                if(this.config.topLevelElements) {
2885                    this.$topLevelEl.css('width', (estimate / 5 * 100) + '%');
2886                }
2887                else {
2888                    if(this.config.bottomLevelElements) {
2889                        this.$bottomLevelEl.html('');
2890                        for(var i = 0; i < Math.round(estimate); i++) this.$bottomLevelEl.append(this.config.bottomLevelElements);
2891                    }
2892                }
2893            };
2894
2895            App.helpers.rating = function($collection, config) {
2896                config = config || {};
2897
2898                if(!$.isjQuery($collection) || !$collection.length) return $collection;
2899
2900                return $collection.each(function(index, element) {
2901                    var $element = $(element),
2902                        elementConfig = $.extend(true, {}, config, {estimate: $element.data('estimate')});
2903
2904                    if(!$element.data('Rating')) $element.data('Rating', new MadRating($element, elementConfig).init());
2905                });
2906            };
2907
2908
2909
2910            App.helpers.ratingField = function($collection) {
2911                if(!$.isjQuery($collection)) return;
2912
2913                $collection.on('click.MadRatingField', '.icon', function(event) {
2914                    var $icon = $(this),
2915                        $rating = $icon.closest('[data-estimate]'),
2916                        index = $icon.index() + 1,
2917                        Rating = $rating.data('Rating'),
2918                        $field = $rating.siblings('input[type="hidden"]');
2919
2920                    if(Rating) {
2921                        Rating.update( App.RTL ? 6 - index : index);
2922
2923                        if($field.length) {
2924                            $field.val(index);
2925                        }
2926                    }
2927
2928                    event.preventDefault();
2929                    event.stopPropagation();
2930                });
2931            };
2932
2933         /* ----------------------------------------
2934               End of Rating
2935          ---------------------------------------- */
2936
2937         /* ----------------------------------------
2938               Touch hover emulator
2939          ---------------------------------------- */
2940
2941            App.helpers.touchHoverEmulator = function($container, targetSelector, itemSelector) {
2942                if(!App.ISTOUCH || !$.isjQuery($container) || !$container.length) return;
2943
2944                var hoverClass = 'mad-touch-hover',
2945                    preventedClass = 'mad-event-prevented';
2946
2947                $container.on('click.touchHoverEmulator', targetSelector, function(event){
2948                    var $link = $(this),
2949                        $items,
2950                        $targets,
2951                        $item = $link.closest(itemSelector);
2952
2953                    if($link.get(0).tagName.toUpperCase() != 'A') return;
2954
2955                    $items = $container.find(itemSelector);
2956                    if($items.not($item).length) $items.not($item).removeClass(hoverClass);
2957
2958                    $targets = $container.find(targetSelector);
2959                    if($targets.not($link).length) $targets.not($link).removeClass(preventedClass);
2960
2961                    if(!$link.hasClass(preventedClass)) {
2962                        $link.addClass(preventedClass);
2963                        if($item.length) $item.addClass(hoverClass);
2964
2965                        event.preventDefault();
2966                    }
2967                });
2968            };
2969
2970         /* ----------------------------------------
2971               End Touch hover emulator
2972          ---------------------------------------- */
2973
2974
2975         /* ----------------------------------------
2976               Revolution slider helpers
2977          ---------------------------------------- */
2978
2979            App.helpers.revArrowsOutside = function() {
2980                if(window.MadRevArrowsOutsideEvents) return;
2981
2982                $body.on('click.revArrowsOutside', '.mad-rev-arrows-prev, .mad-rev-arrows-next', function(event) {
2983                    var $button = $(this),
2984                        $nav = $button.closest('.mad-rev-arrows-outside'),
2985                        revApi;
2986
2987
2988                    if(!$nav.length) return;
2989
2990                    revApi = window[$nav.data('rev-api')];
2991
2992                    if(!revApi) return;
2993
2994                    revApi[$button.hasClass('mad-rev-arrows-prev') ? 'revprev' : 'revnext']();
2995
2996                    event.preventDefault();
2997                });
2998
2999                window.MadRevArrowsOutsideEvents = true;
3000            };
3001
3002         /* ----------------------------------------
3003               End Revolution slider helpers
3004          ---------------------------------------- */
3005
3006         /* ----------------------------------------
3007               gridOwl
3008          ---------------------------------------- */
3009
3010            App.helpers.gridOwl = {
3011                _commonLayoutConfig: {
3012                    'columns-4': {
3013                        responsive: {
3014                            0: {
3015                                items: 1
3016                            },
3017                            768: {
3018                                items: 2
3019                            },
3020                            1200: {
3021                                items: 4
3022                            }
3023                        }
3024                    },
3025                    'columns-4-sidebar': {
3026                        responsive: {
3027                            0: {
3028                                items: 1
3029                            },
3030                            992: {
3031                                items: 2
3032                            },
3033                            1200: {
3034                                items: 3
3035                            }
3036                        }
3037                    },
3038                    'columns-3': {
3039                        responsive: {
3040                            0: {
3041                                items: 1
3042                            },
3043                            768: {
3044                                items: 2
3045                            },
3046                            1200: {
3047                                items: 3
3048                            }
3049                        }
3050                    },
3051                    'columns-3-sidebar': {
3052                        responsive: {
3053                            0: {
3054                                items: 1
3055                            },
3056                            992: {
3057                                items: 2
3058                            },
3059                            1200: {
3060                                items: 3
3061                            }
3062                        }
3063                    },
3064                    'columns-2': {
3065                        responsive: {
3066                            0: {
3067                                items: 1
3068                            },
3069                            768: {
3070                                items: 2
3071                            }
3072                        }
3073                    },
3074                    'columns-2-sidebar': {
3075                        responsive: {
3076                            0: {
3077                                items: 1
3078                            },
3079                            992: {
3080                                items: 2
3081                            }
3082                        }
3083                    }
3084                },
3085                _$collection: $(),
3086                _individualConfigs: {}
3087            };
3088
3089            /**
3090             * Initializes the gridOwl helper
3091             * @param {jQuery} $collection
3092             *
3093             * @returns {jQuery}
3094             */
3095            App.helpers.gridOwl.init = function($collection) {
3096                var self = this;
3097
3098                $collection = $.isjQuery($collection) ? $collection : $('.mad-grid.owl-carousel');
3099
3100                 $collection.each(function(index, element){
3101                    var $element = $(element);
3102
3103                    if(self._$collection.filter($element).length) return;
3104
3105                    self._$collection = self._$collection.add($element);
3106                });
3107
3108                this.update();
3109
3110                return $collection;
3111            };
3112
3113            /**
3114             * Modifies config for the elements with parents that match specified selector.
3115             * @param {String} selector
3116             * @param {Object} config
3117             *
3118             * @returns {Object}
3119             */
3120            App.helpers.gridOwl.extendConfigFor = function(selector, config) {
3121                this._individualConfigs[selector] = config;
3122
3123                return this;
3124            };
3125
3126            /**
3127             * Adds new carousel to the collection
3128             *
3129             * @param {jQuery} $carousel
3130             *
3131             * @returns {Object}
3132             */
3133            App.helpers.gridOwl.add = function($carousel) {
3134                if($.isjQuery($carousel) && !this._$collection.filter($carousel).length) {
3135                    this._$collection = this._$collection.add($carousel);
3136                    this.update();
3137                }
3138
3139                return this;
3140            };
3141
3142            /**
3143             * Initializes not initialized carousels.
3144             *
3145             * @returns {Object}
3146             */
3147            App.helpers.gridOwl.update = function() {
3148                var self = this;
3149
3150                this._$collection.each(function(index, element){
3151                    var $element = $(element),
3152                        config = {},
3153                        columnsCount,
3154                        layoutConfigProp;
3155
3156                    if($element.data('owl.carousel')) return;
3157
3158                    // detect layout settings
3159                    columnsCount = self._getColumnsCount($element);
3160
3161                    if(columnsCount > 1) {
3162                        // check if sidebar
3163                        if($element.closest('.mad-has-sidebar').length) {
3164                            layoutConfigProp = 'columns-' + columnsCount + '-sidebar';
3165                        }
3166                        else {
3167                            layoutConfigProp = 'columns-' + columnsCount;
3168                        }
3169
3170                        $.extend(config, self._commonLayoutConfig[layoutConfigProp]);
3171                    }
3172
3173                    for(var selector in self._individualConfigs) {
3174                        if($element.closest(selector).length) {
3175                            $.extend(config, self._individualConfigs[selector]);
3176
3177                            if($element.closest('.mad-has-sidebar').length) {
3178                                config.responsive = config.responsiveWithSidebar;
3179                            }
3180                        }
3181                    }
3182
3183
3184                    $element.owlCarousel(App.helpers.owlSettings(config));
3185                });
3186
3187                return this;
3188            };
3189
3190            /**
3191             * Returns amount of columns in the specified element.
3192             *
3193             * @param {jQuery} $element
3194             * @returns {Number}
3195             */
3196            App.helpers.gridOwl._getColumnsCount = function($element) {
3197                if($element.hasClass('mad-grid--cols-4')) return 4;
3198                else if($element.hasClass('mad-grid--cols-3')) return 3;
3199                else if($element.hasClass('mad-grid--cols-2')) return 2;
3200
3201                return 1;
3202            };
3203
3204         /* ----------------------------------------
3205               End of gridOwl
3206          ---------------------------------------- */
3207
3208         /* ----------------------------------------
3209               Full Screen Area
3210          ---------------------------------------- */
3211
3212            App.helpers.fullScreenArea = {
3213            	init: function(config){
3214
3215            		var self = this;
3216
3217            		this.collection = $('.mad-fullscreen-area');
3218            		if(!this.collection.length) return;
3219
3220                    this.config = config || {};
3221            		this.defPaddingTop = parseInt(this.collection.css('padding-top'), 10);
3222            		this.defPaddingBottom = parseInt(this.collection.css('padding-bottom'), 10);
3223
3224            		this.w = $(window);
3225                    this.$body = $body;
3226
3227            		this.run();
3228
3229            		this.w.on('resize.fullscreen', function() {
3230                        self.run();
3231                    });
3232
3233            		return this.collection;
3234
3235            	},
3236
3237            	reset: function(){
3238
3239            		if(!this.collection) return;
3240
3241            		this.run();
3242
3243            	},
3244
3245            	updateDocumentState: function(){
3246
3247            		var self = this;
3248
3249            		this.collection.css({
3250            			'padding-top': self.defPaddingTop,
3251            			'padding-bottom': self.defPaddingBottom
3252            		});
3253
3254            		this.cH = this.collection.outerHeight();
3255
3256                    this.eH = this.config.except && this.config.except.length ? this.getTotalHeightOfExceptedElements() : 0;
3257                    this.documentPadding = parseInt(this.$body.css('padding-top'), 10) + parseInt(this.$body.css('padding-bottom'), 10);
3258
3259                    this.wH = this.w.height();
3260
3261            	},
3262
3263                getTotalHeightOfExceptedElements: function() {
3264                    return this.config.except.toArray().reduce(function(accumulator, currentValue, index, array){
3265                        return accumulator + $(currentValue).outerHeight();
3266                    }, 0);
3267                },
3268
3269            	run: function(){
3270
3271            		var self = this;
3272
3273            		this.updateDocumentState();
3274
3275            		if(this.timeoutId) clearTimeout(this.timeoutId);
3276
3277            		this.timeoutId = setTimeout(function(){
3278
3279            			if(self.cH < self.wH){
3280
3281            				var diff = (self.wH - self.cH) / 2;
3282
3283            				self.collection.css({
3284            					'padding-top': diff + self.defPaddingTop - ((self.eH + self.documentPadding)/2),
3285            					'padding-bottom': diff + self.defPaddingBottom - ((self.eH + self.documentPadding)/2)
3286            				});
3287
3288            			}
3289
3290                        self.collection.addClass('mad-fullscreen-area--ready');
3291
3292            		}, 100);
3293
3294            	}
3295
3296            };
3297
3298         /* ----------------------------------------
3299               End of Full Screen Area
3300          ---------------------------------------- */
3301
3302         /* ----------------------------------------
3303               owlSyncTabbed
3304          ---------------------------------------- */
3305
3306            App.helpers.owlSyncTabbed = {};
3307            App.helpers.owlSyncTabbed.init = function($collection) {
3308                var _self = this,
3309                    $w = $(window);
3310
3311                if(!$.isjQuery($collection)) return;
3312
3313                $collection.on('click', '.owl-item', this.changeTab);
3314                $collection.on('translated.owl.carousel', function(event) {
3315                    var $this = $(this),
3316                        OWL = $this.data('owl.carousel');
3317
3318                    if($.isPlainObject(OWL.options.responsive)) {
3319                        for(var screenSize in OWL.options.responsive) {
3320                            if(OWL.options.responsive[screenSize]['items'] == 1 && $w.width() < 480) {
3321                                $this.find('.owl-item.active').trigger('click');
3322                            }
3323                        }
3324                    }
3325
3326                });
3327
3328                this.setCurrentSlideClass($collection);
3329            };
3330
3331            App.helpers.owlSyncTabbed.changeTab = function(event) {
3332                var $this = $(this),
3333                    index = $this.index(),
3334                    $carousel = $this.closest('.owl-carousel[data-tabbed-sync]'),
3335                    $tabbedContainer;
3336
3337
3338                if($carousel.length) {
3339                    $tabbedContainer = $('#' + $carousel.data('tabbed-sync'));
3340
3341                    if($tabbedContainer.length && $tabbedContainer.data('TabbedGrid')) {
3342                        $tabbedContainer.data('TabbedGrid').show(index);
3343                        $this.addClass('mad-grid--tabbed-active').siblings().removeClass('mad-grid--tabbed-active');
3344                    }
3345                }
3346
3347                event.preventDefault();
3348                event.stopPropagation();
3349            };
3350
3351            App.helpers.owlSyncTabbed.setCurrentSlideClass = function($collection) {
3352                var self = this;
3353
3354                if(!$collection.length) return $();
3355
3356                $collection.on('initialized.owl.carousel', function() {
3357                    self.setCurrentSlideClassToCarousel($(this));
3358                });
3359
3360                return $collection.each(function(index, element) {
3361                    self.setCurrentSlideClassToCarousel($(element));
3362                });
3363            };
3364
3365            App.helpers.owlSyncTabbed.setCurrentSlideClassToCarousel = function($element) {
3366                var $tabbedContainer = $('#' + $element.data('tabbed-sync')),
3367                    $items,
3368                    $currentItem;
3369
3370                if($tabbedContainer.length) {
3371                    $items = $element.find('.owl-item');
3372
3373                    if($items.length) {
3374                        $tabbedContainer.on('item.shown.tabbedgrid', function(event, $container){
3375                            if($element.data('synced')) return;
3376
3377                            $currentItem = $items.eq($container.data('TabbedGrid').getCurrentItemIndex());
3378                            if($currentItem.length) $currentItem.addClass('mad-grid--tabbed-active');
3379
3380                            $element.data('synced', true);
3381                        });
3382                    }
3383                }
3384            };
3385
3386         /* ----------------------------------------
3387               End of owlSyncTabbed
3388          ---------------------------------------- */
3389
3390         /* ----------------------------------------
3391               Google Maps
3392          ---------------------------------------- */
3393
3394            if ($('#googleMap').length) {
3395
3396                function loadMap() {
3397                    var mapProp = {
3398                        center: { lat: 45.4908665, lng: -73.6227369 },
3399                        zoom: 14,
3400                    };
3401
3402                    var map = document.getElementById('googleMap');
3403
3404                    if (map !== null) {
3405
3406                        var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
3407
3408                    }
3409
3410                    setMarkers(map);
3411
3412                }
3413                var marks = [
3414                    ['first', 45.4908665, -73.6227369]
3415                ];
3416
3417                function setMarkers(map) {
3418
3419                    for (var i = 0; i < marks.length; i++) {
3420                        var mark = marks[i];
3421                        var marker = new google.maps.Marker({
3422                            position: { lat: mark[1], lng: mark[2] },
3423                            map: map,
3424                            icon: 'wp-content/themes/criugm/images/marker.png',
3425                            title: mark[0],
3426                            zIndex: mark[3]
3427                        });
3428
3429                        var contentString = '<div class="mad-info-box">' +
3430                            '<h5>Venue Info</h5>' +
3431                            '<div class="mad-info-item">' +
3432                                '<i class="mad-info-icon licon-map-marker"></i>' +
3433                                '<address>9863 - 9867 Mill Road, Cambridge, MG09 99HT</address>'+
3434                                '<a href="https://www.google.com/maps/dir//2032+S+Elliott+Ave,+Aurora,+MO+65605/@36.9487043,-93.7878472,12z/data=!3m1!4b1!4m8!4m7!1m0!1m5!1m1!1s0x87cf4b1a194c90e1:0xba30bfe0c0a857c!2m2!1d-93.7178072!2d36.9487249"">Get Direction</a>'+
3435                            '</div>' +
3436                            '<div class="mad-info-item">' +
3437                                '<i class="mad-info-icon licon-at-sign"></i>'+
3438                                '<a href="mailto:#">[email protected]</a>'+
3439                            '</div>' +
3440                            '<div class="mad-info-item time">' +
3441                                '<i class="mad-info-icon licon-clock3"></i>' +
3442                                '<span>Friday-Sunday: 8:00am-6pm</span>' +
3443                            '</div>' +
3444                        '</div>';
3445
3446                        var infowindow = new google.maps.InfoWindow({
3447                            content: contentString
3448                        });
3449
3450                        function infoCallback(infowindow, marker) {
3451                            return function () {
3452                                infowindow.open(map, marker);
3453                                $('.gm-style-iw').addClass('show');
3454                            };
3455                        }
3456
3457                        function mapCallback(infowindow, map) {
3458                            return function () {
3459                                infowindow.close();
3460                                $('.gm-style-iw').removeClass('show');
3461                            };
3462                        }
3463
3464                        google.maps.event.addListenerOnce(map, 'tilesloaded', function () {
3465                            infowindow.open(map, marker);
3466                        });
3467
3468                        google.maps.event.addListener(marker, 'click', infoCallback(infowindow, marker));
3469
3470                        google.maps.event.addListener(map, 'click', mapCallback(infowindow, map));
3471
3472                        google.maps.event.addListener(infowindow, 'domready', function () {
3473
3474                            // Reference to the DIV which receives the contents of the infowindow using jQuery
3475                            var iwOuter = $('.gm-style-iw');
3476
3477                            /* The DIV we want to change is above the .gm-style-iw DIV.
3478                            * So, we use jQuery and create a iwBackground variable,
3479                            * and took advantage of the existing reference to .gm-style-iw for the previous DIV with .prev().
3480                            */
3481                            var iwBackground = iwOuter.prev();
3482
3483                            // Remove the background shadow DIV
3484                            iwBackground.children(':nth-child(2)').css({ 'display': 'none' });
3485
3486                            // Remove the white background DIV
3487                            iwBackground.children(':nth-child(4)').css({ 'display': 'none' });
3488
3489                            var iwCloseBtn = iwOuter.next();
3490
3491                            // Apply the desired effect to the close button
3492                            iwCloseBtn.css({
3493                                display: 'none',
3494                            });
3495
3496                            iwBackground.children(':nth-child(3)').hide();
3497                            iwBackground.children(':nth-child(2)').hide();
3498                            iwBackground.children(':nth-child(1)').hide();
3499
3500                        });
3501
3502                    }
3503                }
3504
3505                google.maps.event.addDomListener(window, 'load', loadMap);
3506
3507            }
3508
3509        /* ----------------------------------------
3510            End of Google Maps
3511        ---------------------------------------- */
3512
3513        /* ----------------------------------------
3514            Bg move
3515        ---------------------------------------- */
3516
3517            App.modules.bgMove = function () {
3518
3519                var lFollowX = 0,
3520                    lFollowY = 0,
3521                    x = 0,
3522                    y = 0,
3523                    friction = 1 / 30;
3524
3525                function moveBackground() {
3526                    x += (lFollowX - x) * friction;
3527                    y += (lFollowY - y) * friction;
3528
3529                    var translate = 'translate(' + x + 'px, ' + y + 'px) scale(1)';
3530
3531                    $('.bg-move').css({
3532                        '-webit-transform': translate,
3533                        '-moz-transform': translate,
3534                        'transform': translate
3535                    });
3536
3537                    window.requestAnimationFrame(moveBackground);
3538                }
3539
3540                $(window).on('mousemove click', function (e) {
3541
3542                    var lMouseX = Math.max(-100, Math.min(100, $(window).width() / 2 - e.clientX));
3543                    var lMouseY = Math.max(-100, Math.min(100, $(window).height() / 2 - e.clientY));
3544                    lFollowX = (20 * lMouseX) / 100; // 100 : 12 = lMouxeX : lFollow
3545                    lFollowY = (10 * lMouseY) / 100;
3546
3547                });
3548
3549                moveBackground();
3550            }
3551
3552        /* ----------------------------------------
3553           Bg move
3554        ---------------------------------------- */
3555
3556        /* ----------------------------------------
3557            Shop item close
3558        ---------------------------------------- */
3559
3560        /**
3561         * Initialize global close event
3562         * @return Object Core;
3563         **/
3564        App.modules.closeBtn = function() {
3565            $('body').on('click.globalclose', '.mad-close-item:not(.shopping-cart-full .mad-close-item)', function (e) {
3566                e.preventDefault();
3567                $(this).parent().stop().animate({
3568                    opacity: 0
3569                }, function () {
3570                    $(this).stop().slideUp(function () {
3571                        $(this).remove();
3572                    });
3573                });
3574            });
3575            var c = $('.shopping-cart-full');
3576            c.on('click.removeProduct', '.mad-close-item', function (e) {
3577                e.preventDefault();
3578                $(this).closest('tr').stop().fadeOut(function () {
3579                    $(this).remove();
3580                });
3581            });
3582            return this;
3583        }
3584
3585        /* ----------------------------------------
3586            Shop item close
3587        ---------------------------------------- */
3588
3589        /**
3590         * Emulates single accordion item
3591         * @param Function callback
3592         * @return jQuery collection;
3593         **/
3594        App.modules.hiddenSections = function(callback) {
3595
3596            var collection = $('.hidden-section');
3597            if (!collection.length) return;
3598
3599            collection.each(function (i, el) {
3600                $(el).find('.content').hide();
3601            });
3602
3603            collection.on('click.hidden', '.invoker', function (e) {
3604
3605                e.preventDefault();
3606
3607                var content = $(this).closest('.hidden-section').find('.content');
3608
3609                content.slideToggle({
3610                    duration: 500,
3611                    easing: 'easeOutQuint',
3612                    complete: callback ? callback : function () { }
3613                });
3614
3615            });
3616
3617            return collection;
3618
3619        },
3620
3621
3622    $.extend({
3623        isjQuery: function(element, elementExists) {
3624			if(element === undefined || element === null) return false;
3625
3626			if(elementExists === undefined) {
3627				return element instanceof jQuery;
3628			}
3629			else {
3630				return $.isjQuery(element) && element.length;
3631			}
3632		}
3633    });
3634
3635    $.fn.extend({
3636        jQueryImagesLoaded : function () {
3637		    var $imgs = this.find('img[src!=""]');
3638
3639		    if (!$imgs.length) {return $.Deferred().resolve().promise();}
3640
3641		    var dfds = [];
3642
3643		    $imgs.each(function(){
3644		        var dfd = $.Deferred();
3645		        dfds.push(dfd);
3646		        var img = new Image();
3647		        img.onload = function(){dfd.resolve();};
3648		        img.onerror = function(){dfd.resolve();};
3649		        img.src = this.src;
3650		    });
3651
3652		    return $.when.apply($,dfds);
3653		}
3654    });
3655
3656    $doc.on('beforeClose', function(event) {
3657        if($(event.target).hasClass('mad-modal')) {
3658            event.stopImmediatePropagation();
3659        }
3660    });
3661
3662    $doc.ready(function() {
3663        App.afterDOMReady();
3664    });
3665    $(window).on('load', function() {
3666
3667        DOMDfd.done(function() {
3668            App.afterOuterResourcesLoaded();
3669        });
3670    });
3671
3672    /*Donut chart*/
3673
3674    if ($('.ct-chart').length) {
3675       
3676        new Chartist.Pie('#ct-chart', {
3677            series: [15, 85]
3678        }, {
3679                donut: true,
3680                donutWidth: 5,
3681                donutSolid: true,
3682                startAngle: 85,
3683                showLabel: false
3684            });
3685
3686        new Chartist.Pie('#ct-chart2', {
3687            series: [60, 40]
3688        }, {
3689                donut: true,
3690                donutWidth: 5,
3691                donutSolid: true,
3692                startAngle: 85,
3693                showLabel: false
3694            });
3695
3696        new Chartist.Pie('#ct-chart3', {
3697            series: [15, 85]
3698        }, {
3699                donut: true,
3700                donutWidth: 5,
3701                donutSolid: true,
3702                startAngle: 85,
3703                showLabel: false
3704            });
3705
3706        new Chartist.Pie('#ct-chart4', {
3707            series: [60, 40]
3708        }, {
3709                donut: true,
3710                donutWidth: 5,
3711                donutSolid: true,
3712                startAngle: 85,
3713                showLabel: false
3714            });
3715            
3716    }
3717
3718    /* ---------------------------------------------------- */
3719    /*	Elevate zoom										*/
3720    /* ---------------------------------------------------- */
3721
3722    if ($('[data-zoom-image]').length) {
3723
3724        var button = $('.qv-preview');
3725
3726        $("#zoom-image").elevateZoom({
3727            gallery: 'thumbnails',
3728            galleryActiveClass: 'active',
3729            zoomType: "inner",
3730            cursor: "crosshair",
3731            responsive: true,
3732            zoomWindowFadeIn: 500,
3733            zoomWindowFadeOut: 500,
3734            easing: true,
3735            lensFadeIn: 500,
3736            lensFadeOut: 500
3737        });
3738
3739    }
3740
3741    /* ---------------------------------------------------- */
3742    /*	Quantity											*/
3743    /* ---------------------------------------------------- */
3744
3745    if ($('.quantity').length) {
3746        var q = $('.quantity');
3747        q.each(function () {
3748            var $this = $(this),
3749                button = $this.children('button'),
3750                input = $this.children('input[type="text"]'),
3751                val = +input.val();
3752            button.on('click', function () {
3753                if ($(this).hasClass('qty-minus')) {
3754                    if (val === 1) return false;
3755                    input.val(--val);
3756                }
3757                else {
3758                    input.val(++val);
3759                }
3760            });
3761        });
3762    }
3763
3764    return App;
3765
3766})(window.jQuery);
3767
3768/*
3769Plugin Name: 	SVG for jQuery.
3770*/
3771$(function () {
3772    jQuery('img.svg').each(function () {
3773        var $img = jQuery(this);
3774        var imgID = $img.attr('id');
3775        var imgClass = $img.attr('class');
3776        var imgURL = $img.attr('src');
3777
3778        jQuery.get(imgURL, function (data) {
3779            // Get the SVG tag, ignore the rest
3780            var $svg = jQuery(data).find('svg');
3781
3782            // Add replaced image's ID to the new SVG
3783            if (typeof imgID !== 'undefined') {
3784                $svg = $svg.attr('id', imgID);
3785            }
3786            // Add replaced image's classes to the new SVG
3787            if (typeof imgClass !== 'undefined') {
3788                $svg = $svg.attr('class', imgClass + ' replaced-svg');
3789            }
3790
3791            // Remove any invalid XML tags as per http://validator.w3.org
3792            $svg = $svg.removeAttr('xmlns:a');
3793
3794            // Check if the viewport is set, else we gonna set it if we can.
3795            if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
3796                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
3797            }
3798
3799            // Replace image with new SVG
3800            $img.replaceWith($svg);
3801
3802        }, 'xml');
3803
3804    });
3805});
3806
3807/*
3808Plugin Name: 	SVG for jQuery.
3809*/
3810$(document).ready(function() {
3811    $(".various").fancybox({
3812            maxWidth    : 800,
3813            maxHeight   : 600,
3814            fitToView   : false,
3815            width       : '70%',
3816            height      : '70%',
3817            autoSize    : false,
3818            closeClick  : false,
3819            openEffect  : 'none',
3820            closeEffect : 'none'
3821        });
3822});
3823/*
3824Plugin Name: 	SVG for jQuery.
3825*/
3826$(document).ready(function() {
3827    $("ul#secondary > li.current-menu-ancestor > a").contents().unwrap();
3828	
3829	var $chercheurs = $('#isotope-chercheurs');
3830	
3831	$chercheurs.isotope({
3832	  itemSelector: '.ele-chercheur',
3833	  layoutMode: 'fitRows'
3834	});
3835	
3836    // filter items when filter link is clicked
3837    $('#portfolio-filter li a').on('click', function() {
3838		$('#portfolio-filter li a').removeClass('mad-active');
3839		$(this).addClass('mad-active');
3840		var selector = $(this).data('filter');
3841		$chercheurs.isotope({
3842			filter: selector
3843		});
3844	});
3845	
3846});
3847
3848/*
3849Plugin Name: 	SVG for jQuery.
3850*/
3851$(document).ready(function() {
3852	/*================================
3853		Contact Map JS
3854	==================================*/
3855	var map_id = $('#map_content');
3856	if (map_id.length > 0) {
3857		var $lat = map_id.data('lat'),
3858			$lng = map_id.data('lng'),
3859			$zoom = map_id.data('zoom'),
3860			$maptitle = map_id.data('maptitle'),
3861			$mapaddress = map_id.data('mapaddress'),
3862			mymap = L.map('map_content').setView([$lat, $lng], $zoom);
3863
3864		L.tileLayer.grayscale('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
3865			attribution: 'Map',
3866			maxZoom: 18,
3867			id: 'mapbox.streets',
3868			scrollWheelZoom: false,
3869			accessToken: 'pk.eyJ1Ijoid2VibG91bmdlIiwiYSI6ImNqeWlzZ2JpdTBkb2szcXBjZmhqcnFubWEifQ.k2sqDeNoZKxv7XINv_xC5g'
3870		}).addTo(mymap);
3871		var marker = L.marker([$lat, $lng]).addTo(mymap);
3872		mymap.scrollWheelZoom.disable();
3873	}
3874	
3875	$("dt.mad-panels-active").removeClass("mad-panels-active");
3876	
3877	// Increase/descrease font size
3878	$('#increasetext').click(function() {
3879		curSize = parseInt($(':root').css('font-size')) + 2;
3880		if (curSize <= 24)
3881			$(':root').css('font-size', curSize);
3882	});
3883
3884	$('#resettext').click(function() {
3885		if (curSize != 16)
3886			$(':root').css('font-size', 16);
3887	});
3888
3889	$('#decreasetext').click(function() {
3890		curSize = parseInt($(':root').css('font-size')) - 2;
3891		if (curSize >= 14)
3892			$(':root').css('font-size', curSize);
3893	});	
3894
3895});
3896
3897

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.