PageSourceSearch

https://pagesandposts.com/wp-content/themes/deepdigital/js/main.js?ver=2.4.4

js pagesandposts.com collected 2026-09-29 11:45:51 UTC 63,004 bytes, 1,373 lines download raw bytes

1"use strict";
2//Wrapping all JavaScript code into a IIFE function for prevent global variables creation
3(function ($) {
4
5    var $body = jQuery('body');
6    var $window = jQuery(window);
7
8//hidding menu elements that do not fit in menu width
9//processing center logo
10    function menuHideExtraElements() {
11
12        //cleaneng changed elements
13        jQuery('.sf-more-li, .sf-logo-li').remove();
14        var windowWidth = jQuery('body').innerWidth();
15
16        jQuery('.sf-menu').each(function () {
17            var $thisMenu = jQuery(this);
18            var $menuWraper = $thisMenu.closest('.mainmenu_wrapper');
19            $menuWraper.attr('style', '');
20            if (windowWidth > 991 && !document.querySelector('body').classList.contains('header_show_all_menu_items')) {
21                //grab all main menu first level items
22                var $menuLis = $menuWraper.find('.sf-menu > li');
23                $menuLis.removeClass('sf-md-hidden');
24
25                var $headerLogoCenter = $thisMenu.closest('.header_logo_center');
26                var logoWidth = 0;
27                var summaryLiWidth = 0;
28
29                if ($headerLogoCenter.length) {
30                    var $logo = $headerLogoCenter.find('.logo');
31                    // 30/2 - left and right margins
32                    logoWidth = $logo.outerWidth(true) + 70;
33                }
34
35                var wrapperWidth = $menuWraper.outerWidth(true);
36                $menuLis.each(function (index) {
37                    var elementWidth = jQuery(this).outerWidth();
38                    summaryLiWidth += elementWidth;
39                    if (summaryLiWidth >= (wrapperWidth - logoWidth)) {
40                        var $newLi = jQuery('<li class="sf-more-li"><a>...</a><ul class="sub-menu"></ul></li>');
41                        jQuery('ul.children').addClass('sub-menu');
42                        jQuery($menuLis[index - 1]).before($newLi);
43                        var newLiWidth = jQuery($newLi).outerWidth(true);
44                        var $extraLiElements = $menuLis.filter(':gt(' + (index - 2) + ')');
45                        $extraLiElements.clone().appendTo($newLi.find('ul'));
46                        $extraLiElements.addClass('sf-md-hidden');
47                        return false;
48                    }
49                });
50
51                //processing center logo
52                if ($headerLogoCenter.length) {
53                    var $menuLisVisible = $headerLogoCenter.find('.sf-menu > li:not(.sf-md-hidden)');
54                    var menuLength = $menuLisVisible.length;
55                    var summaryLiVisibleWidth = 0;
56                    $menuLisVisible.each(function () {
57                        summaryLiVisibleWidth += jQuery(this).outerWidth();
58                    });
59
60                    var centerLi = Math.floor(menuLength / 2);
61                    if ((menuLength % 2 === 0)) {
62                        centerLi--;
63                    }
64                    var $liLeftFromLogo = $menuLisVisible.eq(centerLi);
65                    $liLeftFromLogo.after('<li class="sf-logo-li"></li>');
66                    $headerLogoCenter.find('.sf-logo-li').width(logoWidth);
67                    var liLeftRightDotX = $liLeftFromLogo.offset().left + $liLeftFromLogo.outerWidth();
68                    var logoLeftDotX = windowWidth / 2 - logoWidth / 2;
69                    var menuLeftOffset = liLeftRightDotX - logoLeftDotX;
70                    $menuWraper.css({'left': -menuLeftOffset})
71                }
72
73            }// > 991
74        }); //sf-menu each
75    } //menuHideExtraElements
76
77    function initMegaMenu() {
78        var $megaMenu = jQuery('.mainmenu_wrapper .mega-menu');
79        if ($megaMenu.length) {
80            var windowWidth = jQuery('body').innerWidth();
81            if (windowWidth > 991) {
82                $megaMenu.each(function () {
83                    var $thisMegaMenu = jQuery(this);
84                    //temporary showing mega menu to propper size calc
85                    $thisMegaMenu.css({'display': 'block', 'left': 'auto'});
86                    var thisWidth = $thisMegaMenu.outerWidth();
87                    var thisOffset = $thisMegaMenu.offset().left;
88                    var thisLeft = (thisOffset + (thisWidth / 2)) - windowWidth / 2;
89                    $thisMegaMenu.css({'left': -thisLeft, 'display': 'none'});
90                    if (!$thisMegaMenu.closest('ul').hasClass('nav')) {
91                        $thisMegaMenu.css('left', '');
92                    }
93                });
94            }
95        }
96    }
97
98    function pieChart() {
99        //circle progress bar
100        if (jQuery().easyPieChart) {
101
102            jQuery('.chart').each(function () {
103
104                var $currentChart = jQuery(this);
105                var imagePos = $currentChart.offset().top;
106                var topOfWindow = jQuery(window).scrollTop();
107                if (imagePos < topOfWindow + 900) {
108
109                    var size = $currentChart.data('size') ? $currentChart.data('size') : 270;
110                    var line = $currentChart.data('line') ? $currentChart.data('line') : 20;
111                    var bgcolor = $currentChart.data('bgcolor') ? $currentChart.data('bgcolor') : '#ffffff';
112                    var trackcolor = $currentChart.data('trackcolor') ? $currentChart.data('trackcolor') : '#c14240';
113                    var speed = $currentChart.data('speed') ? $currentChart.data('speed') : 3000;
114
115                    $currentChart.easyPieChart({
116                        barColor: trackcolor,
117                        trackColor: bgcolor,
118                        scaleColor: false,
119                        scaleLength: false,
120                        lineCap: 'butt',
121                        lineWidth: line,
122                        size: size,
123                        rotate: 0,
124                        animate: speed,
125                        onStep: function (from, to, percent) {
126                            jQuery(this.el).find('.percent').text(Math.round(percent));
127                        }
128                    });
129                }
130            });
131        }
132    }
133
134    function affixSidebarInit() {
135        var $affixAside = jQuery('.affix-aside');
136        if ($affixAside.length) {
137
138            //on stick and unstick event
139            $affixAside.on('affix.bs.affix', function (e) {
140                var affixWidth = $affixAside.width() - 1;
141                var affixLeft = $affixAside.offset().left;
142                $affixAside
143                    .width(affixWidth)
144                    .css("left", affixLeft);
145            }).on('affix-top.bs.affix affix-bottom.bs.affix', function (e) {
146                $affixAside.css({"width": "", "left": ""});
147            });
148
149            //counting offset
150            var offsetTop = $affixAside.offset().top - jQuery('.page_header').height();
151            var offsetBottom = jQuery('.page_footer').outerHeight(true) + jQuery('.page_copyright').outerHeight(true);
152
153            $affixAside.affix({
154                offset: {
155                    top: offsetTop,
156                    bottom: offsetBottom
157                },
158            });
159
160            jQuery(window).on('resize', function () {
161                $affixAside.css({"width": "", "left": ""});
162
163                if ($affixAside.hasClass('affix')) {
164                    //returning sidebar in top position if it is sticked because of unexpacted behavior
165                    $affixAside.removeClass("affix").css("left", "").addClass("affix-top");
166                }
167
168                var offsetTop = jQuery('.page_topline').outerHeight(true)
169                    + jQuery('.page_toplogo').outerHeight(true)
170                    + jQuery('.page_breadcrumbs').outerHeight(true)
171                    + jQuery('.page_header').outerHeight(true);
172                var offsetBottom = jQuery('.page_footer').outerHeight(true) + jQuery('.page_copyright').outerHeight(true);
173
174                $affixAside.data('bs.affix').options.offset.top = offsetTop;
175                $affixAside.data('bs.affix').options.offset.bottom = offsetBottom;
176
177                $affixAside.affix('checkPosition');
178
179            });
180
181        }//eof checking of affix sidebar existing
182    }
183
184    //photoSwipe gallery plugin
185    function initPhotoSwipe() {
186        if (typeof PhotoSwipe !== 'undefined') {
187
188            //adding prettyPhoto for backward compatibility. Deprecated.
189            //will leave only .photoswipe-link later
190            var gallerySelectors = '.photoswipe-link, a[data-gal^="prettyPhoto"], [data-thumb] a';
191            var $galleryLinks = $(gallerySelectors);
192            if ($galleryLinks.length) {
193
194                //adding photoswipe gallery markup
195                if (!($('.pswp').length)) {
196                    $body.append('<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"><div class="pswp__bg"></div><div class="pswp__scroll-wrap"><div class="pswp__container"><div class="pswp__item"></div><div class="pswp__item"></div><div class="pswp__item"></div></div><div class="pswp__ui pswp__ui--hidden"><div class="pswp__top-bar"><div class="pswp__counter"></div><a class="pswp__button pswp__button--close" title="Close (Esc)"></a><a class="pswp__button pswp__button--share" title="Share"></a><a class="pswp__button pswp__button--fs" title="Toggle fullscreen"></a><a class="pswp__button pswp__button--zoom" title="Zoom in/out"></a><div class="pswp__preloader"><div class="pswp__preloader__icn"><div class="pswp__preloader__cut"><div class="pswp__preloader__donut"></div></div></div></div></div><div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"><div class="pswp__share-tooltip"></div> </div><a class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></a><a class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></a><div class="pswp__caption"><div class="pswp__caption__center"></div></div></div></div></div>');
197                    //if function already was called - return (all listeners was setted and .pswp gallery container was added)
198                } else {
199                    return;
200                }
201                //adding prettyPhoto for backward compatibility. Deprecated.
202                $('body').on('click', gallerySelectors, function (e) {
203                    e.preventDefault();
204
205                    var $link = $(this);
206                    var $linksParentContainer = $link.closest('.photoswipe-container, .isotope-wrapper, .isotope_container, .owl-carousel, .flickr_ul, .images');
207                    var $links = $linksParentContainer.find(gallerySelectors);
208
209                    //if no container only adding this link
210                    if (!$links.length) {
211                        $links.push($link);
212                    }
213                    var items = [];
214
215                    var options = {
216                        bgOpacity: 0.7,
217                        showHideOpacity: true,
218                        history: false,
219                        shareEl: false,
220                        index: 0
221                    };
222                    var gallery = $('.pswp')[0];
223                    //building items array
224                    var counter = 0;
225                    var clonedClick = false;
226                    var clonedRealIndex = 0;
227                    $links.each(function (i) {
228                        var $this = $(this);
229                        //if cloned element (owl or flexslider thumbs) - continue
230                        if ($this.closest('.clone, .cloned').length) {
231                            if (($link[0] === $this[0])) {
232                                clonedClick = true;
233                                clonedRealIndex = parseInt($this.data('index'), 10);
234                                options.index = clonedRealIndex;
235                            }
236                            return;
237                        }
238                        var item = {};
239                        //start slide from clicked element
240                        if (($link[0] === $this[0])) {
241                            options.index = counter;
242                        }
243
244                        //video or image
245                        if ($this.data('iframe')) {
246                            var autoplay = ($links.length > 1) ? '' : '&autoplay=1';
247                            item.html = '<div class="embed-responsive embed-responsive-16by9">';
248                            //for wordpress - iframe tag is escaped
249                            if ($this.data('iframe').indexOf('src=') !== -1) {
250                                item.html += $this.data('iframe').replace(/&amp/g, '&').replace(/$lt;/g, '<').replace(/&gt;/g, '>').replace(/$quot;/g, '"');
251
252                            } else {
253                                //autoplay only if 1 iframe in gallery
254                                item.html += '<iframe class="embed-responsive-item" src="' + $(this).data('iframe') + '?rel=0' + autoplay + '&enablejsapi=1&api=1"></iframe>';
255                            }
256                            item.html += '</div>';
257                            //if this is a prettyPhoto link that goes on the youtube
258                        } else if ($this.attr('href').indexOf('youtu') !== -1) {
259                            item.html += '<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="' + $this.attr('href').replace("watch?v=", "embed/") + '?rel=0&autoplay=1&enablejsapi=1&api=1"></iframe></div>';
260                        } else {
261                            item.src = $this.attr('href');
262                            var width = 1170;
263                            var height = 780;
264                            var data = $this.data();
265                            var dataImage = $this.find('img').first().data();
266                            if (data.width) {
267                                width = data.width;
268                            }
269                            if (data.height) {
270                                height = data.height;
271                            }
272                            if (typeof dataImage !== 'undefined') {
273                                if (dataImage.large_image_width) {
274                                    width = dataImage.large_image_width;
275                                }
276                                if (dataImage.large_image_height) {
277                                    height = dataImage.large_image_height;
278                                }
279                            }
280                            item.w = width;
281                            item.h = height;
282                        }
283                        items.push(item);
284                        counter++;
285                    });
286
287                    var pswpGallery = new PhotoSwipe(gallery, PhotoSwipeUI_Default, items, options);
288                    pswpGallery.init();
289
290                    //pausing video on close and on slide change
291                    pswpGallery.listen('afterChange', function () {
292                        $(pswpGallery.container).find('iframe').each(function () {
293                            $(this)[0].contentWindow.postMessage('{"method":"pause","event":"command","func":"pauseVideo","args":""}', '*')
294                        });
295                    });
296                    pswpGallery.listen('close', function () {
297                        $(pswpGallery.container).find('iframe').each(function () {
298                            $(this)[0].contentWindow.postMessage('{"method":"pause","event":"command","func":"pauseVideo","args":""}', '*')
299                        });
300                    });
301
302                });
303            }
304
305        }
306    }
307
308    function initCustomOwlNav() {
309        // Custom nav of owl carousel
310        var $carouselNav = $('.owl-custom-nav'),
311            $carouselSection = $carouselNav.closest('section'),
312            $carousel = $carouselSection.find('.owl-carousel');
313
314        $carouselNav.find('.owl-prev').on('click', function () {
315            $carousel.trigger('prev.owl');
316        });
317        $carouselNav.find('.owl-next').on('click', function () {
318            $carousel.trigger('next.owl');
319        });
320
321        if ($carousel.find('.owl-nav').hasClass('disabled')) $carouselNav.addClass('disabled');
322    }
323
324    function videoSlider() {
325        if (document.querySelector('.slide-video')) {
326            var $videobg = document.querySelector('.slide-video');
327            var $src = $videobg.querySelector('source').dataset.src;
328            var $time = $videobg.querySelector('source').dataset.time;
329
330            if ($videobg.paused) {
331                $videobg.querySelector('source').src = $src;
332                $videobg.load();
333                $videobg.currentTime = 0;
334                $videobg.volume = 0;
335                $videobg.play();
336
337                $videobg.addEventListener('timeupdate', function () {
338                    if (this.currentTime >= $time) {
339                        $videobg.currentTime = 0;
340                        $videobg.volume = 0;
341                        $videobg.play();
342                    }
343                });
344            }
345
346            $('.slides').on('classChanged', 'li:first', function () {
347                $videobg.currentTime = 0;
348                $videobg.volume = 0;
349                $videobg.play();
350                $videobg.addEventListener('timeupdate', function () {
351                    if (this.currentTime >= 26) {
352                        $videobg.currentTime = 0;
353                        $videobg.volume = 0;
354                        $videobg.play();
355                    }
356                })
357            });
358        }
359    }
360
361    function give() {
362        $('.give-goal-progress').each(function () {
363            var $item = $(this);
364            if (!$item.find('.raised span').hasClass('give-percentage')) {
365                var $val_now = $item.find('.raised .income').text();
366                var $val_max = $item.find('.goal-text').text();
367                $item.append('<div class="donate-progress-value"> <span class="raised"> <span class="title">Raised</span> <span><span class="value">' + $val_now + '</span></span> </span> <span class="goal"> <span class="title">Goal</span> <span><span class="value">' + $val_max + '</span></span></span></div>');
368
369                $item.find('.give-progress-bar span').append('<span>' + Math.floor(parseFloat($val_now.slice(1)) / parseFloat($val_max.slice(1)) * 100) + '%' + '</span>')
370            } else {
371                var $raised = $item.find('.give-percentage').text();
372                $item.append('<div class="donate-progress-value"> <span class="raised"> <span class="title">Raised</span> <span><span class="value">' + $raised + '</span></div>');
373                $item.find('.give-progress-bar span').append('<span>' + $raised + '</span>')
374            }
375        });
376
377        var $single_give = $('.type-give_forms');
378        var $title = $single_give.find('h1');
379        $title.html('<span>' + $title.text() + '</span>');
380        $title.addClass('special-heading underline text-center').removeClass('give-form-title entry-title');
381
382        if ($single_give.find('.give-goal-progress') && $single_give.find('.give_pre_form-content')) {
383            $single_give.find('.give_pre_form-content').after($single_give.find('.give-goal-progress'));
384        }
385
386        // $single_give.find('#give_checkout_user_info').addClass('ls ms');
387
388        $single_give.find('#give_checkout_user_info').find('.form-row').each(function () {
389            $(this).addClass('form-group').removeClass('form-row');
390        });
391
392        $single_give.find('#give-email-wrap').addClass('form-row-first form-row-responsive');
393
394        $single_give.find('#give_checkout_user_info').append($single_give.find('.give-donation-amount'));
395
396        if ($single_give.find('#give_checkout_user_info').find('.give-donation-amount').hasClass('set-price')) {
397            $single_give.find('#give_checkout_user_info').find('.give-donation-amount').addClass('form-row-last form-row-responsive form-control form-group d-flex align-items-center justify-content-center').removeClass('give-donation-amount');
398        } else {
399            $single_give.find('#give_checkout_user_info').find('.give-donation-amount').addClass('form-row-last form-row-responsive form-group').removeClass('give-donation-amount');
400        }
401
402        $single_give.find('.give-submit').addClass('btn btn-maincolor');
403    }
404
405    function cursorPointer() {
406        let isMobile = false; //initiate as false
407        // device detection
408        if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
409            || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
409sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) {
410            isMobile = true;
411        }
412        if (document.getElementsByClassName('circle-cursor') && !isMobile && document.querySelector('.item-layout-item-regular-6')) {
413            let $circle = document.querySelector('.circle-cursor');
414            function moveCursor(e) {
415                anime({
416                    targets: '.circle-cursor',
417                    duration: 50,
418                    left: e.clientX + "px",
419                    top: e.clientY + "px",
420                    easing: 'linear'
421                });
422            }
423            let $portfolio = $('.portfolio-shortcode');
424            $portfolio.on('mouseenter', '.owl-item', function(){
425                let title = $(this).find('.item-title').text().trim();
426                let date = $(this).find('time').text().trim();
427                $circle.querySelector('.title').textContent = title;
428                $circle.querySelector('.date').textContent = date;
429                $circle.classList.add('active')
430            })
431            $portfolio.on('mouseleave', '.owl-item', function(){
432                $circle.classList.remove('active')
433            })
434            document.addEventListener('mousemove', moveCursor);
435        }
436    }
437
438
439//function that initiating template plugins on document.ready event
440    function documentReadyInit() {
441
442        give();
443
444        initCustomOwlNav();
445
446        videoSlider();
447
448        cursorPointer();
449
450        ////////////
451        //mainmenu//
452        ////////////
453        if (jQuery().scrollbar) {
454            jQuery('[class*="scrollbar-"]').scrollbar();
455            //fix for firefox on mac
456            if (/mac/i.test(navigator.platform) && /firefox/i.test(navigator.userAgent)) {
457                jQuery('[class*="scrollbar-"]').addClass('scroll-content').wrap('<div class="scroll-wrapper firefox-on-macos"></div>');
458            }
459        }
460        if (jQuery().superfish) {
461            jQuery('ul.sf-menu').superfish({
462                popUpSelector: 'ul:not(.mega-menu ul), .mega-menu ',
463                delay: 700,
464                animation: {opacity: 'show', marginTop: 0},
465                animationOut: {opacity: 'hide', marginTop: 10},
466                speed: 200,
467                speedOut: 200,
468                disableHI: false,
469                cssArrows: true,
470                autoArrows: true,
471                onInit: function () {
472                    var $thisMenu = jQuery(this);
473                    $thisMenu.find('.sf-with-ul').after('<span class="sf-menu-item-mobile-toggler"/>');
474                    $thisMenu.find('.sf-menu-item-mobile-toggler').on('click', function (e) {
475                        var $parentLi = jQuery(this).parent();
476                        if ($parentLi.hasClass('sfHover')) {
477                            $parentLi.superfish('hide');
478                        } else {
479                            $parentLi.superfish('show');
480                        }
481                    });
482                }
483
484            });
485            jQuery('ul.sf-menu-side').superfish({
486                popUpSelector: 'ul:not(.mega-menu ul), .mega-menu ',
487                delay: 500,
488                animation: {opacity: 'show', height: 100 + '%'},
489                animationOut: {opacity: 'hide', height: 0},
490                speed: 400,
491                speedOut: 300,
492                disableHI: false,
493                cssArrows: true,
494                autoArrows: true
495            });
496        }
497
498
499        //toggle mobile menu
500        jQuery('.toggle_menu').on('click', function () {
501            jQuery(this).toggleClass('mobile-active');
502            $body.toggleClass('overflow-hidden');
503            jQuery('.page_header').first().toggleClass('mobile-active');
504        });
505
506        jQuery('.mainmenu_wrapper a, .mainmenu a').on('click', function () {
507            var $this = jQuery(this);
508            //If this is a local link or item with sumbenu - not toggling menu
509            if (($this.hasClass('sf-with-ul')) || !($this.attr('href').charAt(0) === '#')) {
510                return;
511            }
512            $this
513                .closest('.page_header')
514                .toggleClass('mobile-active')
515                .find('.toggle_menu')
516                .toggleClass('mobile-active');
517        });
518
519        //side header processing
520        var $sideHeader = jQuery('.page_header_side');
521        // toggle sub-menus visibility on menu-click
522        jQuery('ul.menu-side-click').find('li').each(function () {
523            var $thisLi = jQuery(this);
524            //toggle submenu only for menu items with submenu
525            if ($thisLi.find('ul').length) {
526                $thisLi
527                    .append('<span class="activate_submenu"></span>')
528                    //adding anchor
529                    .find('.activate_submenu')
530                    .on('click', function (e) {
531                        var $thisSpanOrA = jQuery(this);
532                        //if this is a link and it is already opened - going to link
533                        if (($thisSpanOrA.attr('href') === '#') || !($thisSpanOrA.parent().hasClass('active-submenu'))) {
534                            e.preventDefault();
535                        }
536                        if ($thisSpanOrA.parent().hasClass('active-submenu')) {
537                            e.preventDefault();
538                            $thisSpanOrA.parent().removeClass('active-submenu');
539                            return;
540                        }
541                        $thisLi.addClass('active-submenu').siblings().removeClass('active-submenu');
542                    });
543            } //eof sumbenu check
544        });
545
546        if ($sideHeader.length) {
547            jQuery('.toggle_menu_side').on('click', function () {
548                $body.toggleClass('overflow-hidden');
549                var $thisToggler = jQuery(this);
550                if ($thisToggler.hasClass('header-slide') || $thisToggler.hasClass('toggle_menu_side_special')) {
551                    $sideHeader.toggleClass('active-slide-side-header');
552                } else {
553                    if ($thisToggler.parent().hasClass('header_side_right')) {
554                        $body.toggleClass('active-side-header slide-right');
555                    } else {
556                        $body.toggleClass('active-side-header');
557                    }
558                }
559
560            });
561            //hidding side header on click outside header
562            $body.on('click', function (e) {
563                if (
564                    !(jQuery(e.target).closest('.page_header_side').length)
565                    && !($sideHeader.hasClass('page_header_side_sticked'))
566                    && !(jQuery(e.target).hasClass('toggle_menu_side_special'))
567                    && !($sideHeader.hasClass('vertical_menu_header'))) {
568                    $sideHeader.removeClass('active-slide-side-header');
569                    $body.removeClass('active-side-header slide-right');
570                    $body.removeClass('overflow-hidden');
571                }
572            });
573        } //sideHeader check
574
575        //1 and 2/3/4th level mainmenu offscreen fix
576        var MainWindowWidth = jQuery(window).width();
577        var boxWrapperWidth = jQuery('#box_wrapper').width();
578        jQuery(window).on('resize', function () {
579            MainWindowWidth = jQuery(window).width();
580            boxWrapperWidth = jQuery('#box_wrapper').width();
581        });
582        //2/3/4 levels
583        jQuery('.mainmenu_wrapper .sf-menu').on('mouseover', 'ul li', function () {
584            if (MainWindowWidth > 991) {
585                var $this = jQuery(this);
586                // checks if third level menu exist
587                var subMenuExist = $this.find('ul').length;
588                if (subMenuExist > 0) {
589                    var subMenuWidth = $this.find('ul, div').first().width();
590                    var subMenuOffset = $this.find('ul, div').first().parent().offset().left + subMenuWidth;
591                    // if sub menu is off screen, give new position
592                    if ((subMenuOffset + subMenuWidth) >
592 boxWrapperWidth) {
593                        var newSubMenuPosition = subMenuWidth + 0;
594                        $this.find('ul, div').first().css({
595                            left: -newSubMenuPosition,
596                        });
597                    } else {
598                        $this.find('ul, div').first().css({
599                            left: '100%',
600                        });
601                    }
602                }
603            }
604            //1st level
605        }).on('mouseover', '> li', function () {
606            if (MainWindowWidth > 991) {
607                var $this = jQuery(this);
608                var subMenuExist = $this.find('ul').length;
609                if (subMenuExist > 0) {
610                    var subMenuWidth = $this.find('ul').width();
611                    var subMenuOffset = $this.find('ul').parent().offset().left - (jQuery(window).width() / 2 - boxWrapperWidth / 2);
612                    // if sub menu is off screen, give new position
613                    if ((subMenuOffset + subMenuWidth) > boxWrapperWidth) {
614                        var newSubMenuPosition = boxWrapperWidth - (subMenuOffset + subMenuWidth);
615                        $this.find('ul').first().css({
616                            left: newSubMenuPosition,
617                        });
618                    }
619                }
620            }
621        });
622
623        /////////////////////////////////////////
624        //single page localscroll and scrollspy//
625        /////////////////////////////////////////
626        var navHeight = jQuery('.page_header').outerHeight(true);
627        if (jQuery('.mainmenu_wrapper').length) {
628            jQuery('body').scrollspy({
629                target: '.mainmenu_wrapper',
630                offset: navHeight
631            })
632        }
633        if (jQuery('.mainmenu_side_wrapper').length) {
634            jQuery('body').scrollspy({
635                target: '.mainmenu_side_wrapper',
636                offset: navHeight
637            });
638        }
639        if (jQuery().localScroll) {
640            jQuery('.mainmenu_wrapper > ul, .mainmenu_side_wrapper > ul, #land').localScroll({
641                duration: 900,
642                easing: 'easeInOutQuart',
643                offset: -navHeight + 10
644            });
645        }
646
647        //toTop
648        if (jQuery().UItoTop) {
649            jQuery().UItoTop({easingType: 'easeOutQuart'});
650        }
651
652        //parallax
653        if (jQuery().parallax) {
654            jQuery('.parallax').parallax("50%", 0.01);
655        }
656
657        // Date Time Picker
658        jQuery('[id ^= id-date]').each(function () {
659            var datePicker = jQuery(this);
660            datePicker.datetimepicker({
661                pickDate: datePicker.data('pick-date'),
662                pickTime: datePicker.data('pick-time'),
663                useSeconds: false,
664                language: datePicker.data('language'),
665                debug: false,
666            });
667        });
668
669        // Smooth scrolling for slider button
670        if (jQuery().localScroll) {
671            jQuery('.mainmenu_wrapper > ul, .mainmenu_side_wrapper > ul, #land, .scroll_button_wrap').localScroll({
672                duration: 900,
673                easing: 'easeInOutQuart',
674                offset: -navHeight + 10
675            });
676        }
677
678        if (jQuery().localScroll) {
679            jQuery('.divided-content').localScroll({
680                duration: 900,
681                easing: 'easeInOutQuart',
682                offset: -navHeight + 10
683            });
684        }
685
686        // Custom nav of owl carousel
687        var $carouselSection = jQuery('.owl_custom_nav');
688        var $carouselNav = $carouselSection.next('.owl-custom-nav');
689        $carouselNav.find('.owl-prev').on('click', function (e) {
690            e.preventDefault();
691            $carouselSection.trigger('prev.owl');
692        });
693        $carouselNav.find('.owl-next').on('click', function (e) {
694            e.preventDefault();
695            $carouselSection.trigger('next.owl');
696        });
697
698        if ($carouselSection.find('.owl-nav').hasClass('disabled')) $carouselNav.addClass('disabled');
699
700        initPhotoSwipe();
701
702        ////////////////////////////////////////
703        //init Twitter Bootstrap JS components//
704        ////////////////////////////////////////
705        //bootstrap carousel
706        if (jQuery().carousel) {
707            jQuery('.carousel').carousel();
708        }
709        //bootstrap tab - show first tab
710        jQuery('.tab-content').each(function () {
711            jQuery(this).find('.tab-pane').first().addClass('fade in');
712        });
713
714        //tooltip
715        if (jQuery().tooltip) {
716            jQuery('[data-toggle="tooltip"]').tooltip();
717        }
718
719        ////////////////
720        //owl carousel//
721        ////////////////
722        if (jQuery().owlCarousel) {
723            jQuery('.owl-carousel').each(function () {
724                var $carousel = jQuery(this);
725                var loop = $carousel.data('loop') ? $carousel.data('loop') : false;
726                var margin = ($carousel.data('margin') || $carousel.data('margin') == 0) ? $carousel.data('margin') : 30;
727                var nav = $carousel.data('nav') ? $carousel.data('nav') : false;
728                var dots = $carousel.data('dots') ? $carousel.data('dots') : false;
729                var themeClass = $carousel.data('themeclass') ? $carousel.data('themeclass') : 'owl-theme';
730                var center = $carousel.data('center') ? $carousel.data('center') : false;
731                var items = $carousel.data('items') ? $carousel.data('items') : 4;
732                var autoplay = $carousel.data('autoplay') ? $carousel.data('autoplay') : false;
733                var autoplayTimeout = $carousel.data('autoplaytimeout') ? $carousel.data('autoplaytimeout') : 3000;
734                var responsiveXs = $carousel.data('responsive-xs') ? $carousel.data('responsive-xs') : 1;
735                var responsiveSm = $carousel.data('responsive-sm') ? $carousel.data('responsive-sm') : 2;
736                var responsiveMd = $carousel.data('responsive-md') ? $carousel.data('responsive-md') : 3;
737                var responsiveLg = $carousel.data('responsive-lg') ? $carousel.data('responsive-lg') : 4;
738                var responsiveXl = $carousel.data('responsive-xl') ? $carousel.data('responsive-xl') : responsiveLg;
739                var filters = $carousel.data('filters') ? $carousel.data('filters') : false;
740                var prev = $carousel.data('prev') ? $carousel.data('prev') : false;
741                var next = $carousel.data('next') ? $carousel.data('next') : false;
742                var navContainer = $carousel.data('nav-container') ? $carousel.data('nav-container') : false;
743
744                if (filters) {
745                    $carousel.after($carousel.clone().addClass('owl-carousel-filter-cloned'));
746                    jQuery(filters).on('click', 'a', function (e) {
747                        //processing filter link
748                        e.preventDefault();
749                        if (jQuery(this).hasClass('selected')) {
750                            return;
751                        }
752                        var filterValue = jQuery(this).attr('data-filter');
753                        jQuery(this).siblings().removeClass('selected active');
754                        jQuery(this).addClass('selected active');
755
756                        //removing old items
757                        $carousel.find('.owl-item').length;
758                        for (var i = $carousel.find('.owl-item').length - 1; i >= 0; i--) {
759                            $carousel.trigger('remove.owl.carousel', [1]);
760                        }
761                        ;
762
763                        //adding new items
764                        var $filteredItems = jQuery($carousel.next().find(' > ' + filterValue).clone());
765                        $filteredItems.each(function () {
766                            $carousel.trigger('add.owl.carousel', jQuery(this));
767                            jQuery(this).addClass('scaleAppear');
768                        });
769
770                        $carousel.trigger('refresh.owl.carousel');
771
772                    });
773
774                } //filters
775
776                $carousel.owlCarousel({
777                    loop: loop,
778                    margin: margin,
779                    nav: nav,
780                    navText: [prev, next],
781                    autoplay: autoplay,
782                    autoplayTimeout: autoplayTimeout,
783                    dots: dots,
784                    themeClass: themeClass,
785                    center: center,
786                    items: items,
787                    navContainer: navContainer,
788                    responsive: {
789                        0: {
790                            items: responsiveXs
791                        },
792                        767: {
793                            items: responsiveSm
794                        },
795                        992: {
796                            items: responsiveMd
797                        },
798                        1200: {
799                            items: responsiveLg
800                        },
801                        1650: {
802                            items: responsiveXl
803                        }
804                    },
805                })
806                    .addClass(themeClass);
807                if (center) {
808                    $carousel.addClass('owl-center');
809                }
810            });
811
812        } //eof owl-carousel
813
814        //comingsoon counter
815        if (jQuery().countdown) {
816            //today date plus month for demo purpose
817            var demoDate = new Date();
818            demoDate.setMonth(demoDate.getMonth() + 1);
819            jQuery('#comingsoon-countdown').countdown({until: demoDate});
820        }
821
822        /////////////////////////////////////////////////
823        //PHP widgets - contact form, search, MailChimp//
824        /////////////////////////////////////////////////
825
826        //search modal
827        jQuery(".search_modal_button").on('click', function (e) {
828            e.preventDefault();
829            jQuery('#search_modal').modal('show').find('input').first().focus();
830        });
831
832        //background image teaser
833        jQuery(".bg_teaser").each(function () {
834            var $teaser = jQuery(this);
835            var imagePath = $teaser.find("img").first().attr("src");
836            if (imagePath) {
837                $teaser.css("background-image", "url(" + imagePath + ")");
838            }
839            if (!$teaser.find('.bg_overlay').length) {
840                $teaser.prepend('<div class="bg_overlay"/>');
841            }
842        });
843
844        //background image cover - set image inside element with this class as a background to cover whole container
845        jQuery(".cover-image").each(function () {
846            var $element = jQuery(this);
847            var $image = $element.find("img").first();
848            if (!$image.length) {
849                $image = $element.parent().find("img").first();
850            }
851            if (!$image.length) {
852                return;
853            }
854            var imagePath = $image.attr("src");
855            $element.css("background-image", "url(" + imagePath + ")");
856            var $imageParent = $image.parent();
857            //if image inside link - adding this link
858            if ($imageParent.is('a')) {
859                $element.prepend($image.parent().clone().html(''));
860            }
861        });
862
863        jQuery('.format-chat p').each(function () {
864            var $p = jQuery(this);
865            $p.html($p.html().replace(/^(\w+:)/, '<strong>$1</strong>'));
866        });
867    }//eof documentReadyInit
868
869
870    //function that initiating template plugins on window.load event
871    function windowLoadInit() {
872        //chart
873        pieChart();
874
875        //flexslider
876        if (jQuery().flexslider) {
877            //Team Slider Shortcode
878            jQuery('.flexslider.team-slider').flexslider({
879                directionNav: false,
880                manualControls: ".flex-control-nav-1 li.menu__item"
881            });
882
883            var $introSlider = jQuery(".intro_section .flexslider");
884            $introSlider.each(function (index) {
885                var $currentSlider = jQuery(this);
886                var autoplay = $currentSlider.data('slideshow') ? $currentSlider.data('slideshow') : false;
887                var slideshowSpeed = $currentSlider.data('slideshowspeed') ? $currentSlider.data('slideshowspeed') : 3000;
888                $currentSlider.flexslider({
889                    animation: "fade",
890                    pauseOnHover: true,
891                    useCSS: true,
892                    controlNav: true,
893                    directionNav: true,
894                    prevText: ">",
895                    nextText: "<",
896                    smoothHeight: false,
897                    slideshow: autoplay,
898                    slideshowSpeed: slideshowSpeed,
899                    animationSpeed: 600,
900                    start: function (slider) {
901                        slider.find('.slide_description').children().css({'visibility': 'hidden'});
902                        slider.find('.flex-active-slide .slide_description').children().each(function (index) {
903                            var self = jQuery(this);
904                            var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');
905                            setTimeout(function () {
906                                self.addClass("animated " + animationClass);
907                            }, index * 200);
908                        });
909                        slider.find('.flex-control-nav').find('a').each(function () {
910                            jQuery(this).html('0' + jQuery(this).html());
911                        });
912                    },
913                    after: function (slider) {
914                        slider.find('.flex-active-slide .slide_description').children().each(function (index) {
915                            var self = jQuery(this);
916                            var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');
917                            setTimeout(function () {
918                                self.addClass("animated " + animationClass);
919                            }, index * 200);
920                        });
921                    },
922                    end: function (slider) {
923                        slider.find('.slide_description').children().each(function () {
924                            var self = jQuery(this);
925                            var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation');
926                            self.removeClass('animated ' + animationClass).css({'visibility': 'hidden'});
927                        });
928                    },
929
930                })
931                    //wrapping nav with container
932                    .find('.flex-control-nav')
933                    .wrap('<div class="container nav-container"/>')
934            }); //intro_section flex slider
935
936            jQuery(".flexslider").each(function (index) {
937                var $currentSlider = jQuery(this);
938                var autoplay = $currentSlider.data('slideshow') ? $currentSlider.data('slideshow') : false;
939                var slideshowSpeed = $currentSlider.data('slideshowspeed') ? $currentSlider.data('slideshowspeed') : 3000;
940                //exit if intro slider already activated
941                if ($currentSlider.find('.flex-active-slide').length) {
942                    return;
943                }
944                $currentSlider.flexslider({
945                    animation: "fade",
946                    useCSS: true,
947                    controlNav: true,
948                    directionNav: false,
949                    prevText: ">",
950                    nextText: "<",
951                    smoothHeight: false,
952                    animationSpeed: 800,
953                    slideshow: autoplay,
954                    slideshowSpeed: slideshowSpeed
955                })
956            });
957        }
958
959        ////////////////////
960        //header processing/
961        ////////////////////
962        //stick header to top
963        //wrap header with div for smooth sticking
964        var $header = jQuery('.page_header').first();
965        if ($header.length) {
966            //hiding main menu 1st levele elements that do not fit width
967            menuHideExtraElements();
968            //mega menu
969            initMegaMenu();
970            var headerHeight = $header.outerHeight();
971            $header.wrap('<div class="page_header_wrapper"></div>').parent().css({height: headerHeight}); //wrap header for smooth stick and unstick
972            var $headerWrapper = $header.parent();
973
974            //get offset
975            var headerOffset = 0;
976            //check for sticked template headers
977            headerOffset = $header.offset().top;
978
979            //for boxed layout - show or hide main menu elements if width has been changed on affix
980            jQuery($header).on('affixed-top.bs.affix affixed.bs.affix affixed-bottom.bs.affix', function (e) {
981                if ($header.hasClass('affix-top')) {
982                    $header.parent().removeClass('affix-wrapper affix-bottom-wrapper').addClass('affix-top-wrapper');
983                } else if ($header.hasClass('affix')) {
984                    $header.parent().removeClass('affix-top-wrapper affix-bottom-wrapper').addClass('affix-wrapper');
985                } else if ($header.hasClass('affix-bottom')) {
986                    $header.parent().removeClass('affix-wrapper affix-top-wrapper').addClass('affix-bottom-wrapper');
987                } else {
988                    $header.parent().removeClass('affix-wrapper affix-top-wrapper affix-bottom-wrapper');
989                }
990                menuHideExtraElements();
991                initMegaMenu();
992            });
993
994            //if header has different height on afixed and affixed-top positions - correcting wrapper height
995            jQuery($header).on('affixed-top.bs.affix', function () {
996                $header.parent().css({height: headerHeight});
997            });
998
999            jQuery($header).affix({
1000                offset: {
1001                    top: headerOffset,
1002                    bottom: 0
1003                }
1004            });
1005        }
1006
1007        //aside affix
1008        affixSidebarInit();
1009
1010        jQuery('body').scrollspy('refresh');
1011
1012        //animation to elements on scroll
1013        if (jQuery().appear) {
1014            jQuery('.to_animate').appear();
1015            jQuery('.to_animate').filter(':appeared').each(function (index) {
1016                var self = jQuery(this);
1017                var animationClass = !self.data('animation') ? 'fadeInUp' : self.data('animation');
1018                var animationDelay = !self.data('delay') ? 210 : self.data('delay');
1019                setTimeout(function () {
1020                    self.addClass("animated " + animationClass);
1021                }, index * animationDelay);
1022            });
1023
1024            jQuery('body').on('appear', '.to_animate', function (e, $affected) {
1025                jQuery($affected).each(function (index) {
1026                    var self = jQuery(this);
1027                    var animationClass = !self.data('animation') ? 'fadeInUp' : self.data('animation');
1028                    var animationDelay = !self.data('delay') ? 210 : self.data('delay');
1029                    setTimeout(function () {
1030                        self.addClass("animated " + animationClass);
1031                    }, index * animationDelay);
1032                });
1033            });
1034
1035            //counters init on scroll
1036            jQuery('.counter').appear();
1037            jQuery('.counter').filter(':appeared').each(function (index) {
1038                if (jQuery(this).hasClass('counted')) {
1039                    return;
1040                } else {
1041                    jQuery(this).countTo().addClass('counted');
1042                }
1043            });
1044            jQuery('body').on('appear', '.counter', function (e, $affected) {
1045                jQuery($affected).each(function (index) {
1046                    if (jQuery(this).hasClass('counted')) {
1047                        return;
1048                    } else {
1049                        jQuery(this).countTo().addClass('counted');
1050                    }
1051
1052                });
1053            });
1054
1055            //bootstrap animated progressbar
1056            if (jQuery().progressbar) {
1057                jQuery('.progress .progress-bar').appear();
1058                jQuery('.progress .progress-bar').filter(':appeared').each(function (index) {
1059                    jQuery(this).progressbar({
1060                        transition_delay: 300
1061                    });
1062                });
1063                jQuery('body').on('appear', '.progress .progress-bar', function (e, $affected) {
1064                    jQuery($affected).each(function (index) {
1065                        jQuery(this).progressbar({
1066                            transition_delay: 300
1067                        });
1068                    });
1069                });
1070                //animate progress bar inside bootstrap tab
1071                jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
1072                    jQuery(jQuery(e.target).attr('href')).find('.progress .progress-bar').progressbar({
1073                        transition_delay: 300
1074                    });
1075                });
1076            }
1077        } //appear check
1078
1079        //flickr
1080        // use http://idgettr.com/ to find your ID
1081        if (jQuery().jflickrfeed) {
1082            var $flickr = jQuery("#flickr, .flickr_ul");
1083            if ($flickr.length) {
1084                $flickr.each(function () {
1085                    var $thisFlickrUl = jQuery(this);
1086                    if (!(jQuery(this).hasClass('flickr_loaded'))) {
1087                        var id = $thisFlickrUl.data('flickr-id') ? $thisFlickrUl.data('flickr-id') : 8;
1088                        var limit = $thisFlickrUl.data('flickr-number') ? $thisFlickrUl.data('flickr-number') : '131791558@N04';
1089                        $thisFlickrUl.jflickrfeed({
1090                            flickrbase: "http://api.flickr.com/services/feeds/",
1091                            limit: limit,
1092                            qstrings: {
1093                                id: id
1094                            },
1095                            itemTemplate: '<a href="{{image_b}}" class="photoswipe-link"><li><img alt="{{title}}" src="{{image_s}}" /></li></a>'
1096                        }, function (data) {
1097                            initPhotoSwipe();
1098                        }).addClass('flickr_loaded');
1099                    }
1100
1101                })
1102
1103            }
1104        }
1105
1106        //video images preview
1107        jQuery('.embed-placeholder').each(function () {
1108            jQuery(this).on('click', function (e) {
1109                e.preventDefault();
1110                var $thisLink = jQuery(this);
1111                if ($thisLink.attr('href') == '' || $thisLink.attr('href') == '#') {
1112                    $thisLink.replaceWith($thisLink.data('iframe').replace(/&amp/g, '&').replace(/$lt;/g, '<').replace(/&gt;/g, '>').replace(/$quot;/g, '"')).trigger('click');
1113                } else {
1114                    $thisLink.replaceWith('<iframe class="embed-responsive-item" src="' + $thisLink.attr('href') + '?rel=0&autoplay=1' + '"></iframe>');
1115                }
1116            });
1117        });
1118
1119        // particles.js
1120        let $sections = jQuery('.with-particles');
1121        $sections.each(function () {
1122            let $thisSection = jQuery(this);
1123            let id = $thisSection.find('.particles-js').attr('id');
1124            let ls = $thisSection.hasClass('ls');
1125            let ms = $thisSection.hasClass('ms');
1126            let ds = $thisSection.hasClass('ds');
1127            let color = ls ? '#031521' : ms ? '#031521' : ds ? '#fff' : 'fff';
1128            let size = '3';
1129
1130            particlesJS(id, {
1131                "particles": {
1132                    "number": {
1133                        "value": 100,
1134                        "density": {
1135                            "enable": true,
1136                            "value_area": 2000
1137                        }
1138                    },
1139                    "color": {
1140                        "value": color
1141                    },
1142                    "shape": {
1143                        "type": "circle",
1144                        "stroke": {
1145                            "width": 0,
1146                            "color": color
1147                        },
1148                    },
1149                    "opacity": {
1150                        "value": 0.1,
1151                        "random": false,
1152                        "anim": {
1153                            "enable": false,
1154                            "speed": 1,
1155                            "opacity_min": 0.1,
1156                            "sync": false
1157                        }
1158                    },
1159                    "size": {
1160                        "value": size,
1161                        "random": true,
1162                        "anim": {
1163                            "enable": false,
1164                            "speed": 40,
1165                            "size_min": 0.1,
1166                            "sync": false
1167                        }
1168                    },
1169                    "line_linked": {
1170                        "enable": true,
1171                        "distance": 300,
1172                        "color": color,
1173                        "opacity": 0.1,
1174                        "width": 1
1175                    },
1176                    "move": {
1177                        "enable": true,
1178                        "speed": 6,
1179                        "direction": "none",
1180                        "random": false,
1181                        "straight": false,
1182                        "out_mode": "out",
1183                        "bounce": false,
1184                        "attract": {
1185                            "enable": false,
1186                            "rotateX": 600,
1187                            "rotateY": 1200
1188                        }
1189                    }
1190                },
1191                "interactivity": {
1192                    "detect_on": "canvas",
1193                    "events": {
1194                        "onhover": {
1195                            "enable": true,
1196                            "mode": "grab"
1197                        },
1198                        "onclick": {
1199                            "enable": true,
1200                            "mode": "push"
1201                        },
1202                        "resize": true
1203                    },
1204                    "modes": {
1205                        "grab": {
1206                            "distance": 240,
1207                            "line_linked": {
1208                                "opacity": 1
1209                            }
1210                        },
1211                        "bubble": {
1212                            "distance": 400,
1213                            "size": 40,
1214                            "duration": 2,
1215                            "opacity": 8,
1216                            "speed": 3
1217                        },
1218                        "repulse": {
1219                            "distance": 200,
1220                            "duration": 0.4
1221                        },
1222                        "push": {
1223                            "particles_nb": 4
1224                        },
1225                        "remove": {
1226                            "particles_nb": 2
1227                        }
1228                    }
1229                },
1230                "retina_detect": true
1231            });
1232        });
1233
1234        // init Isotope
1235        jQuery('.isotope_container').each(function (index) {
1236            var $container = jQuery(this);
1237            var layoutMode = ($container.hasClass('masonry-layout')) ? 'masonry' : 'fitRows';
1238            $container.isotope({
1239                resizesContainer: true,
1240                resizable: true,
1241                percentPosition: true,
1242                layoutMode: layoutMode,
1243                masonry: {}
1244            });
1245
1246            var $filters = jQuery(this).attr('data-filters') ? jQuery(jQuery(this).attr('data-filters')) : $container.prev().find('.filters');
1247            // bind filter click
1248            if ($filters.length) {
1249                $filters.on('click', 'a', function (e) {
1250                    e.preventDefault();
1251                    var filterValue = jQuery(this).attr('data-filter');
1252                    $container.isotope({filter: filterValue});
1253                    jQuery(this).siblings().removeClass('selected active');
1254                    jQuery(this).addClass('selected active');
1255                });
1256            }
1257        });
1258
1259        // layout Isotope after each image loads
1260        jQuery('.isotope_container').imagesLoaded().progress(function () {
1261            jQuery('.isotope_container').isotope('layout');
1262        });
1263
1264        //Unyson or other messages modal
1265        var $messagesModal = jQuery('#messages_modal');
1266        if ($messagesModal.find('ul').length) {
1267            $messagesModal.modal('show');
1268        }
1269
1270        /* FullPage slider nav mouse icon */
1271        jQuery('.fp-right ul').append('<li id="moveDown" class="mouse-icon-2"></li>');
1272
1273        //page preloader
1274        jQuery(".preloader_image").fadeOut();
1275        // jQuery(".preloader").delay(200).fadeOut("slow").delay(200, function () {
1276        //     jQuery(this).remove();
1277        // });
1278        setTimeout(function () {
1279                jQuery(".preloader").fadeOut(800, function () {
1280                });
1281            },
1282            200
1283        );
1284
1285        // wrap Helpdesk faq icons
1286        jQuery('.wordpress-helpdesk-faq-boxed i').each(function () {
1287            var s = jQuery(this);
1288            s.wrap('<div class="icon-wrap"><div class="icon-inner"></div></div>');
1289        });
1290
1291        // wrap faq searchform
1292        jQuery('.wordpress-helpdesk-faq-searchform').parent().removeClass('wordpress-helpdesk-col-sm-10 wordpress-helpdesk-col-sm-offset-1').addClass('wordpress-helpdesk-faq-searchform-wrap');
1293
1294
1295    }//eof windowLoadInit
1296
1297    jQuery(document).ready(function () {
1298        documentReadyInit();
1299    }); //end of "document ready" event
1300
1301
1302    jQuery(window).on('load', function () {
1303        windowLoadInit();
1304    }); //end of "window load" event
1305
1306    jQuery(window).on('resize', function () {
1307
1308        jQuery('body').scrollspy('refresh');
1309
1310        //header processing
1311        menuHideExtraElements();
1312        initMegaMenu();
1313        var $header = jQuery('.page_header').first();
1314        //checking document scrolling position
1315        if ($header.length && !jQuery(document).scrollTop() && $header.first().data('bs.affix')) {
1316            $header.first().data('bs.affix').options.offset.top = $header.offset().top;
1317        }
1318        jQuery(".page_header_wrapper").css({height: $header.first().outerHeight()}); //editing header wrapper height for smooth stick and unstick
1319
1320    });
1321
1322//wrap forms select field corretcion (disable first choise)
1323    jQuery('.wrap-forms').find('select option:first-of-type').attr("disabled", "disabled").addClass('default-selected');
1324
1325    jQuery(window).on('scroll', function () {
1326        //circle progress bar
1327        pieChart();
1328    });
1329
1330    // wrap select fields
1331    jQuery('select').each(function () {
1332        var s = jQuery(this);
1333        s.wrap('<div class="select_container"></div>');
1334    });
1335
1336    //Replace search widget placeholder
1337    jQuery('.search-form').find('.search-field').attr("placeholder", "Search Keyword");
1338
1339    //Replace Helpdesk search placeholder
1340    jQuery('.wordpress-helpdesk-row').find('.wordpress-helpdesk-faq-searchterm').attr("placeholder", "Search Keyword");
1341
1342    //Replace "=" in Cryptocurrency plugin
1343    jQuery('.pricelist td:first-child').each(function () {
1344        var $this = jQuery(this);
1345        var text = $this.text();
1346        text = text.replace('=', '');
1347        $this.text(text);
1348        $this.after('<td class="equally">=</td>');
1349    });
1350
1351    jQuery('.calculator input:first-child').each(function () {
1352        var text = jQuery(this)[0].nextSibling;
1353        text.nodeValue = text.nodeValue.replace('=', '');
1354        jQuery(text).wrap('<span class="cur"></span>');
1355        var $this = jQuery('.cur');
1356        $this.after('<span class="equally">=</span>');
1357    });
1358
1359    /* Hide map overlay */
1360    jQuery('.wrap-map').on('click', '.close-box', function (e) {
1361        e.preventDefault();
1362        jQuery(this).closest('.fw-map-overlay').addClass('hidden');
1363    });
1364
1365    /* Header 6 page-topline open/close */
1366    jQuery('#page-topline-tab').on('click', 'a', function (e) {
1367        e.preventDefault();
1368        jQuery('.page-topline').toggleClass('transform-none');
1369    });
1370
1371    //Replace search widget placeholder
1372    jQuery('.single-member-carousel').find('.shortcode-team.owl-carousel').attr("data-nav-container", ".member-nav");
1373})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.