PageSourceSearch

https://fathermurrayvhc.com/wp-content/themes/the-core-parent/js/general.js?ver=1.0.34

js fathermurrayvhc.com collected 2026-10-10 02:12:17 UTC 51,576 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    if ($('select[class*="select-"]').length > 0) {
19        $('select[class*="select-"]').selectize({
20            create: true
21        });
22    }
23
24    // selectize control input
25    Selectize.define('selectize_control_input', function(options) {
26        var self = this;
27        this.showInput = function() {
28            this.$control.css({cursor: 'pointer'});
29            this.$control_input.css({opacity: 0, position: 'relative', left: self.rtl ? 10000 : -10000 });
30            this.isInputHidden = false;
31        };
32
33        this.setup_original = this.setup;
34
35        this.setup = function() {
36            self.setup_original();
37            this.$control_input.prop("disabled","disabled");
38        }
39    });
40
41    if( screenRes < 1025 ) {
42        $('select[name="archive-dropdown"], select[name="cat"], select[name="monster-widget-just-testing"], .woocommerce-ordering .orderby, .dropdown_product_cat, select.country_select, select.state_select, #calc_shipping_country, .bbpress select, .buddypress select, .wpcf7-select, .llms-field-select, .mc4wp-form .mc4wp-form-fields select, .gform_wrapper select:not(.ginput_card_expiration)').selectize({
43            create: true,
44            allowEmptyOption: true,
45            plugins: ['selectize_control_input']
46        });
47    }
48    else {
49        $('select[name="archive-dropdown"], select[name="cat"], select[name="monster-widget-just-testing"], .woocommerce-ordering .orderby, .dropdown_product_cat, select.country_select, select.state_select, #calc_shipping_country, .bbpress select, .buddypress select, .wpcf7-select, .llms-field-select, .mc4wp-form .mc4wp-form-fields select, .gform_wrapper select:not(.ginput_card_expiration)').selectize({
50            create: true,
51            allowEmptyOption: true
52        });
53    }
54
55    // Woocommerce if the country has regions (ex. USA)
56    if( $('#billing_state_field').length > 0 && typeof wc_country_select_params !== 'undefined' ) {
57        var states_json = wc_country_select_params.countries.replace( /&quot;/g, '"' ),
58            states = $.parseJSON( states_json );
59        $( document.body ).on( 'change', 'select.country_to_state, input.country_to_state', function() {
60            var country = $(this).val();
61
62            if (states[country]) {
63                // is select
64                if ($.isEmptyObject(states[country])) {
65                    // has no state
66                }
67                else {
68                    $('#billing_state_field select.state_select').selectize({
69                        create: true,
70                        allowEmptyOption: true
71                    });
72                }
73            }
74            else {
75                // is input
76                $('#billing_state_field .selectize-control').remove();
77            }
78        });
79    }
80
81    start_carousel_portfolio_filter();
82
83    // ContactForm7 preppend label for acceptance checkbox
84    if($('.wpcf7-form').length > 0) {
85        $('input.wpcf7-acceptance').wrap('<span class="wpcf7-list-item"></span>').parent().prepend('<span class="wpcf7-list-item-label acceptance-check"></span>');
86    }
87
88    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) {
89        $(".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();
90    }
91
92    // prettyPhoto lightbox, check if <a> has atrr data-rel and hide for Mobiles
93    start_prettyphoto();
94
95    // Remove background cart
96    jQuery('.shop_table.cart').parent('form').css({
97        'background-color': 'transparent',
98        'padding': '0'
99    });
100
101    // Set width for divider on pagination type 2
102    function widthDividerPostPagination2 (){
103        var paginationContainerWidth = jQuery('.paging-navigation-type-2').outerWidth()/2,
104            buttonPrevWidth = jQuery('.paging-navigation-type-2 .prev').outerWidth(),
105            buttonNextWidth = jQuery('.paging-navigation-type-2 .next').outerWidth(),
106            numbersWrap = jQuery('.paging-navigation-type-2 .pagination-numbers-wrap').outerWidth()/2;
107
108        jQuery('.paging-navigation-type-2 .before-hr').css({
109            'width': paginationContainerWidth - numbersWrap - buttonPrevWidth,
110            'left':  buttonPrevWidth
111        });
112        jQuery('.paging-navigation-type-2 .after-hr').css({
113            'width': paginationContainerWidth - numbersWrap - buttonNextWidth,
114            'right': buttonNextWidth
115        });
116    }
117    if(jQuery('.paging-navigation.paging-navigation-type-2').length > 0){
118        widthDividerPostPagination2();
119        $(window).resize(function(){ widthDividerPostPagination2(); });
120    }
121
122    // Show more events
123    $('.fw-show-more-events').on('click', function () {
124        if ($(this).hasClass('closed')) {
125            $(this).removeClass('closed').addClass('open');
126            $('.fw-more-events-content').slideDown(800);
127        }
128        else {
129            $(this).removeClass('open').addClass('closed');
130            $('.fw-more-events-content').slideUp(800);
131        }
132    });
133
134    //Iframe Serponsive
135    function adjustIframes() {
136        $('iframe').each(function () {
137            var $this = $(this),
138                proportion = $this.data('proportion'),
139                w = $this.attr('width'),
140                actual_w = $this.width();
141
142            if (!proportion) {
143                proportion = $this.attr('height') / w;
144                $this.data('proportion', proportion);
145            }
146
147            if (actual_w != w) {
148                $this.css('height', Math.round(actual_w * proportion) + 'px');
149            }
150        });
151    }
152    $(window).on('resize load', adjustIframes);
153
154    // Detect Click in Iframe
155    function detectIframeClick() {
156        var overiFrame = -1;
157        jQuery('.myCarousel').find('iframe').hover(function () {
158            overiFrame = 1;
159        }, function () {
160            overiFrame = -1
161        });
162        $(window).on('blur', function () {
163            if (overiFrame != -1) {
164                jQuery('.myCarousel').carousel('pause');
165            }
166        });
167        jQuery('.carousel-control, .carousel-indicators li').click(function () {
168            jQuery('.myCarousel').carousel('cycle');
169        });
170    }
171    detectIframeClick();
172
173    // Smooth Scroling of ID anchors
174    function filterPath(string) {
175        return string
176            .replace(/^\//, '')
177            .replace(/(index|default).[a-zA-Z]{3,4}$/, '')
178            .replace(/\/$/, '');
179    }
180
181    var locationPath = filterPath(location.pathname);
182    var scrollElem = scrollableElement('html', 'body');
183
184    function anchorFn(argument) {
185        var HeaderHeightNormal = 0,
186            HeaderHeightSticky = 0;
187
188        $('.anchor a[href*="#"], a[href*="#"].anchor').each(function () {
189            $(this).click(function (event) {
190                // only if is sticky header calculate the headers height for know the offset, in other case the header height is 0
191                if( $(this).parents('body.fw-header-sticky').find('.fw-sticky-menu').length > 0 && screenRes > 767 ) {
192                    HeaderHeightSticky = $('.fw-header.fw-sticky-menu').height(); // Sticky header height
193
194                    var HeaderHeight = HeaderHeightSticky;
195                }
196                else {
197                    var HeaderHeight = HeaderHeightNormal;
198                }
199
200                var thisPath = filterPath(this.pathname) || locationPath;
201                if (locationPath == thisPath
202                    && (location.hostname == this.hostname || !this.hostname)
203                    && this.hash.replace(/#/, '')) {
204                    var $target = $(this.hash), target = this.hash;
205                    if (target && $target.length != 0) {
206                        var targetOffset = $target.offset().top - HeaderHeight;
207                        event.preventDefault();
208                        $(scrollElem).animate({scrollTop: targetOffset}, 400);
209                        setTimeout( function(){
210                            location.hash = target;
211                        }, 300 );
212                    }
213                }
214            });
215        });
216    }
217
218    // Scroll To Top Button
219    $(window).on('scroll', function() {
220        if(jQuery('.scroll-to-top').length > 0){
221            if(parseInt($(window).scrollTop(), 10) > 600){
222                jQuery('.scroll-to-top').fadeIn(500);
223            }
224            else {
225                jQuery('.scroll-to-top').fadeOut(500);
226            }
227        }
228    });
229
230    // use the first element that is "scrollable"
231    function scrollableElement(els) {
232        for (var i = 0, argLength = arguments.length; i < argLength; i++) {
233            var el = arguments[i],
234                $scrollElement = $(el);
235            if ($scrollElement.scrollTop() > 0) {
236                return el;
237            } else {
238                $scrollElement.scrollTop(1);
239                var isScrollable = $scrollElement.scrollTop() > 0;
240                $scrollElement.scrollTop(0);
241                if (isScrollable) {
242                    return el;
243                }
244            }
245        }
246        return [];
247    }
248
249    // Header Type 5 (close & open Menu)
250    if(jQuery('.header-5').length > 0) {
251        var $headerMenu5 = jQuery('#header-menu');
252
253        $headerMenu5.find('.mega-menu-col').each( function(){
254            var megaMenuCol = $(this);
255            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
256
257            $('.linkBlank').each(function() {
258                var linkBlank = $(this);
259                if(linkBlank.children().length === 1) {
260                    linkBlank.addClass('removeItem');
261                    linkBlank.parent().addClass('removeItem')
262                }
263            });
264            $('ul.removeItem').each(function() {
265                var removeItem = $(this);
266                removeItem.find('li.removeItem').remove();
267                removeItem.children().length === 0 ? removeItem.remove() : null;
268            });
269        });
270        $('.linkBlank').removeClass('linkBlank');
271        $('.removeItem').removeClass('removeItem');
272
273
274        // Create Menu
275        $headerMenu5.mmenu({
276            extensions: [
277                "pageshadow",
278                FwPhpVars.effect_panels,
279                FwPhpVars.effect_listitems_slide
280            ],
281            offCanvas	: {
282                position 	: FwPhpVars.header_5_position,
283                zposition	: "front"
284            }
285        });
286
287        // Prepend Close Button
288        jQuery('#header-menu.mm-menu').prepend('<a href="#" class="fw-close-menu-header5"><i class="mm-close"></i></a>');
289
290        // Change Position for .mm-next when menu is aligned center
291        if(jQuery('.header-align-center').length > 0){
292            jQuery('.mm-listview .menu-item a.mm-next').each(function(){
293                $(this).appendTo($(this).parent());
294                $(this).parents('.mm-panel').addClass('fw-list-has-children');
295            });
296        }
297
298        // Add keyword "Back" in back button
299        jQuery('.mm-btn.mm-prev').html('<span>'+FwPhpVars.back+'</span>');
300
301        // Close the menu, click the close button('X')
302        var API = $headerMenu5.data("mmenu");
303        $headerMenu5.find('.fw-close-menu-header5').click(function() {
304            API.close();
305        });
306
307        // Add class "video-panel" if bg video is set, add class "wallpaper" in header nav
308        if( $headerMenu5.is("[data-background-options]") ) {
309            jQuery('.fw-menu-open').on('click', function() {
310                $headerMenu5.background();
311            });
312        }
313    }
314
315    // Header Type 6
316    if(jQuery('.header-6').length > 0) {
317        // Copy Logo HTML and insert in clone
318        var logoHTML = jQuery('.fw-header-main .fw-wrap-logo');
319
320        // Create New Menu
321        var $headerMenu = jQuery('#header-menu');
322
323        // Remove link if is blank
324        $headerMenu.find('.mega-menu-col').each( function(){
325            var megaMenuCol = $(this);
326            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
327
328            $('.linkBlank').each(function() {
329                var linkBlank = $(this);
330                if(linkBlank.children().length === 1) {
331                    linkBlank.addClass('removeItem');
332                    linkBlank.parent().addClass('removeItem')
333                }
334            });
335            $('ul.removeItem').each(function() {
336                var removeItem = $(this);
337                removeItem.find('li.removeItem').remove();
338                removeItem.children().length === 0 ? removeItem.remove() : null;
339            });
340        });
341        $('.linkBlank').removeClass('linkBlank');
342        $('.removeItem').removeClass('removeItem');
343
344        // Create Menu
345        $headerMenu.mmenu({
346            navbars: [{
347                content: [ logoHTML ]
348            },
349                {
350                    position: "bottom",
351                    content: [ FwPhpVars.socials ]
352                }
353            ],
354            extensions: [
355                "widescreen",
356                FwPhpVars.effect_panels
357            ],
358            offCanvas: {
359                position: FwPhpVars.header_6_position
360            }
361        });
362
363        // Calculate logo height and add top position to menu
364        if ( logoHTML.find('img').attr('src') == undefined ) {
365            // if logo is text
366            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.
367                mmPanels   = jQuery('.mm-panels');
368
369            mmPanels.css({
370                top: logoHeight + 20
371            });
372        }
373        else {
374            var logoImg = new Image();
375            logoImg.src = logoHTML.find('img').attr('src');
376            logoImg.onload = function () {
377                var logoHeight = jQuery('.fw-wrap-logo').outerHeight(),
378                    mmPanels   = jQuery('.mm-panels');
379
380                mmPanels.css({
381                    top: logoHeight + 20
382                });
383            };
384        }
385
386        // Add keyword "Back" in back button
387        jQuery('.mm-btn.mm-prev').html('<span>'+FwPhpVars.back+'</span>');
388
389        // Change Position for .mm-next when menu is aligned left & center
390        if(jQuery('.header-item-align-left, .header-item-align-center').length > 0){
391            jQuery('.mm-listview .menu-item a.mm-next').each(function(){
392                $(this).appendTo($(this).parent());
393                $(this).parents('.mm-panel').addClass('fw-list-has-children');
394            });
395        }
396
397        // Add search in menu if search it is positioned in menu
398        if(jQuery('.search-in-menu').length > 0){
399            var searchHtml = jQuery('.fw-search'),
400                fullSearchHtml = jQuery('.fw-wrap-search-form.fw-form-search-full');
401
402            $headerMenu.children().children('.mm-panel').append(searchHtml);
403            $headerMenu.append(fullSearchHtml);
404        }
405        else if(jQuery('.search-in-top-bar .fw-wrap-search-form.fw-form-search-full').length > 0){
406            fullSearchHtml = jQuery('.fw-wrap-search-form.fw-form-search-full');
407            $headerMenu.append(fullSearchHtml);
408        }
409
410        // Close the menu, click th
410e close button('X')
411        var API = $headerMenu.data("mmenu");
412        $headerMenu.find('.fw-menu-open').click(function() {
413            API.close();
414        });
415        if(screenRes < 1200) {
416            jQuery('.site').click(function(){
417                API.close();
418            });
419        }
420    }
421
422    // Responsive Menu (Mobile Menu for header type 1 -> 4)
423    var Mobile_Menu = function () {
424        var $menu = jQuery('#mobile-menu'),
425            navPosition = 'bottom';
426
427        $menu.find('.mega-menu-col').each( function(){
428            var megaMenuCol = $(this);
429            megaMenuCol.find('a[href="#"]').parent().addClass('linkBlank');
430
431            $('.linkBlank').each(function() {
432                var linkBlank = $(this);
433                if(linkBlank.children().length === 1) {
434                    linkBlank.addClass('removeItem');
435                    linkBlank.parent().addClass('removeItem')
436                }
437            });
438            $('ul.removeItem').each(function() {
439                var removeItem = $(this);
440                removeItem.find('li.removeItem').remove();
441                removeItem.children().length === 0 ? removeItem.remove() : null;
442            });
443        });
444        $('.linkBlank').removeClass('linkBlank');
445        $('.removeItem').removeClass('removeItem');
446
447        // If social variables is empty change nav position
448        if(FwPhpVars.socials === ''){
449            navPosition = 'top';
450        }
451
452        // Create menu
453        $menu.mmenu({
454            counters: true,
455            extensions: [
456                "theme-dark",
457                FwPhpVars.effect_panels,
458                FwPhpVars.mobile_menu_page_dim,
459                FwPhpVars.mobile_menu_border_style
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-container').width(),
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.