PageSourceSearch

https://www.dmprofectus.com/wp-content/themes/the-simple/js/simple-main.js?ver=1

js dmprofectus.com collected 2026-10-09 22:49:30 UTC 105,497 bytes, 2,910 lines download raw bytes

1    var $ = jQuery.noConflict();
2    var $window_width = $(window).width();
3    var stickyNavTop = $('header#header').offset().top;
4    var simpleSlider, msnry_blog, msnry_portfolio;
5    $(document).ready(function() {
6        "use strict";
7
8        /* ToolTip Activate */
9
10        if ($('[rel=tooltip]').length > 0) {
11
12            loadDependencies([s_gb.theme_js + 'tooltip.js'], function() {
13
14                $('[rel=tooltip]').tooltip();
15            });
16        }
17
18        /* PlaceHolder fix for IE */
19        if ($('input').attr('placeholder') || $('textarea').attr('placeholder')) {
20
21            loadDependencies([s_gb.theme_js + 'jquery.placeholder.min.js'], function() {
22
23                $('input, textarea').placeholder();
24
25            });
26
27        }
28
29
30
31        $('#mc_mv_EMAIL').attr('placeholder', 'Type your email address');
32
33
34        /*Button with icon padding*/
35        $('.btn-bt.default:has(i)').css('padding-right', '50px');
36        $('.btn-bt.business:has(i)').css('padding-right', '16px');
37
38
39
40        if ($('.animsition').length > 0) {
41            //loadDependencies([s_gb.theme_js + 'jquery.animsition.min.js'], function(){
42            simplePageTransition();
43
44
45        }
46
47        /* Page Header */
48        pageHeader();
49
50        fixWooCommercebtn();
51
52        /* Set Icon for list elements. (1 icon for all list) */
53        simpleSetIconList();
54
55
56
57        /* Styling VC section */
58        simpleSectionStyle();
59
60
61
62        /* Initialize Navigation JS Part */
63        //if(!$('body').hasClass('header_5'))
64        simpleNavigation();
65
66        /* Fullwidth Google Map */
67        simpleFullwidthMap();
68
69        /* IFRAME height in grid blog */
70        simpleIFrameHeight();
71
72        /* Search Button in Header */
73        simpleSearchButton();
74
75        /* Scroll Up Binding */
76        scrollUpBinding();
77
78        /* Accordion Toggle Binding */
79        accordionBinding();
80
81        /* Top Navigation Widget */
82        simpleTopNavWidget();
83
84        /* LightBox */
85        simpleLightBoxInit();
86
87        /* $("audio,video").mediaelementplayer(); */
88
89
90        if ($('.services_medium').length > 0)
91            loadDependencies([s_gb.theme_js + 'pathformer.js']);
92
93        simpleSVGServices();
94
95        /* Twitter Footer Carousel */
96        if ($('#tweet_footer').length > 0) {
97            loadDependencies([s_gb.theme_js + 'jquery.carouFredSel-6.1.0-packed.js'], function() {
98
99                twitterFooterCarousel();
100            });
101        }
102
103        /* Clients Carousel Init */
104        if ($('.clients_caro').length > 0) {
105            loadDependencies([s_gb.theme_js + 'jquery.carouFredSel-6.1.0-packed.js'], function() {
106                clientsCarousel();
107            });
108        }
109
110        simpleRelatedpostsCarousel();
111
112        simpleCountDown();
113
114        /* Testimonials Carousel Init */
115        //if($('.testimonial_carousel').length > 0)
116        //testimonialsCarousel();
117
118        /* Testimonial Cycle */
119        if ($('.testimonial_cycle').length > 0) {
120            loadDependencies([s_gb.theme_js + 'jquery.carouFredSel-6.1.0-packed.js'], function() {
121                testimonialsCycle();
122            });
123        }
124
125
126        /* Flexslider Init */
127        if ($('.flexslider').length > 0)
128            flexsliderInit();
129
130        /* Portfolio Page Isotope Filter */
131        if ($('#portfolio-preview-items').length > 0) {
132
133            loadDependencies([s_gb.theme_js + 'jquery.mixitup.js'], function() {
134                loadDependencies([s_gb.theme_js + 'masonry.min.js'], function() {
135                    simplePortfolioPageIsotope();
136
137                });
138            })
139
140        }
141
142
143        /* Staff Carousel */
144        simpleStaffCarousel();
145
146        /* Portfolio Carousel */
147        if ($('.portfolio_slider').length > 0) {
148            loadDependencies([s_gb.theme_js + 'idangerous.swiper.min.js'], function() {
149                simplePortfolioCarousel();
150
151            });
152
153        }
154
155        /* Blog Latest Post */
156        simpleLatestBlogCarousel();
157
158        /* Simple Slider Init */
159        if ($('.simple_slider').length > 0) {
160            loadDependencies([s_gb.theme_js + 'idangerous.swiper.min.js'], function() {
161                $('.simple_slider').simpleSliderInit();
162            });
163        }
164
165
166        /* Left Navigation */
167        simpleLeftNavtion();
168
169        /* Smoothscroll */
170        if ($("body").hasClass('nicescroll'))
171            simple_smoothScroll();
172
173        if ($('#blogmasonry').length > 0)
174            loadDependencies([s_gb.theme_js + 'masonry.min.js'], function() {
175                simple_blogmasonry();
176            });
177
178        if ($('#fullpage').length > 0) {
179            loadDependencies([s_gb.theme_js + 'jquery.appear.js'], function() {
180                loadDependencies([s_gb.theme_js + 'jquery.fullPage.js'], function() {
181                    simple_fullscreen_section();
182                });
183            });
184        }
185
186        simple_backgroundcheck();
187
188        if ($('.fixed_sidebar').length > 0)
189            simple_single_portfolio_floating();
190
191        simpleExtraNav();
192
193        if ($('.woocommerce-ordering .orderby').length > 0) {
194            loadDependencies([s_gb.theme_js + 'select2.min.js'], function() {
195                simpleCustomSelect();
196            });
197        }
198
199        simpleTabsactive();
200
201        simpleMobileMenu();
202
203        simpleOverallButton();
204
205        if ($('body').hasClass('header_5'))
206            simpleMenuOverlay();
207
208        simpleLayoutChanges();
209
210        simpleOnlineFunctions();
211
212        if ($('body').hasClass('one_page'))
213            simpleOnePage();
214
215        if ($('body').hasClass('sticky_active') && $window_width >= 980)
216            simpleStickyNav();
217
218        if ($('.simple_gallery_carousel').length > 0) {
219            loadDependencies([s_gb.theme_js + 'idangerous.swiper.min.js'], function() {
220                simpleGalleryCarouselInit();
221            });
222
223        }
224
225        simplePostShares();
226
227        if ($('.infinite_scroll_pag').length > 0 && $('#posts_container').length > 0) {
228            loadDependencies([s_gb.theme_js + 'jquery.infinitescroll.min.js'], function() {
229                simpleBlogInfiniteScroll();
230
231            });
232        }
233
234        if ($('.infinite_scroll_pag').length > 0 && $('#portfolio-preview-items').length > 0) {
235            loadDependencies([s_gb.theme_js + 'jquery.infinitescroll.min.js'], function() {
236
237                simplePortfolioInfiniteScroll();
238            });
239        }
240
241
242
243
244        if ($('.top_nav_transparency').length > 0)
245            $('.header_wrapper').height('auto');
246
247        /* Disable map zoon on scroll */
248        simpleDisableMapZoom();
249        /*Side menu on responsive */
250        //simpleSideMenu();
251
252        simpleProjectBar();
253
254        simpleScrollToTop();
255        simple_headingWithLine();
256        simpleSearchOverlay();
257
258        simpleTestimonialCarousel();
259
260        simple_blog_grid_facybox();
261
262
263    });
264    $(window).focus(function() {
265        simpleProjectBar();
266    });
267
268
269    $(window).load(function() {
270        simpleInitParallax();
271        /*Side menu on responsive */
272        //simpleSideMenu();
273        simplePortfolioInGrid();
274        simpleProjectBar();
275        simple404();
276        simpleOverallButton();
277
278    });
279
280
281
282    $(window).scroll(function() {
283        "use strict";
284
285
286    });
287
288
289
290    $(window).resize(function() {
291        "use strict";
292        /*var width = 1100;
293        if($('.swiper_slider').length > 0){
294            var slide_per_view = $('.swiper_slider').data('slidenr');
295
296            if ($(".container").css("max-width") == "940px" ){
297                slide_per_view = 4;
298            }else if ($(".container").css("max-width") == "420px" ){
299                slide_per_view = 1;
300            }else if ($(".container").css("width") == "724px" ){
301                slide_per_view = 2;
302            }else if ($(".container").css("max-width") == "300px" ){
303                slide_per_view = 1;
304            }
305            var swiperParent = new Swiper('.swiper_slider',{
306                slidesPerView: slide_per_view,
307                paginationClickable: true,
308                pagination: '.pagination'
309            });
310            
311        }   */
312        //simplePortfolioPageIsotope();
313
314
315        simple_single_portfolio_floating();
316        simpleLayoutChanges();
317        testimonialsCycle();
318        simpleInitParallax();
319        /*Side menu on responsive */
320        //simpleSideMenu();
321        simpleProjectBar();
322        simple404();
323        simple_headingWithLine();
324    });
325
326
327
328
329    /*-------------------------------------------------------------------------------------------------------------*/
330    /*------------------------------------------ FUNCTIONS   --------------------------------------------------*/
331    /*-------------------------------------------------------------------------------------------------------------*/
332
333    /*------------------------------ Page Header ------------------------- */
334
335    function missing_img() {
336        "use strict";
337        $('img').each(function() {
338
339            if ((!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) && $(this).closest('#logo').length == 0) {
340                this.src = 'http://thesimple.ellethemes.com/dummy_data/set_image.png';
341            }
342        });
343    }
344
345    function pageHeader() {
346        "use strict";
347        var self = $('.header_page.centered,.header_page.left');
348        if (self.length == 0)
349            return false;
350        var height = self.height();
351        self.height(0);
352
353        setTimeout(function() {
354            self.animate({
355                opacity: 1,
356                height: height + 'px'
357            }, 800);
358        }, 600);
359
360        var top = self.offset().top;
361        var bottom = self.offset().top + height;
362        var op_test = 1;
363
364        $(window).scroll(function() {
365            var scrollTop = $(window).scrollTop();
366
367            if ($('.fixed_header').length > 0)
368                scrollTop += $('.fixed_header').height();
369            if (jQuery('#wpadminbar').length > 0)
370                scrollTop += 32;
371            if ($(window).scrollTop() == 0)
372                scrollTop = 0;
373            var opacity1 = 1 - (scrollTop / bottom);
374            op_test = opacity1;
375            var new_height = height;
376            if (scrollTop > top) {
377                new_height = bottom - scrollTop;
378            }
379            //self.css({opacity: opacity1});
380            if (!self.hasClass('with_subtitle'))
381                self.find('h1').css('line-height', new_height + 'px').css('height', new_height + 'px').css('padding-top', (height - new_height) + 'px').css('opacity', opacity1);
382            else {
383                self.find('.titles').css('opacity', opacity1).css('padding-top', (height - new_height) + 'px');
384            }
385
386        });
387
388
389    }
390
391    var _loadedDependencies = [],
392        _inQueue = {};
393
394    function loadDependencies(dependencies, callback) {
395        "use strict";
396        var _callback = callback || function() {};
397        if (!dependencies)
398            return void _callback();
399
400        var newDeps = dependencies.map(function(dep) {
401            return -1 === _loadedDependencies.indexOf(dep) ? "undefined" == typeof _inQueue[dep] ? dep : (_inQueue[dep].push(_callback), !0) : !1
402        });
403
404        if (newDeps[0] !== !0) {
405            if (newDeps[0] === !1)
406                return void _callback();
407            var queue = newDeps.map(function(script) {
408                _inQueue[script] = [_callback];
409                return $.getCachedScript(script);
410            });
411
412            var onLoad = function() {
413                newDeps.map(function(loaded) {
414                    _inQueue[loaded].forEach(function(callback) {
415                        callback()
416                    });
417                    delete _inQueue[loaded];
418                    _loadedDependencies.push(loaded)
419                });
420            };
421
422            $.when.apply(null, queue).done(onLoad)
423        }
424
425
426    }
427
428    $.getCachedScript = function(url) {
429        "use strict";
430        var options = {
431            dataType: "script",
432            cache: false,
433            url: url
434        };
435        return $.ajax(options)
436    };
437
438
439    /*------------------------------ Lists ----------------------------- */
440
441    function simpleSetIconList() {
442        "use strict";
443        if ($('.list').length > 0) {
444            $('.list').each(function() {
445                var icon = $(this).find('ul').data('icon');
446                var bg_color = $(this).find('ul').data('color');
447
448                if (typeof bg_color !== 'undefined' && bg_color.length > 0)
449                    $('i', $(this)).css('background-color', bg_color);
450
451                $('i', $(this)).addClass(icon);
452            });
453        }
454    }
455
456    /* Parallax Init */
457
458    function simpleInitParallax() {
459        "use strict";
460        if ($('.parallax_section').length > 0) {
461            loadDependencies([s_gb.theme_js + 'jquery.parallax.js'], function() {
462                if ($('.section-style.parallax_section').length || $(".header_page:not('.no_parallax')").length) {
463                    $(".section-style.parallax_section, .header_page:not('.no_parallax')").each(function() {
464                        var self = $(this);
465
466                        $(this).parallax("50%", 0.4);
467
468                    });
469                }
470            });
471        }
472    }
473
474    function simpleCountDown() {
475        "use strict";
476        if ($('#countdowndiv').length > 0) {
477
478            loadDependencies([s_gb.theme_js + 'jquery.countdown.min.js'], function() {
479
480                $('#countdowndiv').each(function() {
481                    var $this = $(this);
482                    var year = $(this).data('year');
483                    var month = $(this).data('month');
484                    var day = $(this).data('day');
485
486                    $(this).countdown({ until: new Date(year, month - 1, day) })
487
488                });
489            })
490        }
491    }
492
493    /*------------------------------ Sections ----------------------------- */
494    function simpleSectionStyle() {
495        "use strict";
496        $('.section-style').each(function() {
497            if ($(this).prev().hasClass('section-style')) {
498                $(this).css('margin-top', '0px');
499                $(this).prev().css('margin-bottom', '0px');
500            }
501
502            if ($(this).is(':last-child') && ($(this).parent().hasClass('composer_content') || $(this).parent().hasClass('content_portfolio'))) {
503                $(this).parent().css('padding-bottom', '0px');
504            }
505            if ($(this).is(':first-child') && ($(this).parent().hasClass('composer_content') || $(this).parent().hasClass('content_portfolio'))) {
506                var style = $(this).parent().attr('style');
507                if (typeof style == "undefined")
508                    style = '';
509                $(this).parent().attr('style', style + 'padding-top:0px !important');
510            }
511        });
512
513        $('.transparency_section').each(function() {
514            var height = $(this).outerHeight();
515            $(this).css('margin-top', '-' + height + 'px');
516        });
517
518
519
520        if ($window_width > 979) {
521            $('.full-width-content.section-style ').each(function() {
522                var max_height = 0;
523                var full_width_section = $(this);
524                if ($('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column)', full_width_section).length > 1) {
525                    $('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column)', full_width_section).each(function() {
526                        var this_ = $(this);
527                        if (this_.innerHeight() > max_height)
528                            max_height = this_.innerHeight();
529                    });
530                    $('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column):not(.vc_column-inner .vc_column-inner)', full_width_section).innerHeight(max_height + 'px');
531                }
532
533            });
534        } else {
535            $('.full-width-content.section-style .wpb_column .vc_column-inner:not(.wpb_column .wpb_column):not(.vc_column-inner .vc_column-inner)').height('auto');
536        }
537
538        $('.section-style').each(function() {
539            var self = $(this);
540            if (self.css('padding-bottom') == '0px') {
541                var pad = $('.wpb_column', self).last().css('padding-bottom');
542                if ($window_width < 768) {
543                    $('.wpb_column', self).last().css('padding-bottom', '0px');
544                } else {
545                    $('.wpb_column', self).last().css('padding-bottom', pad);
546                }
547            }
548        });
549
550        if ($('.slider_on_top').length > 0) {
551            var pd = parseInt($('#content').css('padding-top'));
552            var mn = $('.header_wrapper').height();
553            $('#content').css('padding-top', (pd + mn) + 'px');
554        }
555
556        $(window).resize(function() {
557            $window_width = $(this).width();
558            $('.full-width-content.section-style .wpb_column .vc_column-inner:not(.wpb_column .wpb_column)').height('auto');
559            if ($window_width > 979) {
560                $('.full-width-content.section-style ').each(function() {
561                    var max_height = 0;
562                    var full_width_section = $(this);
563                    if ($('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column)', full_width_section).length > 1) {
564                        $('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column)', full_width_section).each(function() {
565                            var this_ = $(this);
566                            if (this_.innerHeight() > max_height)
567                                max_height = this_.innerHeight();
568                        });
569                        $('.wpb_column .vc_column-inner:not(.wpb_column .wpb_column):not(.vc_column-inner .vc_column-inner)', full_width_section).innerHeight(max_height + 'px');
570                    }
571
572                });
573            } else {
574                $('.full-width-content.section-style .wpb_column .vc_column-inner:not(.wpb_column .wpb_column):not(.vc_column-inner .vc_column-inner)').height('auto');
575            }
576
577            $('.section-style').each(function() {
578                var self = $(this);
579                if (self.css('padding-bottom') == '0px') {
580                    var pad = $('.wpb_column', self).last().css('padding-bottom');
581
582                    if ($window_width < 768) {
583                        $('.wpb_column', self).last().css('padding-bottom', '0px');
584                    } else {
585                        $('.wpb_column', self).last().css('padding-bottom', pad);
586                    }
587                }
588            });
589
590        });
591
592
593    }
594
595    /*------------------------------ Navigation -------------------------- */
596    function simpleNavigation() {
597        "use strict";
598        if (!($('nav').parent().hasClass('header_5_fullwrapper'))) {
599
600            $('nav .menu li').each(function() {
601                var self = $(this);
602                if ($('.simple_mega4', self).length > 0) {
603                    self.css('position', 'static');
604                }
605
606                if ($('.simple_mega5', self).length > 0) {
607                    self.css('position', 'static');
608                }
609            });
610
611            $('nav .menu li .sub-menu').each(function() {
612                $(this).parent().first().addClass('hasSubMenu');
613            });
614
615            $('nav .menu, .sticky_menu .menu').mouseleave(function(event) {
616                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
617                $(this).find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
618            });
619
620            $('nav .menu li ul .hasSubMenu, .sticky_menu .menu li ul .hasSubMenu').mouseleave(function(event) {
621                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
622                $(this).find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
623            });
624
625            $('nav .menu > li, .sticky_menu .menu > li').mouseenter(function() {
626
627                $(this).parent().find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
628                $('header#header .cart .content').stop().fadeOut(400).css('display', 'none');
629
630                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').first().stop().fadeIn(400).css('display', 'block');
631
632                $(this).parent().find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
633                $(this).find('.simple_custom_menu_mega_menu').first().stop().fadeIn(400).css('display', 'block');
634            });
635
636            $('nav .menu > li ul > li, .sticky_menu .menu > li ul > li').mouseenter(function() {
637
638                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').first().stop().fadeIn(400).css('display', 'block');
639
640                $(this).parent().find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
641                $(this).find('.simple_custom_menu_mega_menu').first().stop().fadeIn(400).css('display', 'block');
642            });
643
644            $('.simple_custom_menu_mega_menu').each(function() {
645                var bg = $(this).parent('li').data('bg');
646                $(this).css('background-image', 'url(' + bg + ')');
647            });
648
649            $('header#header .container').on('mouseleave', function(event) {
650                $(this).find('.cart .content').stop().fadeOut(400).css('display', 'none');
651            });
652            $(' .header_tools .cart .content').on('mouseleave', function(event) {
653                $(this).stop().fadeOut(400).css('display', 'none');
654            });
655
656            $('header#header .cart_icon').on('mouseenter', function() {
657                $(this).parents('header#header').first().find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
658                $(this).parent().find('.content').first().stop().fadeIn(400).css('display', 'block');
659            });
660
661            $('header#header .vert_mid > a').on('mouseenter', function() {
662                $(this).parent().find('.cart .content').first().stop().fadeOut(400).css('display', 'none');
663            });
664
665
666            if ($('.header_10').length > 0) {
667                var container_left = $('.full_nav_menu').offset().left;
668                var nav = $('.full_nav_menu nav').offset().left;
669                $('.simple_custom_menu_mega_menu').each(function() {
670                    var minus = nav - container_left;
671                    $(this).css('left', '-' + minus + 'px');
672                });
673            }
674
675            $(window).resize(function() {
676                if ($('.header_10').length > 0) {
677                    var container_left = $('.full_nav_menu').offset().left;
678                    var nav = $('.full_nav_menu nav').offset().left;
679                    $('.simple_custom_menu_mega_menu').each(function() {
680                        var minus = nav - container_left;
681                        $(this).css('left', '-' + minus + 'px');
682                    });
683                }
684            });
685
686        } else { //fullscreen header
687
688            $('nav .menu li .sub-menu').each(function() {
689                $(this).parent().first().addClass('hasSubMenu');
690            });
691
692            $('nav .menu').mouseleave(function(event) {
693                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
694                $(this).find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
695            });
696            $('nav .menu li ul .hasSubMenu').mouseleave(function(event) {
697                console.log('mouseleave');
698                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
699                $(this).find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
700            });
701            $('nav .menu > li').mouseenter(function() {
702                console.log('mouseenter');
703                $(this).parent().find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').stop().fadeOut(400).css('display', 'none');
704                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').first().stop().fadeIn(400).css('display', 'block');
705
706                $(this).parent().find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
707                $(this).find('.simple_custom_menu_mega_menu').first().stop().fadeIn(400).css('display', 'block');
708            });
709            $('nav .menu > li ul > li').mouseenter(function() {
710
711                $(this).find('.sub-menu').not('.simple_custom_menu_mega_menu .sub-menu').first().stop().fadeIn(400).css('display', 'block');
712                console.log('this');
713                $(this).parent().find('.simple_custom_menu_mega_menu').stop().fadeOut(400).css('display', 'none');
714                $(this).find('.simple_custom_menu_mega_menu').first().stop().fadeIn(400).css('display', 'block');
715            });
716            $('.simple_custom_menu_mega_menu').each(function() {
717                var bg = $(this).parent('li').data('bg');
718                $(this).css('background-image', 'url(' + bg + ')');
719            });
720
721
722        }
723    }
724
725
726    /*------------------------------ Fullwidth Google MAP ----------------------------- */
727
728    function simpleFullwidthMap() {
729        "use strict";
730        if ($('.googlemap.fullwidth_map').length > 0) {
731            $('.googlemap.fullwidth_map').each(function() {
732                var $parent = $(this).parents('.row-dynamic-el').first();
733                if ($parent.next().hasClass('section-style'))
734                    $parent.css('margin-bottom', '0px');
735            });
736            $('.row-google-map').each(function() {
737                if ($('.fullwidth_map', $(this)).length > 0) {
738                    var $parent = $(this).parents('.row-dynamic-el').first();
739                    $parent.css('margin-top', '0px');
740                }
741
742            });
743        }
744    }
745
746
747    /*------------------------------ Change IFRAME GRID height -------------------------- */
748
749    function simpleIFrameHeight() {
750        "use strict";
751        $('.blog-article.grid .media img').first().imagesLoaded(function() {
752            var first_height = $('.blog-article.grid .media img').first().height();
753
754            $('.blog-article.grid iframe').each(function() {
755                $(this).css('height', first_height + 'px');
756                $(this).parent('.media').css('height', first_height + 'px');
757            });
758        });
759    }
760
761
762    /*------------------------------ HEader Search Button ------------------------------ */
763
764    function simpleSearchButton() {
765        "use strict";
766        $('.open_search_button').click(function() {
767            if ($('body').hasClass('open_search')) {
768                $('body').removeClass('open_search');
769            } else
770                $('body').addClass('open_search');
771
772        });
773
774
775        $(window).scroll(function() {
776            if ($('body').hasClass('open_search')) {
777                $('body').removeClass('open_search');
778            }
779        });
780
781
782        $('html').click(function(e) {
783            if ((e.target.id != 's')) {
784                $('.right_search_container').hide();
785            }
786        });
787    }
788
789    /*------------------------------ Side navigation --------------------------- */
790
791    function simpleExtraNav() {
792        "use strict";
793        $('.extra_navigation_button').click(function() {
794            if ($('body').hasClass('open_extra_nav')) {
795                $('body').removeClass('open_extra_nav');
796            } else
797                $('body').addClass('open_extra_nav');
798
799        });
800
801        $('.extra_navigation .close').click(function() {
802            $('body').removeClass('open_extra_nav');
803        });
804
805        /*$(window).scroll(function() {
806            if($('body').hasClass('open_extra_nav')){
807                $('body').removeClass('open_extra_nav');
808            }
809        });*/
810
811    }
812
813
814    /*------------------------------ Scroll Up binding ------------------------------ */
815
816    function scrollUpBinding() {
817        "use strict";
818        $('.scrollup').click(function() {
819            $("html, body").animate({ scrollTop: 0 }, 600);
820            return false;
821        });
822    }
823
824
825    /*------------------------------ Accordion Toggle Binding ------------------------------ */
826
827    function accordionBinding() {
828        "use strict";
829        $(".accordion-group .accordion-toggle").on('click', function() {
830            var $self = $(this).parent().parent();
831            if ($self.find('.accordion-heading').hasClass('in_head')) {
832                $self.parent().find('.accordion-heading').removeClass('in_head');
833            } else {
834                $self.parent().find('.accordion-heading').removeClass('in_head');
835                $self.find('.accordion-heading').addClass('in_head');
836            }
837        });
838    }
839
840    /*------------------------------ Top Navtion Widget ------------------------------ */
841    function simpleTopNavWidget() {
842        "use strict";
843        $('.small_widget a').not('.aaaa a').toggle(function(e) {
844            $('.small_widget').removeClass('active');
845            e.preventDefault();
846            var box = $(this).data('box');
847            $('.top_nav_sub').hide();
848            $('.top_nav_sub.' + box).fadeIn("400");
849            $(this).parent().addClass('active');
850
851        }, function(e) {
852            e.preventDefault();
853            var box = $(this).data('box');
854            $('.small_widget').removeClass('active');
855            $('.top_nav_sub').fadeOut('400');
856            $('.top_nav_sub.' + box).fadeOut('slow');
857
858
859        });
860    }
861
862
863    /*------------------------------ LightBox -------------------------------------- */
864
865    function simpleLightBoxInit() {
866        "use strict";
867        if ($(".lightbox-gallery").length > 0 || $('.show_review_form').length > 0 || $('.lightbox-media').length > 0) {
868
869            loadDependencies([s_gb.theme_fancy + 'jquery.fancybox.js'], function() {
870                loadDependencies([s_gb.theme_fancy + 'helpers/jquery.fancybox-media.js'], function() {
871                    $(".lightbox-gallery").fancybox();
872                    $('.show_review_form').fancybox();
873                    $('.lightbox-media').fancybox({
874                        openEffect: 'none',
875                        closeEffect: 'none',
876                        helpers: {
877                            media: {}
878                        }
879                    });
880                });
881            });
882        }
883    }
884
885    function simple_blog_grid_facybox() {
886        loadDependencies([s_gb.theme_fancy + 'jquery.fancybox.js'], function() {
887            $('[data-fancybox]').fancybox({
888                youtube: {
889                    controls: 0,
890                    showinfo: 0
891                },
892                vimeo: {
893                    color: 'f00'
894                }
895            });
896        });
897    }
898    /*------------------------------ Tweeter Footer Carousel ------------------------ */
899
900    function twitterFooterCarousel() {
901        "use strict";
902        $("#tweet_footer").each(function() {
903            var $self = $(this);
904            $self.carouFredSel({
905                circular: true,
906                infinite: true,
907                auto: false,
908                scroll: {
909                    items: 1,
910                    fx: "fade"
911                },
912                prev: {
913                    button: $self.parent().parent().find('.back')
914                },
915
916                next: {
917                    button: $self.parent().parent().find('.next')
918                }
919
920            });
921        });
922    }
923
924
925    /*------------------------------ Blog Carousel ------------------------ */
926
927    function simpleBlogCarousel() {
928        "use strict";
929        $(".carousel_blog").each(function() {
930            var $self = $(this);
931            if ($('li img', $self).size()) {
932                $('li img', $self).one("load", function() {
933                    $self.carouFredSel({
934                        circular: true,
935                        infinite: true,
936                        auto: false,
937
938                        scroll: {
939                            items: 1
940                        },
941
942                        prev: {
943                            button: $self.parents('.latest_blog').find('.prev')
944                        },
945
946                        next: {
947                            button: $self.parents('.latest_blog').find('.next')
948                        }
949
950                    });
951                }).each(function() {
952                    if (this.complete) $(this).trigger("load");
953                });
954            } else {
955                $self.carouFredSel({
956                    circular: true,
957                    infinite: true,
958                    auto: false,
959
960                    scroll: {
961                        items: 1
962                    },
963
964                    prev: {
965                        button: $self.parents('.latest_blog').find('.prev')
966                    },
967
968                    next: {
969                        button: $self.parents('.latest_blog').find('.next')
970                    }
971
972                });
973            }
974        });
975    }
976
977
978    /*------------------------------ Clients Carousel ------------------------ */
979
980    function clientsCarousel() {
981        "use strict";
982
983        $('.clients_caro').each(function() {
984            var $self = $(this);
985            if ($self.length) {
986                $self.css('display', 'none');
987                $self.imagesLoaded(function() {
988                    $self.css('display', 'block');
989                    $self.carouFredSel({
990                        items: 4,
991                        auto: false,
992                        scroll: { items: 1 },
993                        prev: {
994                            button: $self.parents('.clients_el').first().find('.prev')
995                        },
996
997                        next: {
998                            button: $self.parents('.clients_el').first().find('.next')
999                        }
1000                    });
1001                })
1002            }
1003        });
1004
1005
1006    }
1007
1008
1009    /*------------------------------ Testimonials Carousel ------------------------ */
1010
1011    function testimonialsCarousel() {
1012        "use strict";
1013        if ($('.testimonial_carousel').length > 0) {
1014            loadDependencies([s_gb.theme_js + 'owl.carousel.min.js'], function() {
1015
1016                $('.testimonial_carousel').each(function() {
1017                    var $self = $(this);
1018
1019
1020                    var slide_per_view = $('.testimonial_carousel').data('slidenr');
1021
1022
1023                    $(".testimonial_carousel.owl-carousel").owlCarousel({
1024
1025                        nav: true,
1026                        animateIn: 'slideInRight',
1027                        items: slide_per_view,
1028                        navText: ['<i class="lnr lnr-chevron-left"></i>', '<i class="lnr lnr-chevron-right"></i>'],
1029                        pagination: true,
1030                        itemsDesktop: [1199, 3],
1031                        itemsDesktopSmall: [979, 3],
1032                        autoplay: true,
1033                        autoplayTimeout: 2500,
1034                        autoplayHoverPause: true,
1035                        loop: true
1036
1037                    });
1038
1039
1040
1041                    var max_height = 0;
1042                    $($self + ' .item').each(function() {
1043                        if ($(this).height() > max_height)
1044                            max_height = $(this).height();
1045                    });
1046                    console.log(max_height);
1047                    $self.parents('.testimonial_carousel').first().height(max_height + 'px');
1048
1049                });
1050
1051                $('.testimonial_carousel').parents('.vc_column-inner').css("padding", "0");
1052
1053
1054            });
1055        }
1056        /*
1057            $(this).carouFredSel({
1058                            
1059                auto: true,
1060                scroll: { items : 1, fx: 'fade' },
1061                prev : {
1062                    button : $self.parent('.testimonial_carousel_element').find('.prev')
1063                },
1064
1065                next : {
1066                    button : $self.parent('.testimonial_carousel_element').find('.next')
1067                },
1068                pagination: {
1069
1070                    container: $self.parent('.testimonial_carousel_element').find('.pages_el')
1071                }
1072
1073            });
1074            var max_height = 0;
1075            $('.item', $self).each(function(){
1076                if($(this).height() > max_height)
1077                    max_height = $(this).height();
1078            });
1079
1080            $self.parents('.testimonial_carousel_element').first().height(max_height+'px');
1081
1082        });
1083
1084    */
1085    }
1086
1087    /* ---------------------------- Testimonial Cycle ----------------------------- */
1088
1089    function testimonialsCycle() {
1090        "use strict";
1091
1092        $('.testimonial_cycle').each(function() {
1093            var $self = $(this);
1094            var container_width = $self.parents('.wpb_wrapper').first().width();
1095            $('.item', $self).width(container_width + 'px');
1096
1097            $self.carouFredSel({
1098
1099                auto: true,
1100                scroll: { items: 1, fx: 'fade' },
1101
1102            });
1103
1104        });
1105    }
1106
1107
1108    /*------------------------------ Flexslider Init ------------------------ */
1109    function flexsliderInit() {
1110        "use strict";
1111        $('.flexslider').each(function() {
1112            var $s = $(this);
1113            loadDependencies([s_gb.theme_js + 'jquery.flexslider-min.js'], function() {
1114                $s.flexslider({
1115                    slideshowSpeed: 6000,
1116                    animationSpeed: 800,
1117
1118                    controlNav: true,
1119                    pauseOnAction: true,
1120                    pauseOnHover: false,
1121                    start: function(slider) {
1122
1123                        $s.find(" .slides > li .flex-caption").each(function() {
1124                            var effect_in = $(this).attr("data-effect-in");
1125                            var effect_out = $(this).attr("data-effect-out");
1126                            $(this).addClass("animated " + effect_in);
1127
1128
1129                        });
1130                    },
1131                    before: function(slider) {
1132                        var current_slide = $s.find(".slides > li").eq(slider.currentSlide);
1133                        $s.find(".slides > li .flex-caption").removeClass('animated');
1134                        $(".flex-caption", current_slide).each(function() {
1135                            var effect_in = $(this).attr("data-effect-in");
1136                            var effect_out = $(this).attr("data-effect-out");
1137
1138                            $(this).removeClass("animated " + effect_in).addClass("animated " + effect_out);
1139                        });
1140                    },
1141                    after: function(slider) {
1142                        var current_slide = $s.find(".slides > li").eq(slider.currentSlide);
1143                        $s.find(".slides > li .flex-caption").removeClass('animated');
1144                        $(".flex-caption", current_slide).each(function() {
1145                            var effect_in = $(this).attr("data-effect-in");
1146                            var effect_out = $(this).attr("data-effect-out");
1147
1148                            $(this).removeClass("animated " + effect_out).addClass("animated " + effect_in);
1149                        });
1150                    }
1151                });
1152            });
1153
1154        });
1155    }
1156
1157
1158    /*------------------------------ Portfolio Page Isotope filter ------------------------ */
1159
1160    function simplePortfolioPageIsotope() {
1161        "use strict";
1162        if ($('#portfolio-preview-items .filterable').length > 0) {
1163            var $container = $('#portfolio-preview-items .filterable');
1164
1165            $container.imagesLoaded(function() {
1166                var state = $container.mixItUp();
1167                simpleProjectBar();
1168
1169
1170            });
1171        }
1172
1173        if ($('.masonry').length > 0) {
1174            $container = $('.masonry');
1175            imagesLoaded($container, function() {
1176
1177                msnry_portfolio = new Masonry('.masonry', {
1178                    "columnWidth": ".grid-size",
1179                    itemSelector: '.portfolio-item'
1180                });
1181
1182                $('#portfolio-filter li a').click(function() {
1183                    var filter = $(this).data('filter');
1184                    if (filter != 'all') {
1185
1186                        msnry_portfolio.destroy();
1187
1188                        $container.mixItUp();
1189                        $container.removeClass('masonry').addClass('filterable');
1190
1191                        $container.mixItUp('filter', filter);
1192
1193                    } else {
1194                        $container.removeClass('filterable').addClass('masonry');
1195                        $container.mixItUp('destroy', false);
1196                        $('#portfolio-filter li').removeClass('active');
1197                        $('#portfolio-filter li a').removeClass('active');
1198                        $(this).addClass('active');
1199                        $(this).parent().addClass('active');
1200                        msnry_portfolio = new Masonry('.masonry', {
1201                            "columnWidth": ".grid-size",
1202                            itemSelector: '.portfolio-item'
1203                        });
1204                    }
1205
1206                });
1207
1208
1209            });
1210
1211        }
1212    }
1213
1214
1215
1216
1217    /*------------------------------ Portfolio Carousel ------------------------------ */
1218
1219    function simplePortfolioCarousel() {
1220        "use strict";
1221        if ($('.portfolio_slider').length > 0) {
1222
1223            var slide_per_view = $('.portfolio_slider').data('slidenr');
1224
1225            if ($(".container").css("max-width") == "940px") {
1226                slide_per_view = 4;
1227            } else if ($(".container").css("max-width") == "420px") {
1228                slide_per_view = 1;
1229            } else if ($(".container").css("width") == "724px") {
1230                slide_per_view = 2;
1231            } else if ($(".container").css("max-width") == "300px") {
1232                slide_per_view = 1;
1233            }
1234
1235            var portfolio_slider = new Swiper('.portfolio_slider', {
1236                slidesPerView: slide_per_view,
1237                paginationAsRange: false,
1238            });
1239            var $pag_wrapper = $('.recent_portfolio .portfolio_slider').parents('.wpb_row');
1240            $pag_wrapper.addClass('kyrow');
1241            if ($('.portfolio_slider').length > 0) {
1242                $pag_wrapper.find('.wpb_wrapper .block_title').append('<div class="swiper_pagination nav-fillpath">' + $('.recent_portfolio .swiper_pagination').html() + '</div>');
1243                $('.recent_portfolio .swiper_pagination').remove();
1244
1245
1246                if ($('.recent_portfolio .portfolio-item img').size()) {
1247
1248                    $('.recent_portfolio .portfolio-item img').on("load", function() {
1249                        var height = $(this).parents('.portfolio-item').first().innerHeight();
1250
1251                        $('.portfolio_slider .swiper-wrapper').css({ height: height + 'px' });
1252
1253                        $('.recent_portfolio .portfolio_slider').css({ height: height + 'px' });
1254                    });
1255                }
1256
1257
1258
1259
1260
1261            }
1262
1263
1264            $('.swiper_pagination .next', $pag_wrapper).on('click', function(e) {
1265                e.preventDefault();
1266                portfolio_slider.swipeNext();
1267            });
1268
1269            $('.swiper_pagination .prev', $pag_wrapper).on('click', function(e) {
1270                e.preventDefault();
1271                portfolio_slider.swipePrev();
1272            });
1273
1274        }
1275    }
1276
1277
1278    /*------------------------------ Portfolio Carousel ------------------------------ */
1279
1280    function simpleLatestBlogCarousel() {
1281        "use strict";
1282        if ($('.blog_slider').length > 0) {
1283
1284            var slide_per_view = $('.blog_slider').data('slidenr');
1285
1286            loadDependencies([s_gb.theme_js + 'owl.carousel.min.js'], function() {
1287                $(".blog_slider.owl-carousel").owlCarousel({
1288
1289                    navigation: false,
1290                    navigationText: false,
1291                    pagination: true,
1292
1293                    items: slide_per_view,
1294                    responsive: {
1295                        // breakpoint from 0 up
1296                        0: {
1297                            items: 1,
1298                        },
1299                        // breakpoint from 480 up
1300                        480: {
1301                            items: 2,
1302                        },
1303                        // breakpoint from 768 up
1304                        768: {
1305                            items: slide_per_view,
1306                        }
1307                    }
1308
1309                });
1310            });
1311
1312
1313        }
1314
1315    }
1316
1317    /*------------------------------ Testimonial Carousel ------------------------------ */
1318
1319    function simpleStaffCarousel() {
1320        "use strict";
1321
1322        if ($('.staff_carousel').length > 0) {
1323            var $self = $(".staff_carousel");
1324            var slide_per_view = $('.staff_carousel').data('slidenr');
1325            var slider_pagination = $('.staff_carousel').data('carousel');
1326
1327            loadDependencies([s_gb.theme_js + 'owl.carousel.min.js'], function() {
1328                $(".staff_carousel.owl-carousel").owlCarousel({
1329
1330                    navigation: false,
1331                    navigationText: false,
1332                    pagination: slider_pagination,
1333
1334                    items: slide_per_view,
1335                    itemsDesktop: [1199, 3],
1336                    itemsDesktopSmall: [979, 3]
1337
1338                });
1339            });
1340
1341        }
1342
1343
1344    }
1345    /*------------------------------ Testimonial Carousel ------------------------------ */
1346
1347    function simpleTestimonialCarousel() {
1348        "use strict";
1349
1350        if ($('.testimonial_carousel').length > 0) {
1351            loadDependencies([s_gb.theme_js + 'owl.carousel.min.js'], function() {
1352                var $self = $(".testimonial_carousel");
1353                var slide_per_view = $('.testimonial_carousel').data('slidenr');
1354
1355
1356                $(".testimonial_carousel.owl-carousel").owlCarousel({
1357
1358                    navigation: true,
1359                    navigationText: false,
1360                    pagination: true,
1361                    autoWidth: true,
1362                    autoHeight: true,
1363                    items: slide_per_view,
1364                    itemsDesktop: [1199, 3],
1365                    itemsDesktopSmall: [979, 3]
1366
1367                });
1368
1369
1370
1371                var max_height = 0;
1372                $('.item', $self).each(function() {
1373                    if ($(this).height() > max_height)
1374                        max_height = $(this).height();
1375                });
1376                $self.parents('.testimonial_carousel_element').first().height(max_height + 'px');
1377
1378            });
1379
1380            $('.testimonial_carousel_element').parents('.vc_column-inner').css("padding", "0");
1381
1382
1383        }
1384
1385
1386    }
1387
1388    /*------------------------------ Simple Slider ------------------------------ */
1389
1390    $.fn.simpleSliderInit = function() {
1391        "use strict";
1392        var slider = this;
1393        var parent = this.parents('.simple_slider_swiper').first();
1394        var slide_per_view = slider.data('slidenumber');
1395        var height = slider.data('height');
1396
1397        if (height == 'fullscreen')
1398            height = $(window).height();
1399
1400        if ($('body').hasClass('outter_padding'))
1401            height -= 40;
1402
1403        var $loading = $('.loading', parent);
1404
1405        if ($('body').hasClass('header_7') && $(window).width() > 970 && $('.simple_slider_wrapper', parent).css('position') == 'fixed') {
1406            var pad = $('.header_wrapper').innerWidth();
1407            var pos = 'left'
1408            if ($('.pos--right').length > 0)
1409                pos = 'right'
1410            if (!($('body').hasClass('transparent_padding'))) {
1411                $('.simple_slider_wrapper', parent).css('padding-' + pos, pad + 'px');
1412                $('.simple_slider_wrapper', parent).width($('#slider-fullwidth').width() + 'px');
1413            }
1414        }
1415
1416        if ($('body').hasClass('outter_padding')) {
1417            $('.simple_slider_wrapper', parent).width($('#slider-fullwidth').width() + 'px');
1418        }
1419
1420        parent.height(height + 'px');
1421        slider.height(height + 'px');
1422        $('.simple_slider_wrapper', parent).css('min-height', height + 'px');
1423        parent.css('min-height', height + 'px');
1424
1425
1426        if ($(window).width() < 767) {
1427            var window_width = $(window).width();
1428            var new_height = (window_width * height) / 767;
1429            $('.simple_slider_wrapper', parent).css('min-height', new_height + 'px');
1430            parent.css('min-height', new_height + 'px');
1431
1432            parent.height(new_height + 'px');
1433            slider.height(new_height + 'px');
1434        }
1435
1436        $('.simple_slider').imagesLoaded(function() {
1437            $loading.css('display', 'none');
1438            var c_speed = $('.simple_slider').data('speed');
1439            if (c_speed == 'undefined')
1440                c_speed = 10000;
1441            simpleSlider = new Swiper('.simple_slider', {
1442                slidesPerView: slide_per_view,
1443                paginationAsRange: false,
1444                loop: false,
1445                touchRatio: 0.7,
1446                autoplay: c_speed,
1447                speed: 800,
1448                noSwiping: true,
1449                updateOnImagesReady: true,
1450                onSwiperCreated: function(swiper) {
1451                    var $h1 = $(swiper.activeSlide()).find('h1');
1452                    var $p = $(swiper.activeSlide()).find('p');
1453                    var $buttons = $(swiper.activeSlide()).find('.buttons');
1454                    var slide_color = $(swiper.activeSlide()).data('color');
1455                    $h1.removeClass('with_animation').addClass($h1.data('animation'));
1456                    $p.removeClass('with_animation').addClass($p.data('animation'));
1457                    $buttons.removeClass('with_animation').addClass($buttons.data('animation'));
1458                    if (($('body').hasClass('header_transparency')) && !$('.header_wrapper').hasClass('open'))
1459                        $('.header_wrapper').removeClass('background--light').removeClass('background--dark').addClass('background--' + slide_color);
1460                },
1461                onSlideChangeEnd: function(swiper) {
1462                    var $h1 = $(swiper.activeSlide()).find('h1');
1463                    var $p = $(swiper.activeSlide()).find('p');
1464                    var $buttons = $(swiper.activeSlide()).find('.buttons');
1465                    var slide_color = $(swiper.activeSlide()).data('color');
1466                    $h1.removeClass('with_animation').addClass($h1.data('animation'));
1467                    $p.removeClass('with_animation').addClass($p.data('animation'));
1468                    $buttons.removeClass('with_animation').addClass($buttons.data('animation'));
1469
1470
1471                    $h1 = $(swiper.activeSlide()).next().find('h1');
1472                    $p = $(swiper.activeSlide()).next().find('p');
1473                    $buttons = $(swiper.activeSlide()).next().find('.buttons');
1474                    $h1.addClass('with_animation').removeClass($h1.data('animation'));
1475                    $p.addClass('with_animation').removeClass($p.data('animation'));
1476                    $buttons.addClass('with_animation').removeClass($buttons.data('animation'));
1477
1478                    $h1 = $(swiper.activeSlide()).prev().find('h1');
1479                    $p = $(swiper.activeSlide()).prev().find('p');
1480                    $buttons = $(swiper.activeSlide()).prev().find('.buttons');
1481                    $h1.addClass('with_animation').removeClass($h1.data('animation'));
1482                    $p.addClass('with_animation').removeClass($p.data('animation'));
1483                    $buttons.addClass('with_animation').removeClass($buttons.data('animation'));
1484                    if (($('body').hasClass('header_transparency')) && !$('.header_wrapper').hasClass('open'))
1485                        $('.header_wrapper').removeClass('background--light').removeClass('background--dark').addClass('background--' + slide_color);
1486                },
1487                onSlideChangeStart: function(swiper) {
1488                    var $h1 = $(swiper.activeSlide()).find('h1');
1489                    var $p = $(swiper.activeSlide()).find('p');
1490                    var $buttons = $(swiper.activeSlide()).find('.buttons');
1491                    var slide_color = $(swiper.activeSlide()).data('color');
1492                    $h1.addClass('with_animation').removeClass($h1.data('animation'));
1493                    $p.addClass('with_animation').removeClass($p.data('animation'));
1494                    $buttons.addClass('with_animation').removeClass($buttons.data('animation'));
1495                    if (($('body').hasClass('header_transparency')) && !$('.header_wrapper').hasClass('open'))
1496                        $('.header_wrapper').removeClass('background--light').removeClass('background--dark').addClass('background--' + slide_color);
1497                }
1498            });
1499
1500            $('.nav-slider .next', parent).on('click', function(e) {
1501                e.preventDefault();
1502                simpleSlider.swipeNext();
1503            });
1504
1505            $('.nav-slider .prev', parent).on('click', function(e) {
1506                e.preventDefault();
1507                simpleSlider.swipePrev();
1508            });
1509        });
1510
1511
1512
1513        if (parent.hasClass('parallax_slider') && $('.container').width() > 420 && $window_width != 1024) {
1514
1515            loadDependencies([s_gb.theme_js + 'skrollr.min.js'], function() {
1516
1517                var skrollr_slider = skrollr.init({
1518                    edgeStrategy: 'set',
1519                    smoothScrolling: true,
1520                    forceHeight: false
1521                });
1522                skrollr_slider.refresh()
1523            });
1524        }
1525
1526        var skrollr_slider;
1527        if (parent.hasClass('parallax_slider') && $('.container').width() > 680 && $window_width != 1024) {
1528            loadDependencies([s_gb.theme_js + 'skrollr.min.js'], function() {
1529                skrollr_slider = skrollr.init({
1530                    edgeStrategy: 'set',
1531                    smoothScrolling: true,
1532                    forceHeight: false
1533                });
1534                skrollr_slider.refresh()
1535            });
1536        }
1537
1538
1539
1540        if ($('.swiper-slide', slider).length == 1)
1541            $('.nav-slider', parent).hide();
1542
1543        $(window).resize(function() {
1544            if ($('body').hasClass('header_7') && $(window).width() > 970) {
1545                var pad = $('.header_wrapper').innerWidth();
1546                var pos = 'left'
1547                if ($('.pos--right').length > 0)
1548                    pos = 'right'
1549                if (!($('body').hasClass('transparent_padding'))) {
1550                    $('.simple_slider_wrapper', parent).css('padding-' + pos, pad + 'px');
1551                    $('.simple_slider_wrapper', parent).width($('#slider-fullwidth').width() + 'px');
1552                }
1553            } else {
1554                var pos = 'left'
1555                if ($('.pos--right').length > 0)
1556                    pos = 'right'
1557                if (!($('body').hasClass('transparent_padding'))) {
1558                    $('.simple_slider_wrapper', parent).css('padding-' + pos, 0 + 'px');
1559                    $('.simple_slider_wrapper', parent).width($('#slider-fullwidth').width() + 'px');
1560                }
1561            }
1562
1563            height = slider.data('height');
1564
1565            if (height == 'fullscreen') {
1566                height = $(window).height();
1567                $('.simple_slider_wrapper', parent).css('min-height', height + 'px');
1568                parent.css('min-height', height + 'px');
1569            }
1570            parent.height(height + 'px');
1571            slider.height(height + 'px');
1572
1573            if ($(window).width() < 767) {
1574                var window_width = $(window).width();
1575                var new_height = (window_width * height) / 767;
1576                $('.simple_slider_wrapper', parent).css('min-height', new_height + 'px');
1577                parent.css('min-height', new_height + 'px');
1578
1579                parent.height(new_height + 'px');
1580                slider.height(new_height + 'px');
1581            }
1582
1583            if (parent.hasClass('parallax_slider') && $('.container').width() > 680 && $window_width != 1024) {
1584                loadDependencies([s_gb.theme_js + 'skrollr.min.js'], function() {
1585                    $('.simple_slider_wrapper', parent).addClass('skrollable');
1586                    skrollr_slider = skrollr.init({
1587                        edgeStrategy: 'set',
1588                        smoothScrolling: true,
1589                        forceHeight: false
1590                    });
1591                    skrollr_slider.refresh();
1592                });
1593
1594
1595            } else {
1596                $('.simple_slider_wrapper', parent).removeClass('skrollable');
1597            }
1598
1599        });
1600
1601
1602    };
1603
1604
1605    /*------------------------------ Woocommerce Functions ------------------------------ */
1606
1607    function simpleWoocommerceInit() {
1608        "use strict";
1609        if ($('.add_to_cart_button').length > 0) {
1610
1611            $('body').on('adding_to_cart', function(event, param1, param2) {
1612                var $thisbutton = param1;
1613                var $product = $thisbutton.parents('.product').first();
1614                var $load = $product.find('.loading_ef');
1615                $load.css('opacity', 1);
1616                $('body').on('added_to_cart', function(event, param1, param2) {
1617
1618                    $load.css('opacity', 0);
1619
1620                    setTimeout(function() {
1621                        $load.html('<i class="moon-checkmark"></i>');
1622                        $load.css('opacity', 1);
1623                    }, 500);
1624                    setTimeout(function() { $load.css('opacity', 1); }, 400);
1625                    setTimeout(function() { $load.css('opacity', 0); }, 2000);
1626                    $product.addClass('product_added_to_cart');
1627                });
1628            });
1629        }
1630    }
1631
1632
1633    /*------------------------------ Left Navigation ------------------------------ */
1634
1635    function simpleLeftNavtion() {
1636        "use strict";
1637        $(".page_item_has_children").each(function() {
1638            $(this).click(function() {
1639                $(this).find('.children').toggle(400);
1640                $(this).toggleClass('open-child');
1641
1642            });
1643        });
1644
1645        $('li.current_page_item').parents('.children').css({ display: 'block' });
1646        $('.current_page_ancestor').addClass('open-child');
1647    }
1648
1649
1650    /*------------------------------ Mobile Menu ---------------------------- */
1651
1652    function simpleMobileMenu() {
1653        "use strict";
1654        var height = $('header#header .row-fluid:first-child .span12, .header_wrapper').height();
1655        var padding = $('.top_wrapper').css('padding-top');
1656
1657        $('.mobile_small_menu').click(function() {
1658
1659            if ($(this).hasClass('open')) {
1660                $('.header_wrapper').height('auto');
1661                $('header#header .row-fluid:first-child .span12').css('position', 'relative');
1662
1663                $('header#header .row-fluid:first-child .span12').height(height);
1664                $('.menu-small').slideDown(400);
1665                if (!$('body').hasClass('header_3'))
1666                    $('.top_wrapper').css('float', 'none').css('width', 'inherit').css('display', 'block');
1667
1668                if ($('body').hasClass('header_4'))
1669                    $('.top_wrapper').css('padding-top', '0');
1670                $('.tparrows').hide();
1671
1672                $(this).removeClass('open').addClass('close');
1673            } else if ($(this).hasClass('close')) {
1674
1675                $('.menu-small').slideUp(400);
1676                $('.tparrows').show();
1677                if (!$('body').hasClass('header_3'))
1678                    $('.top_wrapper').css('float', 'none').css('width', 'inherit').css('display', 'block');
1679
1680                if ($('body').hasClass('header_4'))
1681                    $('.top_wrapper').css('padding-top', padding);
1682                $(this).removeClass('close').addClass('open');
1683                $('.header_wrapper').height('auto');
1684            }
1685        });
1686
1687        $('#mobile-menu li').each(function() {
1688            var id = $(this).attr('id');
1689            $(this).attr('id', 'responsive-' + id);
1690        });
1691
1692        $(window).resize(function() {
1693            var height = $('header#header .row-fluid:first-child .span12, .header_wrapper').height();
1694            var padding = $('.top_wrapper').css('padding-top');
1695            if ($(window).width() > 980) {
1696                $('.header_7 .header_wrapper').height('100%');
1697                $('.menu-small').slideUp(400);
1698                $('.tparrows').show();
1699                if (!$('body').hasClass('header_3'))
1700                    $('.top_wrapper').css('float', 'none').css('width', 'inherit').css('display', 'block');
1701
1702                if ($('body').hasClass('header_4'))
1703                    $('.top_wrapper').css('padding-top', padding);
1704                $('.mobile_small_menu').removeClass('close').addClass('open');
1705                $('.header_wrapper').height('auto');
1706            }
1707        });
1708        if ($(window).width() > 980) {
1709            $('.header_7 .header_wrapper.transparent_padding').height('auto');
1710        }
1711        if ($(window).width() < 980) {
1712            $('.header_7 .header_wrapper').removeClass('transparent_padding');
1713        }
1714    }
1715
1716    /*------------------------------ Related posts Carousel ------------------------------ */
1717    function simpleRelatedpostsCarousel() {
1718        "use strict";
1719        if ($('.related_posts').length > 0) {
1720
1721            if ($(".span9 > .related .related_posts").length)
1722                var slide_per_view = 3;
1723            else
1724                var slide_per_view = 4;
1725            //var slide_per_view = $('.related_posts').data('slidenr');
1726
1727            loadDependencies([s_gb.theme_js + 'owl.carousel.min.js'], function() {
1728                $(".related_posts.owl-carousel").owlCarousel({
1729
1730                    navigation: false,
1731                    navigationText: false,
1732                    pagination: true,
1733
1734                    items: slide_per_view,
1735                    itemsDesktop: [1199, 3],
1736                    itemsDesktopSmall: [979, 3],
1737                    responsive: {
1738                        0: {
1739                            items: 1,
1740                            nav: false
1741                        },
1742                        600: {
1743                            items: 1,
1744                            nav: false
1745                        },
1746
1747                        1100: {
1748                            items: 3,
1749                            nav: false
1750                        }
1751                    }
1752
1753                });
1754            });
1755
1756
1757        }
1758
1759    }
1760
1761
1762    /*-------------------------------------------------------------------------------------------------------------*/
1763    /*------------------------------------------ FUNCTIONS END ----------------------------------------------------*/
1764    /*-------------------------------------------------------------------------------------------------------------*/
1765
1766
1767
1768
1769
1770    /*------------------------------ Switcher Toggle Button ------------------------ */
1771
1772    function simpleSwitcherToggle() {
1773        "use strict";
1774        $("#switcher-head .button").toggle(function() {
1775            $("#style-switcher").animate({
1776                left: 0
1777            }, 500);
1778        }, function() {
1779            $("#style-switcher").animate({
1780                left: -263
1781            }, 500);
1782        });
1783    }
1784
1785
1786    /* ----------------------------- SmoothScroll ---------------------------- */
1787
1788    function simple_smoothScroll() {
1789        "use strict";
1790        try {
1791            $.browserSelector();
1792            if ($("html").hasClass("chrome")) {
1793                $.smoothScroll();
1794            }
1795        } catch (err) {
1796
1797        }
1798    }
1799
1800    /* ----------------------------- End SmoothScroll ------------------------ */
1801
1802
1803    /* ----------------------------- BLOG Masonry ---------------------------- */
1804
1805    function simple_blogmasonry() {
1806        "use strict";
1807        var container = $('#blogmasonry .filterable');
1808        container.imagesLoaded(function() {
1809
1810            msnry_blog = new Masonry('#blogmasonry .filterable', {
1811                "columnWidth": ".grid-size",
1812                itemSelector: '.blog-article'
1813            });
1814
1815        });
1816    }
1817
1818    /* ----------------------------- End BLOG Masonry ------------------------ */
1819
1820
1821    /* ----------------------------- Simple Post Share --------------------- */
1822    function simplePostShares() {
1823        "use strict";
1824        $('.blog-article .share_link').each(function() {
1825            var link = $(this);
1826            link.on('mouseover', function() {
1827
1828                var cont = $(this).parents('.blog-article').find('.shares');
1829                var parent = $(this).parents('.blog-article').parent();
1830                if (link.hasClass('opened')) {
1831                    cont.css('opacity', 0).css('visibility', 'hidden');
1832                    link.removeClass('opened');
1833                } else {
1834                    parent.find('.share_link').removeClass('opened');
1835                    parent.find('.shares').css('opacity', 0).css('visibility', 'hidden');
1836                    link.addClass('opened');
1837                    cont.css('visibility', 'visible').css('opacity', 1);
1838
1839                }
1840            });
1841            $(' .blog-article .shares_container').delegate(link, 'mouseleave', function() {
1842                var cont = $(this).parents('.blog-article').find('.shares');
1843                var parent = $(this).parents('.blog-article').parent();
1844                if (link.hasClass('opened'))
1844 {
1845                    cont.css('opacity', 0).css('visibility', 'hidden');
1846                    link.removeClass('opened');
1847
1848                }
1849            });
1850
1851
1852        });
1853
1854
1855
1856
1857
1858    }
1859    /* ----------------------------- End Simple Post Share ----------------- */
1860
1861
1862    /* ----------------------------- Background Check ------------------------ */
1863
1864    function simple_backgroundcheck() {
1865        "use strict";
1866        if ($('.header_1').length > 0 || $('.header_4').length > 0) {
1867            if ($('.page_header_centered').length > 0 && $('.auto_color_check').length > 0) {
1868                $('.header_wrapper').addClass('background--dark');
1869                BackgroundCheck.init({
1870                    targets: '.header_wrapper',
1871                    images: '.header_page',
1872                    classes: { dark: 'background--dark', light: 'background--light', complex: 'background--dark' }
1873                });
1874                setTimeout(function() { BackgroundCheck.refresh(); }, 400);
1875            }
1876
1877            if ($('#fullpage').length > 0 && $('.auto_color_check').length > 0) {
1878                $('.header_wrapper').addClass('background--dark');
1879                BackgroundCheck.init({
1880                    targets: '.header_wrapper',
1881                    images: '.section'
1882                });
1883                setTimeout(function() {
1884                    if ($('.header_wrapper').hasClass('background--light'))
1885                        $('.section:first-child .content').addClass('background--light');
1886                    else if ($('.header_wrapper').hasClass('background--dark'))
1887                        $('.section:first-child .content').addClass('background--dark');
1888                }, 800);
1889            }
1890
1891            if ($('.fullscreen-single').length > 0 && $('.auto_color_check').length > 0) {
1892                $('.header_wrapper').addClass('background--dark');
1893                var ca = Array.prototype.slice.call(document.querySelectorAll(".header_wrapper")).concat(Array.prototype.slice.call(document.querySelectorAll(".fullscreen-single")));
1894                BackgroundCheck.init({
1895                    targets: ca,
1896                    images: '.header_fullscreen_single img',
1897                    windowEvents: false
1898                });
1899            }
1900
1901
1902        }
1903    }
1904
1905    /* ----------------------------- End Background Check -------------------- */
1906
1907    /* ----------------------------- Fullscreen Section ---------------------- */
1908
1909    function simple_fullscreen_section() {
1910        if ($(window).width() > 960) {
1911            "use strict";
1912            if ($('.fullscreen-blog-article').length > 0) {
1913                $('#fullpage .section .content').each(function() {
1914                    var height = $(this).height();
1915                    $(this).css('margin-top', '-' + (height / 2) + 'px');
1916                });
1917            }
1918            $('#fullpage').fullpage({
1919                verticalCentered: false,
1920                navigation: true,
1921                navigationPosition: 'right',
1922                resize: false,
1923
1924                afterLoad: function(anchorLink, index) {
1925                    if ($('.auto_color_check').length > 0) {
1926                        BackgroundCheck.refresh();
1927                        if ($('.header_wrapper').hasClass('background--light'))
1928                            $('.section:nth-child(' + index + ') .content').addClass('background--light');
1929                        else if ($('.header_wrapper').hasClass('background--dark'))
1930                            $('.section:nth-child(' + index + ') .content').addClass('background--dark');
1931                    }
1932                    $('#fullpage .section .with_animation').animate_on_appear();
1933
1934
1935
1936                },
1937                afterRender: function() {
1938                    $('#fullpage .section .with_animation').animate_on_appear();
1939                }
1940                /*onLeave: function(index, nextIndex){
1941                    var current = $('#fullpage .section:nth-child('+index+') .content') ;
1942                    var next = $('#fullpage .section:nth-child('+nextIndex+') .content');
1943                    current.removeClass('with_animation').removeClass(current.data('animation'));
1944                    next.addClass('with_animation').delay(current.data('delay')).queue( function() {
1945                        $(this).addClass(current.data('animation'));
1946                    });
1947                }*/
1948
1949            });
1950
1951        } //endif
1952    }
1953
1954    /* ----------------------------- End Fullscreen Section ------------------- */
1955
1956    /* ----------------------------- SINGLE PORTFOLIO FLOATING----------------- */
1957
1958    function simple_single_portfolio_floating() {
1959        "use strict";
1960        var $sidebar = $(".fixed_sidebar"),
1961            $window = $(window),
1962            offset = $sidebar.offset(),
1963            topPadding = 15;
1964
1965        if ($('.container').width() > 420 && $sidebar.length > 0) {
1966            $window.scroll(function() {
1967                if ($window.scrollTop() > offset.top) {
1968                    $sidebar.stop().animate({
1969                        marginTop: $window.scrollTop() - offset.top + topPadding
1970                    });
1971                } else {
1972                    $sidebar.stop().animate({
1973                        marginTop: 0
1974                    });
1975                }
1976            });
1977        } else {
1978            $(window).unbind('scroll');
1979        }
1980    }
1981
1982
1983    /* ----------------------------- END SINGLE PORTFOLIO FLOATING------------ */
1984
1985    /* ----------------------------- Custom Select --------------------------- */
1986
1987    function simpleCustomSelect() {
1988        "use strict";
1989        $('.woocommerce-ordering .orderby').select2();
1990
1991    }
1992
1993    /* ----------------------------- End Custom Select ----------------------- */
1994
1995    /* ----------------------------- Simple gallery carousel --------------- */
1996
1997    function simpleGalleryCarouselInit() {
1998        "use strict";
1999        var gallery = $('.simple_gallery_carousel');
2000
2001        var slider = gallery.find('.simple_swiper_gallery');
2002        slider.hide();
2003        if (gallery.length > 0) {
2004
2005            var height = gallery.data('height');
2006
2007            if (height == 'fullscreen')
2008                height = $(window).height();
2009
2010            var $loading = $('.loading', gallery);
2011
2012            gallery.height(height + 'px');
2013            slider.height(height + 'px');
2014
2015            $('.simple_swiper_gallery').imagesLoaded(function() {
2016                $loading.css('display', 'none');
2017                var centered = false;
2018                var VslidesPerView = 'auto';
2019                if ($('.simple_gallery_carousel').hasClass('the-simple'))
2020                    centered = false;
2021                else {
2022                    centered = true;
2023                }
2024
2025                if ($(window).width() > 979) {
2026                    simpleSlider = new Swiper('.simple_swiper_gallery', {
2027                        slidesPerView: 'auto',
2028                        paginationAsRange: false,
2029                        loop: centered,
2030                        initialSlide: -1,
2031                        centeredSlides: centered,
2032                        touchRatio: 0.7,
2033                        autoplay: 5000,
2034                        speed: 800,
2035                        noSwiping: true,
2036                        updateOnImagesReady: true
2037                    });
2038
2039
2040                } else {
2041
2042                    simpleSlider = new Swiper('.simple_swiper_gallery', {
2043                        slidesPerView: 1,
2044                        paginationAsRange: false,
2045                        touchRatio: 0.7,
2046                        autoplay: 5000,
2047                        speed: 800,
2048                        noSwiping: true,
2049                        updateOnImagesReady: true
2050                    });
2051
2052                    gallery.addClass('mobile_gallery');
2053
2054                }
2055
2056                slider.fadeIn('slow');
2057                $('.nav-slider .next', gallery).on('click', function(e) {
2058                    e.preventDefault();
2059                    simpleSlider.swipeNext();
2060                });
2061
2062                $('.nav-slider .prev', gallery).on('click', function(e) {
2063                    e.preventDefault();
2064                    simpleSlider.swipePrev();
2065                });
2066                simpleSlider.resizeFix();
2067
2068
2069            });
2070
2071            if ($('.swiper-slide', slider).length == 1)
2072                $('.nav-slider', gallery).hide();
2073
2074            $(window).resize(function() {
2075
2076                if ($('body').hasClass('header_7') && $(window).width() > 970) {
2077                    var pad = $('.header_wrapper').innerWidth();
2078                    var pos = 'left'
2079                    if ($('.pos--right').length > 0)
2080                        pos = 'right'
2081                    $('.simple_slider_wrapper', gallery).css('padding-' + pos, pad + 'px');
2082                    $('.simple_slider_wrapper', gallery).width($('#slider-fullwidth').width() + 'px');
2083                } else {
2084                    var pos = 'left'
2085                    if ($('.pos--right').length > 0)
2086                        pos = 'right'
2087                    $('.simple_slider_wrapper', gallery).css('padding-' + pos, 0 + 'px');
2088                    $('.simple_slider_wrapper', gallery).width($('#slider-fullwidth').width() + 'px');
2089
2090                }
2091
2092                if ($(window).width() < 970) {
2093                    simpleSlider = new Swiper('.simple_swiper_gallery', {
2094                        slidesPerView: 1,
2095                        paginationAsRange: false,
2096                        touchRatio: 0.7,
2097                        autoplay: 5000,
2098                        speed: 800,
2099                        noSwiping: true,
2100                        updateOnImagesReady: true
2101                    });
2102
2103                    gallery.addClass('mobile_gallery');
2104                }
2105            });
2106
2107
2108
2109        }
2110    }
2111
2112    /* ----------------------------- End Simple gallery carousel ----------- */
2113
2114
2115
2116    /* ----------------------------- Tabs ------------------------------------ */
2117
2118    function simpleTabsactive() {
2119        "use strict";
2120        if ($('.tabbable').length > 0) {
2121            $('.tabbable').each(function() {
2122                var id = $(this).find('.nav-tabs li.active a').attr('href');
2123                $(this).find(id).addClass('active');
2124            });
2125        }
2126    }
2127
2128    /* ----------------------------- End Tabs -------------------------------- */
2129
2130    /* ----------------------------- Buttons Style --------------------------- */
2131
2132    function simpleOverallButton() {
2133        "use strict";
2134        var extra = simple_global.button_style;
2135
2136        if ($('.wpcf7-form input[type="submit"]').length > 0) {
2137            $('.wpcf7-form input[type="submit"]').addClass('btn-bt').addClass(extra);
2138        }
2139        if ($('#respond input[type="submit"]').length > 0) {
2140            $('#respond input[type="submit"]').addClass('btn-bt').addClass(extra);
2141        }
2142
2143        if ($('.woocommerce .button, #woocommerce .button').length > 0) {
2144            $('.woocommerce .button, #woocommerce .button').not('.wpb_content_element.button').addClass('btn-bt').addClass(extra);
2145        }
2146
2147        if ($('.not_found .search_field').length > 0) {
2148            $('.not_found .search_field button').addClass('btn-bt').addClass(extra);
2149        }
2150
2151        if ($('.post-password-form input[type="submit"]').length > 0) {
2152            $('.post-password-form input[type="submit"]').addClass('btn-bt').addClass(extra);
2153        }
2154
2155        if ($('.mc_signup_submit input').length > 0) {
2156            $('.mc_signup_submit input').addClass('btn-bt').addClass(extra);
2157        }
2158
2159        if ($('.mc4wp-form input[type="submit"]').length > 0) {
2160            $('.mc4wp-form input[type="submit"]').addClass('btn-bt').addClass(extra);
2161        }
2162
2163        $("body").bind("added_to_cart", function() {
2164            $('.added_to_cart').addClass('btn-bt').addClass(extra);
2165        });
2166        if ($('#place_order.button').length > 0) {
2167            $('#place_order.button').addClass('btn-bt').addClass(extra);
2168        }
2169    }
2170
2171    /* ----------------------------- End Buttons Style ----------------------- */
2172
2173    /* ----------------------------- Header5 Overlay ------------------------- */
2174
2175    function simpleMenuOverlay() {
2176
2177        var triggerBttn = document.getElementById('trigger-overlay1'),
2178            overlay = document.querySelector('div.overlay_menu'),
2179            closeBttn = overlay.querySelector('button.overlay-close');
2180        transEndEventNames = {
2181                'WebkitTransition': 'webkitTransitionEnd',
2182                'MozTransition': 'transitionend',
2183                'OTransition': 'oTransitionEnd',
2184                'msTransition': 'MSTransitionEnd',
2185                'transition': 'transitionend'
2186            },
2187            transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
2188            support = { transitions: Modernizr.csstransitions };
2189
2190        triggerBttn.addEventListener('click', toggleOverlay);
2191        closeBttn.addEventListener('click', toggleOverlay);
2192
2193        function toggleOverlay() {
2194            if (classie.has(overlay, 'open')) {
2195                classie.remove(overlay, 'open');
2196                classie.add(overlay, 'close');
2197
2198                var onEndTransitionFn = function(ev) {
2199                    if (support.transitions) {
2200                        if (ev.propertyName !== 'visibility') return;
2201                        this.removeEventListener(transEndEventName, onEndTransitionFn);
2202                    }
2203                    classie.remove(overlay, 'close');
2204                };
2205                if (support.transitions) {
2206                    overlay.addEventListener(transEndEventName, onEndTransitionFn);
2207                } else {
2208                    onEndTransitionFn();
2209                }
2210            } else if (!classie.has(overlay, 'close')) {
2211                classie.add(overlay, 'open');
2212            }
2213        }
2214
2215
2216        $('.overlay_menu .menu-item-has-children').hover(function() {
2217
2218            var height = $(this).find('.sub-menu li').height();
2219            height *= $(this).find('.sub-menu li').length;
2220            //$(this).find('.sub-menu').height(height+'px');
2221
2222        }, function() {
2223            //$(this).find('.sub-menu').height(0);
2224        });
2225
2226    }
2227
2228
2229    /* ----------------------------- End Header 5 Overlay -------------------- */
2230
2231    /* ----------------------------- Search overlay ------------------------- */
2232
2233    function simpleSearchOverlay() {
2234
2235        if ($('.open_search_button').length > 0) {
2236            var triggerBttn = document.getElementById('trigger-overlay'),
2237                overlay = document.querySelector('div.search_bar'),
2238                closeBttn = overlay.querySelector('div.overlay-close');
2239            transEndEventNames = {
2240                    'WebkitTransition': 'webkitTransitionEnd',
2241                    'MozTransition': 'transitionend',
2242                    'OTransition': 'oTransitionEnd',
2243                    'msTransition': 'MSTransitionEnd',
2244                    'transition': 'transitionend'
2245                },
2246                transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
2247                support = { transitions: Modernizr.csstransitions };
2248
2249            triggerBttn.addEventListener('click', toggleOverlay);
2250            closeBttn.addEventListener('click', toggleOverlay);
2251
2252            function toggleOverlay() {
2253
2254                if (classie.has(overlay, 'open')) {
2255                    classie.remove(overlay, 'open');
2256                    classie.add(overlay, 'close');
2257
2258                    var onEndTransitionFn = function(ev) {
2259                        if (support.transitions) {
2260                            if (ev.propertyName !== 'visibility') return;
2261                            this.removeEventListener(transEndEventName, onEndTransitionFn);
2262                        }
2263                        classie.remove(overlay, 'close');
2264                    };
2265                    if (support.transitions) {
2266                        overlay.addEventListener(transEndEventName, onEndTransitionFn);
2267                    } else {
2268                        onEndTransitionFn();
2269                    }
2270                } else if (!classie.has(overlay, 'close')) {
2271                    classie.add(overlay, 'open');
2272                }
2273            }
2274
2275
2276
2277        }
2278
2279    }
2280
2281
2282    /* ----------------------------- End Search overlay -------------------- */
2283
2284    /* ----------------------------- Layout Changes -------------------------- */
2285
2286    function simpleLayoutChanges() {
2287        "use strict";
2288        var container = $('.container').width();
2289        $('.testimonial_carousel .item').each(function() {
2290
2291            var self = $(this);
2292            var wpb_column = self.parents('.wpb_column').first().width();
2293            self.innerWidth(wpb_column + 'px');
2294            self.height(self.height() + 'px');
2295            self.parents('.caroufredsel_wrapper').first().height(self.height() + 'px');
2296            self.parents('.testimonial_carousel').first().height(self.height() + 'px');
2297
2298        });
2299
2300        $('.clients_caro .item').each(function() {
2301            var self = $(this);
2302            var wpb_column = self.parents('.vc_column-inner').width();
2303
2304            if (container > 420 && container <= 724) {
2305                self.innerWidth((wpb_column / 3) + 'px');
2306            }
2307            if (container > 724 && container < 940) {
2308                self.innerWidth((wpb_column / 4) + 'px');
2309            }
2310            if (container > 940) {
2311                self.innerWidth((wpb_column / 6) + 'px');
2312            }
2313        });
2314
2315        clientsCarousel();
2316    }
2317
2318    /* ----------------------------- End Layout Changes ---------------------- */
2319
2320
2321    /* ----------------------------- One Page -------------------------------- */
2322
2323    function simpleOnePage() {
2324        "use strict";
2325        $('nav .menu').onePageNav({
2326            currentClass: 'current-menu-item',
2327            changeHash: false,
2328            scrollSpeed: 750,
2329            scrollThreshold: 0.5,
2330        });
2331    }
2332
2333    /* ----------------------------- End One Page ---------------------------- */
2334
2335
2336    function fixWooCommercebtn() {
2337
2338        jQuery(document.body).on('updated_cart_totals', function() {
2339            var extra = simple_global.button_style;
2340
2341            if ($('.woocommerce .button, #woocommerce .button').length > 0) {
2342                $('.woocommerce .button, #woocommerce .button').addClass('btn-bt').addClass(extra);
2343
2344            }
2345
2346        })
2347    }
2348
2349    /* ----------------------------- Sticky Nav ------------------------------ */
2350
2351    function simpleStickyNav() {
2352        "use strict";
2353        var opened = false;
2354        var position = $('.header_wrapper').css('position');
2355        var bool_test = false;
2356        $('.logo_only_sticky .header_wrapper #logo').css('opacity', 0).css('visibility', 'hidden');
2357        $(window).scroll(function() {
2358            var top = $(this).scrollTop();
2359
2360            if (top > stickyNavTop + 300 && !opened) {
2361
2362                $('body').addClass('sticky_header');
2363
2364                setTimeout(function() {
2365                    if ($('.header_wrapper').hasClass('background--dark')) {
2366                        $('.header_wrapper').removeClass('background--dark');
2367                        bool_test = true;
2368                    }
2369                    $('.header_wrapper').css('position', 'fixed').css('visibility', 'visible').addClass('open');
2370                    opened = true;
2371
2372                }, 200);
2373
2374                $('.logo_only_sticky .header_wrapper #logo').css('visibility', 'visible').css('opacity', 1);
2375
2376            } else if (top == 0) {
2377                if (($('body').hasClass('header_transparency')) && bool_test) {
2378                    $('.header_wrapper').addClass('background--dark');
2379                }
2380
2381
2382
2383                $('body').removeClass('sticky_header');
2384                $('.header_wrapper').removeClass('open').css('position', position);
2385
2386                if (simpleSlider) {
2387                    var slide_color = simpleSlider.activeSlide().data('color');
2388                    if (($('.header_wrapper').hasClass('header_1') || $('.header_wrapper').hasClass('header_11')) && !$('.header_wrapper').hasClass('open'))
2389                        $('.header_wrapper').removeClass('background--light').removeClass('background--dark').addClass('background--' + slide_color);
2390                }
2391                opened = false;
2392                $('.logo_only_sticky .header_wrapper #logo').css('opacity', 0).css('visibility', 'hidden');
2393
2394            }
2395
2396
2397
2398
2399        });
2400
2401        $(window).resize(function() {
2402            $window_width = $(this).width();
2403            if ($window_width < 980) {
2404                $('body').removeClass('sticky_header');
2405                $('.header_wrapper').removeClass('open').css('position', position);
2406                opened = false;
2407            }
2408        });
2409    }
2410
2411    /* ----------------------------- End Sticky Nav -------------------------- */
2412
2413
2414
2415    /* ----------------------------- Blog Infinite Scroll -------------------- */
2416    function simpleBlogInfiniteScroll() {
2417        "use strict";
2418        var container = '#posts_container';
2419        var behavior = '';
2420        if ($('#blogmasonry').length > 0) {
2421            container = '#blogmasonry .filterable';
2422            behavior = 'masonry_blog';
2423        } else
2424            container = '#posts_container';
2425
2426        $(container).infinitescroll({
2427
2428            navSelector: "div.p_pagination",
2429            // selector for the paged navigation (it will be hidden)
2430            nextSelector: "div.p_pagination a.next_link",
2431            // selector for the NEXT link (to page 2)
2432            itemSelector: "#posts_container article.post",
2433            // selector for all items you'll retrieve
2434            animate: true,
2435
2436            loading: {
2437                img: '',
2438                msgText: ''
2439            },
2440
2441            behavior: behavior
2442        });
2443
2444        simple_blogmasonry();
2445
2446
2447    }
2448    /* ----------------------------- End Blog Infinite Scroll ---------------- */
2449
2450    /* ----------------------------- Portfolio Infinite Scroll -------------------- */
2451    function simplePortfolioInfiniteScroll() {
2452        "use strict";
2453        var container = '.masonry';
2454        var behavior = '';
2455
2456
2457        $(container).infinitescroll({
2458
2459                navSelector: "div.p_pagination",
2460                // selector for the paged navigation (it will be hidden)
2461                nextSelector: "div.p_pagination a.next_link",
2462                // selector for the NEXT link (to page 2)
2463                itemSelector: "#portfolio-preview-items .portfolio-item",
2464                // selector for all items you'll retrieve
2465                animate: true,
2466
2467                loading: {
2468                    img: '',
2469                    msgText: ''
2470                },
2471
2472                behavior: behavior
2473            },
2474
2475            function(arrayOfNewElems) {
2476                simplePortfolioInGrid();
2477
2478            }
2479
2480        );
2481        simplePortfolioPageIsotope();
2482
2483        //s();
2484
2485
2486    }
2487    /* ----------------------------- End Portfolio Infinite Scroll ---------------- */
2488
2489    /* ----------------------------- Page transition --------------------------*/
2490    function simplePageTransition() {
2491        "use strict";
2492
2493        $(".animsition").animsition({
2494            inClass: $(this).data('animsition-in-class'),
2495            outClass: $(this).data('animsition-out-class'),
2496            inDuration: $(this).data('animsition-in-duration'),
2497            outDuration: $(this).data('animsition-out-duration'),
2498            linkElement: 'a:not([target="_blank"]):not([href^="#"]):not(.lightbox-gallery):not(.zoom)'
2499
2500
2501
2502        });
2503    }
2504    /*------------------------------ Side menu Responsive Init ------------------------ */
2505    $(window).on('load resize ready', function() {
2506        "use strict";
2507        $window_width = $(window).width();
2508        if ($window_width <= 1024) {
2509            $("#snapcontent").addClass('snap-content');
2510        }
2511        if ($window_width > 1024) {
2512            $("#snapcontent").removeClass('snap-content');
2513        }
2514
2515
2516        if ($(window).width() <= 1024) {
2517
2518            loadDependencies([s_gb.theme_js + 'snap.min.js'], function() {
2519                var snapper = new Snap({
2520                    element: document.getElementById('snapcontent'),
2521                    disable: 'right',
2522                    maxPosition: 240,
2523                });
2524
2525                var myToggleButton = document.getElementById('open-left');
2526                myToggleButton.addEventListener('click', function() {
2527
2528                    if (snapper.state().state == "left") {
2529                        snapper.close();
2530                    } else {
2531                        snapper.open('left');
2532                    }
2533                });
2534                $(".close-sidebar").on('click', function() {
2535                    if (snapper.state().state == "left")
2536                        snapper.close();
2537                });
2538            });
2539        }
2540        $('.snap_left_content .menu-small ul li:not(.menu-item-has-children), .snap_left_content .menu-small ul li ul li').on('click', function() {
2541            return true;
2542        });
2543
2544        $('.snap_left_content .menu-small > ul > li.menu-item-has-children > a').on('click', function() {
2545
2546            $('.snap_left_content .menu-small > ul > li.menu-item-has-children > a').not($(this)).parent().find(".sub-menu").removeClass('open');
2547            //$('.snap_left_content .menu-small ul li.menu-item-has-children').not(this).removeClass('open');
2548            $(this).parent().find('.sub-menu').toggleClass('open');
2549
2550            return false;
2551        });
2552
2553    });
2554
2555    /*------------------------------ Online Functions ------------------------ */
2556    function simpleOnlineFunctions() {
2557        "use strict";
2558
2559        if ($('.sidebar_right #blogmasonry').hasClass('cols3'))
2560            $('.sidebar_right #blogmasonry').removeClass('cols3').addClass('cols2');
2561
2562        if ($window_width <= 768) {
2563
2564            $('.wpb_column.vc_col-sm-12').each(function() {
2565                var classList = $(this).attr('class').split(/\s+/);
2566                $(this).removeClass(classList[classList.length - 1]);
2567            });
2568
2569        }
2570    }
2571
2572
2573    function simpleSVGServices() {
2574        if ($('.services_medium .icon-svg').length > 0) {
2575            $('.services_medium .icon-svg').each(function() {
2576                var $this = $(this);
2577
2578                loadDependencies([s_gb.theme_js + 'vivus.js'], function() {
2579                    var link = $this.data('link');
2580                    var color = $this.data('color')
2581                    var id = $this.attr('id');
2582
2583                    new Vivus(id, {
2584                        duration: 50,
2585                        file: link,
2586                        onReady: function(mySVG) {
2587                            mySVG.el.setAttribute('stroke', color);
2588                        }
2589                    });
2590                });
2591            });
2592        }
2593
2594    }
2595
2596    /*-----------------------Google map disable zoom on scroll----------------------*/
2597    function simpleDisableMapZoom() {
2598        "use strict";
2599        // Disable scroll zooming and bind back the click event
2600        var onMapMouseleaveHandler = function(event) {
2601            var that = $(this);
2602
2603            that.on('click', onMapClickHandler);
2604            that.off('mouseleave', onMapMouseleaveHandler);
2605            that.find('iframe.googlemap').css("pointer-events", "none");
2606        }
2607
2608        var onMapClickHandler = function(event) {
2609            var that = $(this);
2610
2611            // Disable the click handler until the user leaves the map area
2612            that.off('click', onMapClickHandler);
2613
2614            // Enable scrolling zoom
2615            that.find('iframe.googlemap').css("pointer-events", "auto");
2616
2617            // Handle the mouse leave event
2618            that.on('mouseleave', onMapMouseleaveHandler);
2619        }
2620
2621        // Enable map zooming with mouse scroll when the user clicks the map
2622        $('.row-google-map').on('click', onMapClickHandler);
2623    }
2624
2625    /*------------------------------ In Grid portfolio filter ------------------------ */
2626
2627
2628    function simplePortfolioInGrid() {
2629        "use strict";
2630        //$('#portfolio-preview-items .portfolio-item  img').on("load", function(){
2631        if ($('.page-template-portfolio .portfolio-item .filter-row').hasClass('in_grid')) {
2632            var height_filter = $('.portfolio-item:nth-child(2)').innerHeight();
2633            $('.filter-row.in_grid').css('height', height_filter + 'px');
2634        }
2635        //});
2636
2637
2638    }
2639
2640    /* ----------------------------- Portfolio Project Bar -------------------------- */
2641
2642    function simpleProjectBar() {
2643        "use strict";
2644        setTimeout(function() {
2645
2646
2647            $('.content_portfolio .normal .grayscale, .content_portfolio .no_space .grayscale, .recent_portfolio .grayscale').find('.project').each(function() {
2648
2649                var box_width = parseFloat($(this).prev().innerWidth());
2650                var project_box = box_width - 20;
2651                $(this).css('width', parseInt(project_box));
2652            });
2653        }, 500);
2654
2655    }
2656
2657    function simpleScrollToTop() {
2658        "use strict";
2659        $(window).scroll(function() {
2660            var top = $(this).scrollTop();
2661            if (top > 600) {
2662                $('.scrollup').css('display', 'block');
2663            } else {
2664                $('.scrollup').css('display', 'none');
2665            }
2666        });
2667    }
2668
2669    function simple404() {
2670        "use strict";
2671        var height = $(window).height();
2672        $('.error404 section').css('height', height + 'px');
2673
2674    }
2675
2676    /* ----------------------------- SINGLE PORTFOLIO FLOATING----------------- */
2677
2678    function simple_headingWithLine() {
2679        "use strict";
2680        var $heading = $(".block_title.section_title.inner-square, .block_title.column_title.inner-inline_border_circle"),
2681            $window = $(window),
2682            offset = $heading.offset();
2683        var topPadding = 150;
2684
2685
2686        $heading.each(function() {
2687            var $thisheading = $(this);
2688
2689            var offset = $thisheading.offset();
2690            $window.scroll(function() {
2691                if ($window.scrollTop() + 450 > offset.top) {
2692                    $thisheading.find('.divider .line').addClass('appeared');
2693                }
2694
2695            });
2696
2697        });
2698    }
2699    /*--------------------Simple Hoverex -------------------------------------*/
2700
2701    /*
2702     *  jQuery HoverEx Script
2703     *  by hkeyjun
2704     *   http://codecanyon.net/user/hkeyjun 
2705     */
2706    ;
2707    (function($) {
2708        var HoverEx = {
2709            fn: {
2710                moveZoom: function(obj, e) {
2711                    var h = obj.height(),
2712                        w = obj.width(),
2713                        t = e.pageY - obj.offset().top,
2714                        l = e.pageX - obj.offset().left;
2715                    var $largeImg = obj.find("img");
2716                    var dataZoom = obj.data("zoom");
2717                    if (dataZoom && dataZoom != "auto") {
2718                        var zoomNum = parseFloat(dataZoom);
2719                        $largeImg.css({ "width": w * zoomNum + "px", "height": h * zoomNum + "px", "top": -t * (zoomNum - 1) + "px", "left": -l * (zoomNum - 1) + "px" });
2720                    } else {
2721                        var zoomNum = $largeImg.width() / w;
2722                        $largeImg.css({ "top": -t * (zoomNum - 1) + "px", "left": -l * (zoomNum - 1) + "px" });
2723                    }
2724                },
2725                changeZoom: function(obj, e, delta, deltaX, deltaY) {
2726                    var $largeImg = obj.find("img");
2727                    var currentZoom = obj.data("zoom");
2728                    currentZoom = currentZoom == "auto" ? $largeImg.width() / obj.width() : parseFloat(currentZoom);
2729                    var zoomStep = obj.data("zoomstep");
2730                    zoomStep = zoomStep ? parseFloat(zoomStep) : 0.5;
2731                    var zoomRange = obj.data("zoomrange");
2732                    zoomRange = zoomRange ? zoomRange.split(",") : "1,4";
2733                    var zoomMin = parseFloat(zoomRange[0]),
2734                        zoomMax = parseFloat(zoomRange[1]) > currentZoom ? parseFloat(zoomRange[1]) : currentZoom;
2735                    var op = deltaY > 0 ? 1 : -1;
2736                    var nextZoom = Math.round((currentZoom + zoomStep * op) * 10) / 10.0;
2737                    if (nextZoom >= zoomMin && nextZoom <= zoomMax) {
2738                        obj.data("zoom", nextZoom);
2739                        HoverEx.fn.showZoomState(obj, nextZoom);
2740                        HoverEx.fn.moveZoom(obj, e);
2741                    }
2742
2743                },
2744                showZoomState: function(obj, state) {
2745                    var $zoomState = obj.find(".he-zoomstate");
2746                    if ($zoomState.length == 0) {
2747                        $zoomState = $('<span class="he-zoomstate">' + state + 'X</span>').appendTo(obj);
2748                    }
2749                    $zoomState.text(state + "X").stop(true, true).fadeIn(300).delay(200).fadeOut(300);
2750                },
2751                switchImg: function(slider, type) {
2752                    var animation = slider.data("animate");
2753                    animation = animation ? animation : "random";
2754                    if (animation == "random") {
2755                        var animations = ["fadeIn", "fadeInLeft", "fadeInRight", "fadeInUp", "fadeInDown", "rotateIn", "rotateInLeft", "rotateInRight", "rotateInUp", "rotateInDown", "bounce", "bounceInLeft", "bounceInRight", "bounceInUp", "bounceInDown", "elasticInLeft", "elasticInRight", "elasticInUp", "elasticInDown", "zoomIn", "zoomInLeft", "zoomInRight", "zoomInUp", "zoomInDown", "jellyInLeft", "jellyInRight", "jellyInDown", "jellyInUp", "flipInLeft", "flipInRight", "flipInUp", "flipInDown", "flipInV", "flipInH"];
2756                        animation = animations[Math.floor(Math.random() * animations.length)];
2757                    }
2758                    var $imgs = slider.find("img");
2759                    if ($imgs.length > 1) {
2760                        if (type > 0) {
2761                            $imgs.eq(0).attr("class", "a0").appendTo(slider);
2762                            $imgs.eq(1).attr("class", "a0 " + animation);
2763                        } else {
2764                            $imgs.eq($imgs.length - 1).attr("class", "a0 " + animation).prependTo(slider);
2765                            $imgs.eq(0).attr("class", "a0");
2766                        }
2767                    }
2768                }
2769            }
2770        };
2771
2772        $(function() {
2773            $(".he-wrap").on({
2774                mouseenter: function() {
2775                    var $view = $(this).find(".he-view").addClass("he-view-show");
2776                    $("[data-animate]", $view).each(function() {
2777                        var animate = $(this).data("animate");
2778                        $(this).addClass(animate);
2779                    });
2780                    $(this).find(".he-zoom").addClass("he-view-show");
2781                },
2782                mouseleave: function() {
2783                    var $view = $(this).find(".he-view").removeClass("he-view-show");
2784                    $("[data-animate]", $view).each(function() {
2785                        var animate = $(this).data("animate");
2786                        $(this).removeClass(animate);
2787                    });
2788                    $(this).find(".he-zoom").removeClass("he-view-show");
2789                },
2790                mousewheel: function(e, delta, deltaX, deltaY) {
2791                    if ($(this).find(".he-sliders").length == 1) {
2792                        var $slider = $(this).find(".he-sliders");
2793                        var op = deltaY > 0 ? 1 : -1;
2794                        HoverEx.fn.switchImg($slider, op);
2795                        e.preventDefault();
2796                    } else if ($(this).find(".he-zoom").length == 1) {
2797                        var $zoom = $(this).find(".he-zoom");
2798                        HoverEx.fn.changeZoom($zoom, e, delta, deltaX, deltaY);
2799                        e.preventDefault();
2800                    }
2801                }
2802            });
2803            $(".he-zoom").on({
2804                mousemove: function(e) {
2805                    HoverEx.fn.moveZoom($(this), e);
2806                }
2807            });
2808            $(".he-pre").on("click", function() {
2809                var $slider = $(this).parents(".he-wrap").find(".he-sliders");
2810                HoverEx.fn.switchImg($slider, -1);
2811            });
2812            $(".he-next").on("click", function() {
2813                var $slider = $(this).parents(".he-wrap").find(".he-sliders");
2814                HoverEx.fn.switchImg($slider, 1);
2815            });
2816
2817        });
2818    })(jQuery);
2819
2820    /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
2821     * Licensed under the MIT License (LICENSE.txt).
2822     *
2823     * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
2824     * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
2825     * Thanks to: Seamus Leahy for adding deltaX and deltaY
2826     *
2827     * Version: 3.0.6
2828     * 
2829     * Requires: 1.2.2+
2830     */
2831
2832    (function($) {
2833
2834        var types = ['DOMMouseScroll'];
2835
2836        if ($.event.fixHooks) {
2837            for (var i = types.length; i;) {
2838                $.event.fixHooks[types[--i]] = $.event.mouseHooks;
2839            }
2840        }
2841
2842        $.event.special.mousewheel = {
2843            setup: function() {
2844                if (this.addEventListener) {
2845                    for (var i = types.length; i;) {
2846                        this.addEventListener(types[--i], handler, false);
2847                    }
2848                } else {
2849                    this.onmousewheel = handler;
2850                }
2851            },
2852
2853            teardown: function() {
2854                if (this.removeEventListener) {
2855                    for (var i = types.length; i;) {
2856                        this.removeEventListener(types[--i], handler, false);
2857                    }
2858                } else {
2859                    this.onmousewheel = null;
2860                }
2861            }
2862        };
2863
2864        $.fn.extend({
2865            mousewheel: function(fn) {
2866                return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
2867            },
2868
2869            unmousewheel: function(fn) {
2870                return this.unbind("mousewheel", fn);
2871            }
2872        });
2873
2874
2875        function handler(event) {
2876            var orgEvent = event || window.event,
2877                args = [].slice.call(arguments, 1),
2878                delta = 0,
2879                returnValue = true,
2880                deltaX = 0,
2881                deltaY = 0;
2882            event = $.event.fix(orgEvent);
2883            event.type = "mousewheel";
2884
2885            // Old school scrollwheel delta
2886            if (orgEvent.wheelDelta) { delta = orgEvent.wheelDelta / 120; }
2887            if (orgEvent.detail) { delta = -orgEvent.detail / 3; }
2888
2889            // New school multidimensional scroll (touchpads) deltas
2890            deltaY = delta;
2891
2892            // Gecko
2893            if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
2894                deltaY = 0;
2895                deltaX = -1 * delta;
2896            }
2897
2898            // Webkit
2899            if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
2900            if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }
2901
2902            // Add event and delta to the front of the arguments
2903            args.unshift(event, delta, deltaX, deltaY);
2904
2905            return ($.event.dispatch || $.event.handle).apply(this, args);
2906        }
2907
2908    })(jQuery);
2909
2910    /*--------------------------------------------------------------------------------------------------------------------------*/

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.