PageSourceSearch

https://politicalnetworkforvalues.org/wp-content/themes/philanthropy-parent/js/general.js?ver=2.0.19

js politicalnetworkforvalues.org collected 2026-10-02 10:20:18 UTC 51,395 bytes, 1,293 lines download raw bytes

1jQuery(document).ready(function ($) {
2    "use strict";
3
4    var $ = jQuery,
5        screenRes = $(window).width(),
6        screenHeight = $(window).height(),
7        innerScreenRes = window.innerWidth, // Screen size width minus scrollbar width
8        html = $('html');
9
10    // Disable Empty Links
11    $('a[href="#"]').click(function (event) {
12        event.preventDefault();
13    });
14
15    // Remove outline in IE
16    $("a, input, textarea").attr("hideFocus", "true").css("outline", "none");
17
18    // selectize control input
19    Selectize.define('selectize_control_input', function(options) {
20        var self = this;
21        this.showInput = function() {
22            this.$control.css({cursor: 'pointer'});
23            this.$control_input.css({opacity: 0, position: 'relative', left: self.rtl ? 10000 : -10000 });
24            this.isInputHidden = false;
25        };
26
27        this.setup_original = this.setup;
28
29        this.setup = function() {
30            self.setup_original();
31            this.$control_input.prop("disabled","disabled");
32        }
33    });
34
35    var selectize_selectors = '.fw-contact-form .select-field, select[name="archive-dropdown"], select[name="cat"], select[name="monster-widget-just-testing"], .fw-search-filter-off .woocommerce-ordering .orderby, .dropdown_product_cat, select.country_select, select.state_select, #calc_shipping_country, .bbpress select:not("#theme"), .buddypress select:not("#theme"), .wpcf7-select, .llms-field-select, .mc4wp-form .mc4wp-form-fields select, .gform_wrapper select:not(.ginput_card_expiration)';
36    if( screenRes < 1025 ) {
37        $(selectize_selectors).selectize({
38            create: true,
39            allowEmptyOption: true,
40            plugins: ['selectize_control_input']
41        });
42    }
43    else {
44        $(selectize_selectors).selectize({
45            create: true,
46            allowEmptyOption: true
47        });
48    }
49
50    // Woocommerce if the country has regions (ex. USA)
51    if( $('#billing_state_field').length > 0 && typeof wc_country_select_params !== 'undefined' ) {
52        var states_json = wc_country_select_params.countries.replace( /&quot;/g, '"' ),
53            states = $.parseJSON( states_json );
54        $( document.body ).on( 'change', 'select.country_to_state, input.country_to_state', function() {
55            var country = $(this).val();
56
57            if (states[country]) {
58                // is select
59                if ($.isEmptyObject(states[country])) {
60                    // has no state
61                }
62                else {
63                    $('#billing_state_field select.state_select').selectize({
64                        create: true,
65                        allowEmptyOption: true
66                    });
67                }
68            }
69            else {
70                // is input
71                $('#billing_state_field .selectize-control').remove();
72            }
73        });
74    }
75
76    start_carousel_portfolio_filter();
77
78    // ContactForm7 preppend label for acceptance checkbox
79    if($('.wpcf7-form').length > 0) {
80        $('input.wpcf7-acceptance').wrap('<span class="wpcf7-list-item"></span>').parent().prepend('<span class="wpcf7-list-item-label acceptance-check"></span>');
81    }
82
83    if ($(".input-styled, #ship-to-different-address, .inputs, .create-account, .inline, .bbp_widget_login .bbp-remember-me, .bbpress, .forgetmenot, .buddypress, .give-form-wrap, .wpcf7-form, .mc4wp-form, .gform_wrapper").length) {
84        $(".input-styled input, #ship-to-different-address input, .inputs input[type='radio'], .inputs input[type='checkbox'], .create-account input, .inline #rememberme, .bbp-remember-me #rememberme, .bbpress input[type='radio'], .bbpress input[type='checkbox'], .forgetmenot #bp-login-widget-rememberme, .buddypress input[type='checkbox'], .buddypress input[type='radio'], .give-form-wrap input[type='radio'], .wpcf7 input[type='checkbox'], .wpcf7 input[type='radio'], .mc4wp-form input[type='radio'], .mc4wp-form input[type='checkbox'], .gform_wrapper input[type='radio'], .gform_wrapper input[type='checkbox']").customInput();
85    }
86
87    // prettyPhoto lightbox, check if <a> has atrr data-rel and hide for Mobiles
88    start_prettyphoto();
89
90    // Remove background cart
91    jQuery('.shop_table.cart').parent('form').css({
92        'background-color': 'transparent',
93        'padding': '0'
94    });
95
96    // Set width for divider on pagination type 2
97    function widthDividerPostPagination2 (){
98        var paginationContainerWidth = jQuery('.paging-navigation-type-2').outerWidth()/2,
99            buttonPrevWidth = jQuery('.paging-navigation-type-2 .prev').outerWidth(),
100            buttonNextWidth = jQuery('.paging-navigation-type-2 .next').outerWidth(),
101            numbersWrap = jQuery('.paging-navigation-type-2 .pagination-numbers-wrap').outerWidth()/2;
102
103        jQuery('.paging-navigation-type-2 .before-hr').css({
104            'width': paginationContainerWidth - numbersWrap - buttonPrevWidth,
105            'left':  buttonPrevWidth
106        });
107        jQuery('.paging-navigation-type-2 .after-hr').css({
108            'width': paginationContainerWidth - numbersWrap - buttonNextWidth,
109            'right': buttonNextWidth
110        });
111    }
112    if(jQuery('.paging-navigation.paging-navigation-type-2').length > 0){
113        widthDividerPostPagination2();
114        $(window).resize(function(){ widthDividerPostPagination2(); });
115    }
116
117    // Show more events
118    $('.fw-show-more-events').on('click', function () {
119        if ($(this).hasClass('closed')) {
120            $(this).removeClass('closed').addClass('open');
121            $('.fw-more-events-content').slideDown(800);
122        }
123        else {
124            $(this).removeClass('open').addClass('closed');
125            $('.fw-more-events-content').slideUp(800);
126        }
127    });
128
129    //Iframe Serponsive
130    function adjustIframes() {
131        $('iframe').each(function () {
132            var $this = $(this),
133                proportion = $this.data('proportion'),
134                w = $this.attr('width'),
135                actual_w = $this.width();
136
137            if (!proportion) {
138                proportion = $this.attr('height') / w;
139                $this.data('proportion', proportion);
140            }
141
142            if (actual_w != w) {
143                $this.css('height', Math.round(actual_w * proportion) + 'px');
144            }
145        });
146    }
147    $(window).on('resize load', adjustIframes);
148
149    // Detect Click in Iframe
150    function detectIframeClick() {
151        var overiFrame = -1;
152        jQuery('.myCarousel').find('iframe').hover(function () {
153            overiFrame = 1;
154        }, function () {
155            overiFrame = -1
156        });
157        $(window).on('blur', function () {
158            if (overiFrame != -1) {
159                jQuery('.myCarousel').carousel('pause');
160            }
161        });
162        jQuery('.carousel-control, .carousel-indicators li').click(function () {
163            jQuery('.myCarousel').carousel('cycle');
164        });
165    }
166    detectIframeClick();
167
168    // Smooth Scroling of ID anchors
169    function filterPath(string) {
170        return string
171            .replace(/^\//, '')
172            .replace(/(index|default).[a-zA-Z]{3,4}$/, '')
173            .replace(/\/$/, '');
174    }
175
176    var locationPath = filterPath(location.pathname);
177    var scrollElem = scrollableElement('html', 'body');
178
179    function anchorFn(argument) {
180        var HeaderHeightNormal = 0,
181            HeaderHeightSticky = 0;
182
183        $('.anchor a[href*="#"], a[href*="#"].anchor').each(function () {
184            $(this).click(function (event) {
185                // only if is sticky header calculate the headers height for know the offset, in other case the header height is 0
186                if( $(this).parents('body.fw-header-sticky').find('.fw-sticky-menu').length > 0 && screenRes > 767 ) {
187                    HeaderHeightSticky = $('.fw-header.fw-sticky-menu').height(); // Sticky header height
188
189                    var HeaderHeight = HeaderHeightSticky;
190                }
191                else {
192                    var HeaderHeight = HeaderHeightNormal;
193                }
194
195                var thisPath = filterPath(this.pathname) || locationPath;
196                if (locationPath == thisPath
197                    && (location.hostname == this.hostname || !this.hostname)
198                    && this.hash.replace(/#/, '')) {
199                    var $target = $(this.hash), target = this.hash;
200                    if (target && $target.length != 0) {
201                        var targetOffset = $target.offset().top - HeaderHeight;
202                        event.preventDefault();
203                        $(scrollElem).animate({scrollTop: targetOffset}, 400);
204                        if( 'false' == FwPhpVars.disable_anchor_id ) {
205                            setTimeout( function(){
206                                location.hash = target;
207                            }, 300 );
208                        }
209                    }
210                }
211            });
212        });
213    }
214
215    // Scroll To Top Button
216    $(window).on('scroll', function() {
217        if(jQuery('.scroll-to-top').length > 0){
218            if(parseInt($(window).scrollTop(), 10) > 600){
219                jQuery('.scroll-to-top').fadeIn(500);
220            }
221            else {
222                jQuery('.scroll-to-top').fadeOut(500);
223            }
224        }
225    });
226
227    // use the first element that is "scrollable"
228    function scrollableElement(els) {
229        for (var i = 0, argLength = arguments.length; i < argLength; i++) {
230            var el = arguments[i],
231                $scrollElement = $(el);
232            if ($scrollElement.scrollTop() > 0) {
233                return el;
234            } else {
235                $scrollElement.scrollTop(1);
236                var isScrollable = $scrollElement.scrollTop() > 0;
237                $scrollElement.scrollTop(0);
238                if (isScrollable) {
239                    return el;
240                }
241            }
242        }
243        return [];
244    }
245
246    // Header Type 5 (close & open Menu)
247    if(jQuery('.header-5').length > 0) {
248        var $headerMenu5 = jQuery('#header-menu');
249
250        $headerMenu5.find('.mega-menu-col').each( function(){
251            var megaMenuCol = $(this);
252            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
253
254            $('.linkBlank').each(function() {
255                var linkBlank = $(this);
256                if(linkBlank.children().length === 1) {
257                    linkBlank.addClass('removeItem');
258                    linkBlank.parent().addClass('removeItem')
259                }
260            });
261            $('ul.removeItem').each(function() {
262                var removeItem = $(this);
263                removeItem.find('li.removeItem').remove();
264                removeItem.children().length === 0 ? removeItem.remove() : null;
265            });
266        });
267        $('.linkBlank').removeClass('linkBlank');
268        $('.removeItem').removeClass('removeItem');
269
270
271        // Create Menu
272        $headerMenu5.mmenu({
273            extensions: [
274                "pageshadow",
275                FwPhpVars.effect_panels,
276                FwPhpVars.effect_listitems_slide
277            ],
278            offCanvas	: {
279                position 	: FwPhpVars.header_5_position,
280                zposition	: "front"
281            }
282        });
283
284        // Prepend Close Button
285        jQuery('#header-menu.mm-menu').prepend('<a href="#" class="fw-close-menu-header5"><i class="mm-close"></i></a>');
286
287        // Change Position for .mm-next when menu is aligned center
288        if(jQuery('.header-align-center').length > 0){
289            jQuery('.mm-listview .menu-item a.mm-next').each(function(){
290                $(this).appendTo($(this).parent());
291                $(this).parents('.mm-panel').addClass('fw-list-has-children');
292            });
293        }
294
295        // Add keyword "Back" in back button
296        jQuery('.mm-btn.mm-prev').html('<span>'+FwPhpVars.back+'</span>');
297
298        // Close the menu, click the close button('X')
299        var API = $headerMenu5.data("mmenu");
300        $headerMenu5.find('.fw-close-menu-header5').click(function() {
301            API.close();
302        });
303
304        // Add class "video-panel" if bg video is set, add class "wallpaper" in header nav
305        if( $headerMenu5.is("[data-background-options]") ) {
306            jQuery('.fw-menu-open').on('click', function() {
307                $headerMenu5.background();
308            });
309        }
310    }
311
312    // Header Type 6
313    if(jQuery('.header-6').length > 0) {
314        // Copy Logo HTML and insert in clone
315        var logoHTML = jQuery('.fw-header-main .fw-wrap-logo');
316
317        // Create New Menu
318        var $headerMenu = jQuery('#header-menu');
319
320        // Remove link if is blank
321        $headerMenu.find('.mega-menu-col').each( function(){
322            var megaMenuCol = $(this);
323            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
324
325            $('.linkBlank').each(function() {
326                var linkBlank = $(this);
327                if(linkBlank.children().length === 1) {
328                    linkBlank.addClass('removeItem');
329                    linkBlank.parent().addClass('removeItem')
330                }
331            });
332            $('ul.removeItem').each(function() {
333                var removeItem = $(this);
334                removeItem.find('li.removeItem').remove();
335                removeItem.children().length === 0 ? removeItem.remove() : null;
336            });
337        });
338        $('.linkBlank').removeClass('linkBlank');
339        $('.removeItem').removeClass('removeItem');
340
341        // Create Menu
342        $headerMenu.mmenu({
343            navbars: [{
344                content: [ logoHTML ]
345            },
346                {
347                    position: "bottom",
348                    content: [ FwPhpVars.socials ]
349                }
350            ],
351            extensions: [
352                "widescreen",
353                FwPhpVars.effect_panels
354            ],
355            offCanvas: {
356                position: FwPhpVars.header_6_position
357            }
358        });
359
360        // Calculate logo height and add top position to menu
361        if ( logoHTML.find('img').attr('src') == undefined ) {
362            // if logo is text
363            var logoHeight = jQuery('.fw-wrap-logo').parent().outerHeight(), // Find height for a parent, because user possibility adds additional padding. And for this cause height for the logo doesn't correctly calculate.
364                mmPanels   = jQuery('.mm-panels');
365
366            mmPanels.css({
367                top: logoHeight + 20
368            });
369        }
370        else {
371            var logoImg = new Image();
372            logoImg.src = logoHTML.find('img').attr('src');
373            logoImg.onload = function () {
374                var logoHeight = jQuery('.fw-wrap-logo').outerHeight(),
375                    mmPanels   = jQuery('.mm-panels');
376
377                mmPanels.css({
378                    top: logoHeight + 20
379                });
380            };
381        }
382
383        // Add keyword "Back" in back button
384        jQuery('.mm-btn.mm-prev').html('<span>'+FwPhpVars.back+'</span>');
385
386        // Change Position for .mm-next when menu is aligned left & center
387        if(jQuery('.header-item-align-left, .header-item-align-center').length > 0){
388            jQuery('.mm-listview .menu-item a.mm-next').each(function(){
389                $(this).appendTo($(this).parent());
390                $(this).parents('.mm-panel').addClass('fw-list-has-children');
391            });
392        }
393
394        // Add search in menu if search it is positioned in menu
395        if(jQuery('.search-in-menu').length > 0){
396            var searchHtml = jQuery('.fw-search'),
397                fullSearchHtml = jQuery('.fw-wrap-search-form.fw-form-search-full');
398
399            $headerMenu.children().children('.mm-panel').append(searchHtml);
400            $headerMenu.append(fullSearchHtml);
401        }
402        else if(jQuery('.search-in-top-bar .fw-wrap-search-form.fw-form-search-full').length > 0){
403            fullSearchHtml = jQuery('.fw-wrap-search-form.fw-form-search-full');
404            $headerMenu.append(fullSearchHtml);
405        }
406
407        // Close the menu, click the close button('X')
408        var API = $headerMenu.data("mmenu");
409        $headerMenu.find('.fw-menu-open').click(function() {
410            API.close();
411        });
412        if(screenRes < 1200) {
413            jQuery('.site').click(function(){
414                API.close();
415            });
416        }
417    }
418
419    // Responsive Menu (Mobile Menu for header type 1 -> 4)
420    var Mobile_Menu = function () {
421        var $menu = jQuery('#mobile-menu'),
422            navPosition = 'bottom';
423
424        $menu.find('.mega-menu-col').each( function(){
425            var megaMenuCol = $(this);
426            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
427
428            $('.linkBlank').each(function() {
429                var linkBlank = $(this);
430                if(linkBlank.children().length === 1) {
431                    linkBlank.addClass('removeItem');
432                    linkBlank.parent().addClass('removeItem')
433                }
434            });
435            $('ul.removeItem').each(function() {
436                var removeItem = $(this);
437                removeItem.find('li.removeItem').remove();
438                removeItem.children().length === 0 ? removeItem.remove() : null;
439            });
440        });
441        $('.linkBlank').removeClass('linkBlank');
442        $('.removeItem').removeClass('removeItem');
443
444        // If social variables is empty change nav position
445        if(FwPhpVars.socials === ''){
446            navPosition = 'top';
447        }
448
449        // Create menu
450        $menu.mmenu({
451            counters: true,
452            extensions: [
453                "theme-dark",
454                FwPhpVars.effect_panels,
455                FwPhpVars.mobile_menu_page_dim,
456                FwPhpVars.mobile_menu_border_style
457            ],
458            navbar: {
459                title: FwPhpVars.mmenu_title
460            },
461            navbars : [
462                {
463                    "add": false,
464                    "position": navPosition,
465                    "content": [ FwPhpVars.socials ]
466                }
467            ],
468            offCanvas: {
469                position: FwPhpVars.mobile_menu_position
470            }
471        }, {
472            classNames: {
473                selected: "current-menu-item"
474            }
475        });
476
477        // Change Position for .mm-next & counter when menu is aligned center
478        if(jQuery('.mobile-menu-item-align-center').length > 0){
479            jQuery('.mm-listview .menu-item a.mm-next').each(function(){
480                var mmCounter = $(this).parent().find('.mm-counter');
481                jQuery('<div class="mobile-menu-wrap-navigation"></div>').appendTo($(this).parent());
482
483                var mobileMenuWrapNavigation = $(this).parent().find('.mobile-menu-wrap-navigation');
484                mobileMenuWrapNavigation.append(mmCounter, $(this));
485            });
486        }
487
488        if( $menu.length == 0 ) {
489            return;
490        }
491
492        // Close menu to click on any item
493        var API = $menu.data( "mmenu" );
494        $menu.find('li.menu-item a:not(".mm-next")').click(function() {
495            API.close();
496        });
497
498        /**
499         * Add class to tag HTML for events 'Close & Open' because transition: transform for div 'mm-slideout',
500         * on iOS creates bug when you click back in browser. The page is not centered.
501        */
502        API.bind( "open", function() {
503            $menu.parents('html').addClass('mm-menu-event-open');
504        });
505        API.bind( "closed", function() {
506            $menu.parents('html').removeClass('mm-menu-event-open');
507        });
508    };
509    if (innerScreenRes <= FwPhpVars.mobile_menu_screen && $('.header-1, .header-2, .header-3, .header-4').length) {
510        Mobile_Menu();
511    }
512
513    $(window).on('resize', function(){
514        var innerScreenRes = window.innerWidth; // Screen size width minus scrollbar width
515        if(innerScreenRes <= FwPhpVars.mobile_menu_screen && $('.header-1, .header-2, .header-3, .header-4').length){
516            Mobile_Menu();
517        }
518    });
519
520    // Sticky Menu
521    if(jQuery('body.fw-header-sticky').length > 0 && screenRes > FwPhpVars.sticky_resolution) {
522        jQuery('.fw-header').clone().addClass('fw-sticky-menu').prependTo('div.site');
523
524
525        // Add sticky logo if this is add in sticky.
526        if(FwPhpVars.sticky_logo !== ''){
527            // Insert new sticky logo in menu
528            $('.fw-header.fw-sticky-menu .fw-wrap-logo').html(FwPhpVars.sticky_logo);
529
530            // Calculate position after logo image is loaded and just for header-1 & header-5.
531            if($('.header-1, .header-5').length) {
532                $('.header-1 .fw-sticky-menu, .header-5 .fw-sticky-menu').addClass('fw-header-sticky-new-logo');
533
534                var stickyLogoImg = new Image();
535                stickyLogoImg.src = $('.fw-header.fw-sticky-menu .fw-wrap-logo').find('img').attr('src');
536                stickyLogoImg.onload = function () {
537                    var logoHeight = jQuery('.fw-header.fw-sticky-menu .fw-wrap-logo').outerHeight(),
538                        menuHeight = parseInt($('.fw-header.fw-sticky-menu .fw-site-navigation > ul > li > a').css('line-height'), 10),
539                        searchHeight = $('.fw-header.fw-sticky-menu .fw-search').outerHeight(),
540                        mobileMenuIconOpen = $('.fw-header.fw-sticky-menu .mmenu-link').outerHeight(),
541                        mobileMenuIconOpenHeader5 = $('.header-5 .fw-header.fw-sticky-menu .fw-nav-wrap').outerHeight();
542
543                    // For Header 1
544                    if (logoHeight > menuHeight && $('.header-1').length) {
545                        $('.header-1 .fw-sticky-menu .primary-navigation').css({
546                            'margin-top': logoHeight / 2 - menuHeight / 2
547                        });
548                        $('.header-1 .fw-sticky-menu .fw-search').css({
549                            'margin-top': logoHeight / 2 - searchHeight / 2
550                        });
551                        $('.header-1 .fw-sticky-menu .mmenu-link').css({
552                            'margin-top': logoHeight / 2 - mobileMenuIconOpen / 2
553                        });
554                    }
555                    // For Header 5
556                    else if (logoHeight > mobileMenuIconOpenHeader5 && $('.header-5').length) {
557                        $('.header-5 .fw-sticky-menu .fw-search').css({
558                            'margin-top': logoHeight / 2 - searchHeight / 2
559                        });
560                        $('.header-5 .fw-sticky-menu .fw-nav-wrap').css({
561                            'margin-top': logoHeight / 2 - mobileMenuIconOpenHeader5 / 2
562                        });
563                    }
564                    // For Header 1
565                    else if (logoHeight <= menuHeight && $('.header-1').length) {
566                        $('.header-1 .fw-sticky-menu .fw-wrap-logo').css({
567                            'margin-top': menuHeight / 2 - logoHeight / 2
568                        });
569                        $('.header-1 .fw-sticky-menu .fw-search').css({
570                            'margin-top': menuHeight / 2 - searchHeight / 2
571                        });
572                        $('.header-1 .fw-sticky-menu .mmenu-link').css({
573                            'margin-top': menuHeight / 2 - mobileMenuIconOpen / 2
574                        });
575                    }
576                    // For Header 5
577                    else if (logoHeight <= mobileMenuIconOpenHeader5 && $('.header-5').length) {
578                        $('.header-5 .fw-sticky-menu .fw-wrap-logo').css({
579                            'margin-top': mobileMenuIconOpenHeader5 / 2 - logoHeight / 2
580                        });
581                        $('.header-5 .fw-sticky-menu .fw-search').css({
582                            'margin-top': mobileMenuIconOpenHeader5 / 2 - searchHeight / 2
583                        });
584                    }
585                };
586            }
587        }
588
589        var height_original_header = jQuery('header.fw-header').not('header.fw-header.fw-sticky-menu').outerHeight();
590
591        // make anchor form sticky menu with smooth scroll
592        anchorFn();
593
594        $(window).on('scroll', function () {
595            if(height_original_header > 300){
596                var intermediate_height = height_original_header + 250;
597            } else {
598                var intermediate_height = 400;
599            }
600
601            // add or remove class "fw-sticky-menu-open"
602            if ($(window).scrollTop() > intermediate_height) {
603                // Scroll Down
604                $('.fw-header.fw-sticky-menu').addClass('fw-sticky-menu-open');
605            } else {
606                // Scroll Up
607                $('.fw-header.fw-sticky-menu').removeClass('fw-sticky-menu-open');
608            }
609        });
610
611        // complete search form on keyup
612        jQuery('.fw-header .fw-search-form .fw-input-search').on("keyup", function() {
613            var search_input = jQuery(this).val();
614            jQuery('.fw-header .fw-search-form .fw-input-search').val(search_input);
615        });
616    }
617    else {
618        anchorFn();
619    }
620
621    // DropDown
622    if(screenRes > 1199){
623        jQuery(".fw-nav-menu li.menu-item-has-children").not("li.menu-item-has-mega-menu, .header-6 #header-menu.mm-menu .mm-listview li, .header-5 .mm-listview li").hover(function () {
624            var $this = $(this);
625            if ($this.find('.sub-menu')) {
626                var dropdown = $this.children('ul'),
627                    dropdownWidth = dropdown.outerWidth(),
628                    dropdownOffset = parseInt(dropdown.offset().left, 10);
629                if (dropdownWidth + dropdownOffset > screenRes) {
630                    dropdown.addClass('left');
631                }
632                else {
633                    dropdown.removeClass('left');
634                }
635            }
636        });
637    }
638    // Search Icon Button
639    var miniSearch = function () {
640        var container_menu_width = jQuery('.fw-header .fw-site-navigation, .header-5 .fw-header .fw-menu-open').parents('.fw-header-main').width()-15,
641            wrap_search_form = jQuery('.fw-wrap-search-form');
642
643        // Close the search form
644        jQuery('body').on('click', '.fw-close-search-form', function (event) {
645            event.preventDefault();
646            jQuery('.fw-wrap-search-form').slideUp(300, function () {
647                wrap_search_form.removeClass('opened');
648            });
649        });
650
651        jQuery('.fw-search-icon').click(function (event) {
652            event.preventDefault();
653
654            // No set height for search in header type 6
655            if(jQuery('.header-6').length < 1) {
656                var menu_height = jQuery('.fw-header-main').not('.fw-header.fw-sticky-menu .fw-header-main').outerHeight();
657                    wrap_search_form.css('height', menu_height);
658
659                // Set width for input
660                wrap_search_form.children('.fw-search-form').css({
661                    width: container_menu_width
662                });
663
664                // If topBar is enable
665                if (jQuery('.fw-top-bar-on').length > 0) {
666                    var topBar_height = jQuery('.fw-top-bar').outerHeight();
667
668                    wrap_search_form.css({
669                        top: topBar_height
670                    });
671                }
672                else {
673                    wrap_search_form.css({
674                        top: 0
675                    });
676                }
677
678                // If header is sticky
679                if (jQuery('.fw-header-sticky').length > 0) {
680                    var wrap_search_form_sticky = jQuery('.fw-header.fw-sticky-menu .fw-wrap-search-form'),
681                        menu_height_sticky = jQuery('.fw-header.fw-sticky-menu .fw-header-main').outerHeight();
682
683                    wrap_search_form_sticky.css('height', menu_height_sticky);
684                }
685            }
686
687            // Animation opened form
688            jQuery('.fw-wrap-search-form').slideDown(300, function () {
689                wrap_search_form.addClass('opened');
690            });
691
692            // Focus on sticky search if you click on icon in sticky menu
693            if(jQuery('.search-in-menu.fw-header-sticky .fw-sticky-menu.fw-sticky-menu-open').length > 0){
694                jQuery('.fw-header.fw-sticky-menu .fw-input-search').on('click').focus();
695            }
696            else{
697                jQuery('.fw-header .fw-input-search').on('click').focus();
698            }
699        });
700
701        // Close the search form if click outside
702        jQuery(document).mouseup(function (e) {
703            var container = jQuery('.fw-wrap-search-form.fw-form-search-full');
704
705            if (!container.is(e.target) // if the target of the click isn't the container...
706                && container.has(e.target).length === 0) // ... nor a descendant of the container
707            {
708                jQuery('.fw-wrap-search-form').slideUp(300, function () {
709                    wrap_search_form.removeClass('opened');
710                });
711            }
712        });
713
714        // First remove and append the close button for search form. Because to resize window first and only then to remove and to add button.
715        jQuery('.fw-close-search-form').remove();
716        jQuery('.fw-search-form').append('<a href="#" class="fw-close-search-form"><i class="fa fa-close"></i></a>');
717    };
718
719    if (jQuery('.fw-mini-search').length > 0) {
720        miniSearch();
721
722        jQuery(window).on('resize', function(){
723            miniSearch();
724        });
725    }
726
727    // Toggles
728    $('.toggle-link').click(function () {
729        $(this).parents('.toggle').removeClass('collapsed');
730
731        if (!$(this).hasClass('collapsed')) {
732            $(this).parents('.toggle').addClass('collapsed');
733        }
734    });
735
736    $(".opened").find(".panel-collapse").addClass("in");
737    $(".panel-toggle").click(function () {
738        $(this).closest(".toggleitem").toggleClass("opened");
739    });
740
741    // pricing
742    function tablePriceInit() {
743        $(".fw-price-table").each(function () {
744            var this_table_width = $(this).width();
745            var this_table_cols = $(this).children().size();
746            var this_col_width = (this_table_width / this_table_cols);
747
748            $(this).children(".fw-price-col").css('width', this_col_width - 1);
749
750            var table_col_height = 0;
751            var this_col_row = $(this).children().find(".fw-price-row, .fw-switch-row");
752            this_col_row.each(function () {
753                table_col_height = table_col_height > $(this).height() ? table_col_height : $(this).height();
754            });
755            this_col_row.each(function () {
756                $(this).height(table_col_height);
757            });
758        });
759    }
760
761    if ($('.fw-price-table').length) {
762        tablePriceInit();
763
764        $(window).on('resize', function () {
765            tablePriceInit();
766        });
767    }
768
769    // Icon Box Type 4 set z-index
770    if($('.fw-iconbox-4.fw-icon-right').length > 0) {
771        var iconDIv = $('.fw-iconbox-4.fw-icon-right');
772
773        iconDIv.each(function(){
774            var lengthCol = $(this).parents('.fw-row').children('div[class*="fw-col-"]').length,
775                z_index = 10 + lengthCol; // default col z-index & + col length in row
776
777            $(this).parents('.fw-row > div[class*="fw-col-"]').addClass('icon-box-z-index');
778
779            $(this).parents('.fw-row').children('div[class*="icon-box-z-index"]').each(function (col) {
780                $(this).css("z-index", z_index - col);
781            });
782        });
783    }
784
785    /**
786     * Mega Menu
787     */
788    jQuery(function ($) {
789
790        function leftSide(elem) {
791            return elem.offset().left;
792        }
793
794        function rightSide(elem) {
795            return elem.offset().left + elem.width();
796        }
797
798        function columns(mega) {
799            var columns = 0;
800            mega.children('.mega-menu-row').each(function () {
801                columns = Math.max(columns, $(this).children('.mega-menu-col').length);
802            });
803            return columns;
804        }
805
806        function megaMenu(megaMenuSelector) {
807            $(megaMenuSelector).each(function () {
808                var a = $(this);
809                var nav = a.closest('.fw-container');
810                var mega = a.find('.mega-menu');
811                var offset = rightSide(nav) - leftSide(a);
812                var col_width = 280 + 2; // 2px border left
813                var col_width2 = a.closest('.fw-container').width() / columns(mega);
814
815
816                if (columns(mega) < 4) {
817                    mega.width(Math.min(rightSide(nav), columns(mega) * col_width));
818                    mega.children('.mega-menu-row').each(function () {
819                        $(this).children('.mega-menu-col').css('width', col_width);
820                    });
821                } else {
822                    mega.width(Math.min(rightSide(nav), columns(mega) * col_width2));
823                    mega.children('.mega-menu-row').each(function () {
824                        $(this).children('.mega-menu-col').css('width', col_width2, 'important');
825                    });
826                }
827                mega.css('left', (Math.min(0, offset - mega.width())) + 15);
828            });
829        }
830
831        if($('.header-1, .header-2, .header-3, .header-4').length) {
832            megaMenu('.fw-site-navigation .menu-item-has-mega-menu');
833        }
834
835        $('.fw-header .menu-item-has-mega-menu').hover(function () {
836            $(this).find('.mega-menu').css('display', 'block');
837        }, function () {
838            $(this).find('.mega-menu').css('display', 'none');
839        });
840
841        // Add Class for mega menu on ie9+ and Mozilla Firefox on Mac OS X if exist select
842        var FFMac = !(window.mozInnerScreenX == null),
843            msie10 = window.navigator.userAgent.indexOf("MSIE"),
844            msie11 = !!navigator.userAgent.match(/Trident.*rv\:11\./);
845
846        if( (FFMac && navigator.platform.indexOf('Mac') >= 0) || msie10 > 0 || msie11 > 0) {
847            var megaMenuSelect = $(".fw-header .menu-item-has-mega-menu .mega-menu select");
848
849            megaMenuSelect.on('click', function(eventAddClassMegaMenu){
850                $(this).parents('.mega-menu').addClass('mega-menu-select');
851
852                // Remove class 'mega-menu-select' for mega menu
853                $('.site').on('click', function(){
854                    $('.mega-menu').removeClass("mega-menu-select");
855                });
856                eventAddClassMegaMenu.stopPropagation();
857            });
858        }
859
860        $(window).on('resize', function () {
861            if($('.header-1, .header-2, .header-3, .header-4').length) {
862                megaMenu('.fw-site-navigation .menu-item-has-mega-menu');
863            }
864
865        })
866    });
867    // Align middle the heading title but header is absolute and if section-main-row-custom it has class: fw-content-overlay-sm, fw-content-overlay-md, fw-content-overlay-lg and fw-content-overlay-custom
868    function sectionTopOverlay() {
869        $('.fw-main-row-top.fw-content-vertical-align-middle .fw-row').css('display', 'block');
870
871        // Set default padding for elements
872        var section_top_inner_elements = $('.fw-main-row-top.fw-content-vertical-align-middle .fw-row:first-child div[class*="fw-col-sm-"]');
873        section_top_inner_elements.css('paddingTop', '0');
874
875        // Calculate & identify the elements
876        var header_height = $('.fw-header .fw-header-main').outerHeight(),
877            theme_content_density = Math.abs(parseInt($('.fw-main-row-top.fw-content-vertical-align-middle div[class*="fw-container-"]').css('paddingTop'))),
878            section_top_height = $('.fw-main-row-top.fw-content-vertical-align-middle').outerHeight(),
879            section_overlap_margin = Math.abs(parseInt($('.fw-content-overlay-sm, .fw-content-overlay-md, .fw-content-overlay-lg, .fw-content-overlay-custom').css('marginBottom'))),
880            section_top_middle_area_center = (section_top_height - header_height - section_overlap_margin)/ 2,
881            section_top_height_inner_element = $('.fw-main-row-top.fw-content-vertical-align-middle .fw-container-fluid, .fw-main-row-top.fw-content-vertical-align-middle .fw-container').height()/ 2,
882            paddTop = ((header_height + section_top_middle_area_center) - section_top_height_inner_element);
883
884        if($('.fw-main-row-top.fw-content-vertical-align-middle.fw-section-no-padding').length){
885            section_top_inner_elements.css('paddingTop', paddTop);
886        }
887        else {
888            section_top_inner_elements.css('paddingTop', (paddTop - theme_content_density));
889        }
890    }
891
892    // Align middle the heading title but header is absolute
893    function sectionTopAlignHeaderIsAbsolut(){
894        $('.fw-main-row-top.fw-content-vertical-align-middle .fw-row').css('display', 'block');
895
896        // Set default padding for elements
897        var section_top_inner_elements = $('.fw-main-row-top.fw-content-vertical-align-middle .fw-row:first-child div[class*="fw-col-sm-"]');
898        section_top_inner_elements.css('paddingTop', '0');
899
900        // Calculate & identify the elements
901        var header_height = $('.fw-header .fw-header-main').outerHeight(),
902            theme_content_density = Math.abs(parseInt($('.fw-main-row-top.fw-content-vertical-align-middle div[class*="fw-container-"]').css('paddingTop'))),
903            section_top_height = $('.fw-main-row-top.fw-content-vertical-align-middle').outerHeight(),
904            section_top_middle_area_center = (section_top_height - header_height)/ 2,
905            section_top_height_inner_element = $('.fw-main-row-top.fw-content-vertical-align-middle .fw-container-fluid, .fw-main-row-top.fw-content-vertical-align-middle .fw-container').height()/ 2,
906            paddTop = ((header_height + section_top_middle_area_center) - section_top_height_inner_element);
907
908        if($('.fw-main-row-top.fw-content-vertical-align-middle.fw-section-no-padding').length){
909            section_top_inner_elements.css('paddingTop', paddTop);
910        }
911        else {
912            section_top_inner_elements.css('paddingTop', (paddTop - theme_content_density));
913        }
914    }
915
916    // Call align middle function
917    var allOverlapClass = $('.fw-content-overlay-sm, .fw-content-overlay-md, .fw-content-overlay-lg, .fw-content-overlay-custom');
918    if ( $('.fw-absolute-header').length && $('.fw-main-row-custom.fw-main-row-top.fw-content-vertical-align-middle').is(allOverlapClass) && screenRes > 767) {
919        sectionTopOverlay();
920        $(window).resize(function(){
921            sectionTopOverlay();
922        });
923    }
924    else if( ($('.fw-absolute-header').length > 0) && ($('.fw-main-row-custom.fw-main-row-top.fw-content-vertical-align-middle').length > 0 && screenRes > 767) ){
925        sectionTopAlignHeaderIsAbsolut();
926        $(window).resize(function(){
927            sectionTopAlignHeaderIsAbsolut();
928        });
929    }
930
931    // Set for revolution slider for container display block
932    if ($('.rev_slider_wrapper').length > 0) {
933        $('.rev_slider_wrapper').parents('.fw-container-fluid, .fw-row, .fw-container').css('display', 'block');
934    }
935    jQuery.fn.isOnScreen = function(){
936        var win = $(window);
937        var viewport = {
938            top : win.scrollTop(),
939            left : win.scrollLeft()
940        };
941        viewport.right = viewport.left + win.width();
942        viewport.bottom = viewport.top + win.height();
943
944        var bounds = this.offset();
945        bounds.right = bounds.left + this.outerWidth();
946        bounds.bottom = bounds.top + this.outerHeight();
947        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
948    };
949
950    // Animate Things (some online tools for responsive test has 750px)
951    if( screenRes > 750 || FwPhpVars.smartphone_animations == 'yes' ){
952        jQuery(".fw-animated-element").each(function () {
953            var animationElement = $(this),
954                delayAnimation = parseInt(animationElement.data('animation-delay')) / 1000,
955                typeAnimation = animationElement.data('animation-type');
956
957            if(animationElement.isOnScreen()) {
958                if (!animationElement.hasClass("animated")) {
959                    animationElement.addClass("animated").addClass(typeAnimation).trigger('animateIn');
960                }
961                animationElement.css({
962                    '-webkit-animation-delay': delayAnimation + 's',
963                    'animation-delay': delayAnimation + 's'
964                });
965            }
966            $(window).scroll(function () {
967                var top = animationElement.offset().top,
968                    bottom = animationElement.outerHeight() + top,
969                    scrollTop = $(this).scrollTop(),
970                    top = top - screenHeight;
971
972                if ((scrollTop > top) && (scrollTop < bottom)) {
973                    if (!animationElement.hasClass("animated")) {
974                        animationElement.addClass("animated").addClass(typeAnimation).trigger('animateIn');
975                    }
976                    animationElement.css({
977                        '-webkit-animation-delay': delayAnimation + 's',
978                        'animation-delay': delayAnimation + 's'
979                    });
980                    // Disable animation fill mode the reason that creates problems,
981                    // on hover animation some shortcodes and video full screen in Google Chrome
982                    var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
983                    jQuery('.animated').one(animationEnd, function() {
984                        $(this).addClass('fill-mode-none');
985                    });
986                }
987            });
988        });
989    }
990});
991
992var $ = jQuery;
993
994/**
995 * Forms
996 */
997jQuery(function ($) {
998    "use strict";
999    var formErrorMessageClass = 'form-error',
1000        formErrorHideEventNamespace = '.form-error-hide',
1001        errorTemplate = '<p class="' + formErrorMessageClass + '" style="color: red;">{message}</p>'; // todo: customize this (add class="" instead of style="")
1002
1003    function showFormError($form, inputName, message) {
1004        var inputSelector = '[name="' + inputName + '"]',
1005            $input = $form.find(inputSelector).last(),
1006            $message = $(errorTemplate.replace('{message}', message));
1007
1008        if ($input.length) {
1009            $input.parent().after($message);
1010
1011            $form.one('focusout' + formErrorHideEventNamespace, inputSelector, function () {
1012                $message.slideUp(function () {
1013                    $(this).remove();
1014                });
1015            });
1016        } else {
1017            // if input not found, show message in form
1018            $form.prepend($message);
1019        }
1020    }
1021
1022    function themeGenerateFlashMessagesHtml(types) {
1023        var html = [], typeHtml = [];
1024
1025        $.each(types, function (type, messages) {
1026            typeHtml = [];
1027
1028            $.each(messages, function (messageId, messageData) {
1029                /*typeHtml.push(messageData.message);*/
1030                typeHtml.push(messageData);
1031            });
1032
1033            if (typeHtml.length) {
1034                html.push(
1035                    '<ul class="flash-messages-' + type + '">' +
1036                    '    <li>' + typeHtml.join('</li><li>') + '</li>' +
1037                    '</ul>'
1038                );
1039            }
1040        });
1041
1042        if (html.length) {
1043            return html.join('');
1044        } else {
1045            return '<p>Success</p>';
1046        }
1047    }
1048
1049    /**
1050     * Display FW_Form errors
1051     */
1052    do {
1053        if (typeof _fw_form_invalid == 'undefined') {
1054            break;
1055        }
1056
1057        var $form = $('form.fw_form_' + _fw_form_invalid.id).first();
1058
1059        if (!$form.length) {
1060            console.error('Form not found on the page');
1061            break;
1062        }
1063
1064        $.each(_fw_form_invalid.errors, function (inputName, message) {
1065            showFormError($form, inputName, message);
1066        });
1067    } while (false);
1068
1069    /**
1070     * Ajax submit
1071     */
1072    {
1073        $(document.body).on('submit', 'form[data-fw-ext-forms-type="contact-forms"]', function (e) {
1074            e.preventDefault();
1075
1076            var $form = $(this);
1077
1078            // todo: show loading
1079            jQuery.ajax({
1080                type: "POST",
1081                url: FwPhpVars.ajax_url,
1082                data: $(this).serialize(),
1083                dataType: 'json'
1084            }).done(function (r) {
1085                if (r.success) {
1086                    // prevent multiple submit
1087                    $form.on('submit', function (e) {
1088                        e.preventDefault();
1089                        e.stopPropagation();
1090                    });
1091
1092                    $form.html(
1093                        themeGenerateFlashMessagesHtml(r.data.flash_messages)
1094                    );
1095
1096                    // if form has a redirect page, redirect the form to this URL
1097                    var redirect_page = $form.parents('.fw-contact-form').data('redirect-page');
1098                    // if has a success message & a not empty redirect page
1099                    if( r.data.flash_messages.success.fw_ext_contact_form_process != undefined && redirect_page != '' ) {
1100                        window.location.href = redirect_page;
1101                    }
1102                } else {
1103                    // hide all current error messages
1104                    $form.off(formErrorHideEventNamespace)
1105                        .find('.' + formErrorMessageClass).remove();
1106
1107                    // add new error messages
1108                    $.each(r.data.errors, function (inputName, message) {
1109                        showFormError($form, inputName, message);
1110                    });
1111                }
1112            }).fail(function () {
1113                // show fail error message
1114                $form.html(FwPhpVars.fail_form_error);
1115                // todo: show server error
1116            });
1117        });
1118    }
1119});
1120
1121/**
1122 * Radiobox for woocommerce
1123 */
1124$(document).on("ajaxComplete", function () {
1125    jQuery(".input-radio, #terms").customInput();
1126});
1127
1128// Window load function
1129$(window).load(function () {
1130    "use strict";
1131
1132    var $ = jQuery,
1133        screenRes = $(window).width();
1134
1135    // vertical align middle
1136    function fnResize() {
1137        $('.fw-content-vertical-align-middle').each(function () {
1138            var $this = $(this),
1139                heightContainerParent = $this.find('.fw-container-fluid, .fw-container').outerHeight(),
1140                heightParent = $this.outerHeight(),
1141                numberColumn = 0;
1142            numberColumn = parseInt($this.find('.fw-row').length);
1143            if (numberColumn < 2) {
1144                $this.find('[id^="column-"]').each(function () {
1145                    var $thisColum = $(this);
1146                    var heightColum = $thisColum.outerHeight(),
1147                        heightContainer = $this.find('.fw-container-fluid, .fw-container').height();
1148                    $thisColum.css({
1149                        marginTop: heightContainer / 2 - heightColum / 2
1150                    });
1151                });
1152                $this.css({
1153                    paddingTop: heightParent / 2 - heightContainerParent / 2
1154                }).addClass("fw-middle-align");
1155            } else {
1156                $('.fw-content-vertical-align-middle').addClass("fw-middle-align");
1157            }
1158        });
1159    }
1160
1161    if(screenRes > 767 ){
1162        fnResize();
1163    }
1164
1165    jQuery(window).resize(function () {
1166        var screenRes = jQuery(window).width();
1167        if(screenRes > 767 ){
1168            fnResize();
1169        }
1170    });
1171});
1172
1173// start carousel for portfolio filter
1174function start_carousel_portfolio_filter() {
1175    var portfolio_filter = jQuery('.portfolio_filter');
1176    if (portfolio_filter.length > 0) {
1177        portfolio_filter.each(function () {
1178            var filter_id = jQuery(this).attr('id');
1179            jQuery('#' + filter_id).carouFredSel({
1180                swipe: {
1181                    onTouch: true
1182                },
1183                prev: '#' + filter_id + '-prev',
1184                next: '#' + filter_id + '-next',
1185                items: {
1186                    visible: 'variable'
1187                },
1188                auto: {
1189                    play: false
1190                },
1191                infinite: true,
1192                scroll: {
1193                    items: 1,
1194                    duration: 600,
1195                    easing: 'swing'
1196                }
1197            });
1198        });
1199    }
1200}
1201
1202jQuery(window).resize(function () {
1203    start_carousel_portfolio_filter();
1204});
1205
1206function start_prettyphoto() {
1207	if ($('a').is('[data-rel]')) {
1208		$("a[rel^='prettyPhoto'], a[data-rel^='prettyPhoto']").prettyPhoto({
1209			social_tools: false,
1210			deeplinking: false,
1211			theme: 'dark_square',
1212			horizontal_padding: 60,
1213			show_title: false,
1214			default_width: 800,
1215			default_height: 400,
1216			allow_resize: true,
1217			overlay_gallery: false,
1218			markup: '<div class="pp_pic_holder"> \
1219						<div class="ppt">&nbsp;</div> \
1220						<div class="pp_top"> \
1221							<div class="pp_left"></div> \
1222							<div class="pp_middle"></div> \
1223							<div class="pp_right"></div> \
1224						</div> \
1225						<div class="pp_content_container"> \
1226							<div class="pp_left"> \
1227							<div class="pp_right"> \
1228								<div class="pp_content"> \
1229									<div class="pp_loaderIcon"></div> \
1230									<div class="pp_fade"> \
1231										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
1232										<div class="pp_hoverContainer"> \
1233											<a class="pp_next" href="#">' + FwPhpVars.next + '</a> \
1234											<a class="pp_previous" href="#">' + FwPhpVars.previous + '</a> \
1235										</div> \
1236										<div id="pp_full_res"></div> \
1237										<div class="pp_details"> \
1238											<div class="pp_nav"> \
1239												<a href="#" class="pp_arrow_previous">' + FwPhpVars.previous + '</a> \
1240												<p class="currentTextHolder">0/0</p> \
1241												<a href="#" class="pp_arrow_next">' + FwPhpVars.next + '</a> \
1242											</div> \
1243											<p class="pp_description"></p> \
1244											<div class="pp_social">{pp_social}</div> \
1245											<a class="pp_close" href="#">Close</a> \
1246										</div> \
1247									</div> \
1248								</div> \
1249							</div> \
1250							</div> \
1251						</div> \
1252						<div class="pp_bottom"> \
1253							<div class="pp_left"></div> \
1254							<div class="pp_middle"></div> \
1255							<div class="pp_right"></div> \
1256						</div> \
1257					</div> \
1258					<div class="pp_overlay"></div>',
1259			changepicturecallback: function () {
1260				setupSwipe();
1261				var $holder = jQuery('.pp_nav .currentTextHolder'),
1262					$closeButton = jQuery('.pp_close'),
1263					splitted = $holder.text().split('/');
1264				$closeButton.addClass('fa fa-times');
1265
1266				$holder.html(splitted.join('<span class="pp_text_devider">/</span>'));
1267				$closeButton.remove();
1268				$('.pp_pic_holder').prepend($closeButton);
1269
1270				$closeButton.click(function () {
1271					$('.pp_overlay, .pp_pic_holder').fadeOut(300, function () {
1272						$(this).remove();
1273					});
1274					return false
1275				});
1276			}
1277		});
1278		var setupSwipe = function(){
1279			$(".pp_pic_holder").swipe({
1280				swipeLeft: function () {
1281					$.prettyPhoto.changePage('next');
1282				},
1283				swipeRight: function () {
1284					$.prettyPhoto.changePage('previous');
1285				},
1286				min_move_x: 20,
1287				min_move_y: 20,
1288				preventDefaultEvents: true
1289			});
1290		};
1291	}
1292}
1293

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.