PageSourceSearch

https://www.robertofabbri.com/wp-content/themes/soundrise/js/main.js

js robertofabbri.com collected 2026-10-01 14:58:43 UTC 78,086 bytes, 2,179 lines download raw bytes

1var iron_vars = window.iron_vars || {},
2    IRON = window.IRON || {};
3
4var AudioPlaylists = [];
5
6var isMobile = false; 
7if(/(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) 
8    || /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 )|sy(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.
8substr(0,4))) { 
9    isMobile = true;
10}
11var isiPad = /ipad/i.test(navigator.userAgent.toLowerCase());
12var isiPhone = /iphone/i.test(navigator.userAgent.toLowerCase());
13var isSafari = /safari/i.test(navigator.userAgent.toLowerCase());
14
15var waypoints;
16(function($) {
17    "use strict";
18
19    IRON.$ = window.IRON.$ || {};
20
21    IRON.XHR = {
22        settings: {
23            url: iron_vars.ajaxurl,
24            type: 'POST'
25        }
26    };
27
28    IRON.state = iron_vars;
29
30    var DocumentTouch = window.DocumentTouch || {};
31    var ResponsiveHelper = window.ResponsiveHelper || {};
32    var PlaceholderInput = window.PlaceholderInput || {};
33    var TouchNav = window.TouchNav || {};
34    var lib = window.lib || {};
35
36    // page init
37    jQuery(function() {
38
39
40        /* Fancybox overlay fix */
41        // detect device type
42        var isTouchDevice = (function() {
43            try {
44                return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
45            } catch (e) {
46                return false;
47            }
48        }());
49
50        IRON.initFitVids();
51        IRON.initVideoLinks();
52        IRON.initDropDownClasses();
53        IRON.initAjaxBlocksLoad();
54        IRON.initLightbox();
55        IRON.initTwitter();
56        IRON.initSideMenu();
57
58        if (iron_vars.header_top_menu_hide_on_scroll == 1)
59            IRON.initTopMenu();
60
61        IRON.initCircleCentering();
62        IRON.initGridDisplayPhoto();
63        IRON.initGridDisplayAlbum();
64        IRON.initGridDisplayNews();
65        IRON.initGridDisplayVideo();
66
67        // if(!isMobile && !isiPad)
68        IRON.initPusherHeight();
69
70        IRON.initEventCenter();
71        IRON.initTwitterCenter();
72        IRON.initHeadsetCenter();
73        IRON.initIOSCenter();
74        IRON.initCountdownLang();
75        IRON.initCountdownCenter();
76        IRON.initMenuHierarchy();
77        IRON.initSubmenuPosition();
78        IRON.initSingleDisco();
79        IRON.initNewsletterLabel();
80        IRON.initBackToTop();
81        IRON.initScrollToSection();
82        IRON.initDisableHovers();
83        IRON.initVcAnimations();
84        IRON.initIsotope();
85        IRON.initWooImageBack();
86        IRON.initWpAdminBar();
87        IRON.initSocialShare();
88        IRON.btnPlayAudio()
89        IRON.pjax.init();
90        IRON.initPagePadding()
91
92        if (iron_vars.enable_fixed_header)
93            IRON.initFixedBar();
94
95        IRON.initCustomJS();
96
97        // fix options
98        var supportPositionFixed = ! isTouchDevice;
99        var overlaySelector = '#fancybox-overlay';
100
101        if ( ! isTouchDevice ) {
102            // create <style> rules
103            var head = document.getElementsByTagName('head')[0],
104                style = document.createElement('style'),
105                rules = document.createTextNode(overlaySelector + '{' +
106                    'position:fixed;' +
107                    'top:0;' +
108                    'left:0;' +
109                    '}');
110
111            // append style element
112            style.type = 'text/css';
113            if (style.styleSheet) {
114                style.styleSheet.cssText = rules.nodeValue;
115            } else {
116                style.appendChild(rules);
117            }
118            head.appendChild(style);
119        }
120    });
121
122    IRON.initWpAdminBar = function() {
123        if (iron_vars.wp_admin_bar) {
124            $('html').addClass('wp-admin-bar')
125        }
126    }
127
128    jQuery(window).on('load',function () {
129        setTimeout(function() {
130            IRON.initSameHeight();
131            jQuery(window).trigger('resize');
132        }, 200);
133    });
134
135    IRON.initSocialShare = function() {
136        if ($('.sharing_toolbox').length) {
137
138            if (iron_vars.social_enabled == "1") {
139
140
141                var image = $('.sharing_toolbox').data('image-social');
142                var url = document.URL
143                var shareFacebook = '';
144                var shareTwitter = '';
145                var shareGoogle = '';
146                var shareLinkedin = '';
147                var sharePinterest = '';
148
149                if (Object.prototype.hasOwnProperty.call(iron_vars.social, 'facebook')) {
150                    shareFacebook = '<a title="Share on Facebook" class="shareFacebook" href="http://www.facebook.com/sharer/sharer.php?u=' + url + '" target="_blank"><i class="fa-brands fa-facebook-square" aria-hidden="true"></i></a>';
151                }
152				if (Object.prototype.hasOwnProperty.call(iron_vars.social, 'twitter') ) {
153					shareTwitter = '<a title="Share on Twitter" class="shareTwitter" href= " ' + encodeURI('https://twitter.com/intent/tweet?url=' + url + '&text=' + document.title ) + ' " target="_blank"><i class="fa-brands fa-square-x-twitter" aria-hidden="true"></i></a>';
154				}
155                if (Object.prototype.hasOwnProperty.call(iron_vars.social, 'linkedin')) {
156                    shareLinkedin = '<a title="Share on LinkedIn" class="shareLinkedin" href="http://www.linkedin.com/shareArticle?mini=true&url=' + url + '" target="_blank"><i class="fa-brands fa-linkedin" aria-hidden="true"></i></a>';
157                }
158                if (Object.prototype.hasOwnProperty.call(iron_vars.social, 'pinterest')) {
159                    sharePinterest = '<a title="Share on Pinterest" class="sharePinterest" href="https://pinterest.com/pin/create/bookmarklet/?url=' + url + '&description=' + document.title + '&media=' + image 
159+ '" target="_blank"><i class="fa-brands fa-pinterest-square" aria-hidden="true"></i></a>';
160                }
161
162                $('.sharing_toolbox').append(shareFacebook + shareTwitter + shareGoogle + shareLinkedin + sharePinterest)
163            }
164
165        }
166    }
167
168    IRON.pagination = {
169        XHR: {},
170        $: {},
171        loadingClass: 'ajax-load',
172        ajaxBusy: false,
173        isotope: false
174    };
175
176    IRON.pagination.XHR = {
177        done: function(response, status, xhr) { // success : data, status, xhr
178
179            var IB = IRON.pagination;
180
181            if (response) {
182
183                if (IB.isotope) {
184                    var $newItems = $(response);
185                    IB.$.container.append($newItems).isotope('addItems', $newItems).isotope('reLayout');
186                    IB.$.container.fadeIn();
187                } else {
188                    IB.$.container.append(response).fadeIn();
189                }
190
191                var newMoreButton = IB.$.container.find('.button-more');
192                if (newMoreButton.length > 0) {
193                    IB.$.loadButton.replaceWith(newMoreButton[0].outerHTML);
194                    newMoreButton.remove();
195                    IB.$.loadButton = $('.button-more');
196
197                } else {
198                    IB.$.loadButton.remove();
199                }
200
201
202                IB.ajaxBusy = false;
203
204                //IRON.initTouchNav();
205
206                var callbacks = IB.$.loadButton.data('callback');
207                if (callbacks) {
208                    callbacks = callbacks.split(',');
209
210                    for (var i = 0; i < callbacks.length; i++) {
211                        var callback = IRON[callbacks[i]];
212
213                        if (typeof callback === 'function') {
214                            callback();
215                        }
216                    }
217                }
218
219                if (IB.method == 'paginate_scroll') {
220
221                    $(document).on('scroll', function(event) {
222                        if (!IB.ajaxBusy) {
223                            var $win = $(this),
224                                $doc = $(document),
225                                $foot = $('body > footer');
226
227                            if ($win.scrollTop() >= ($doc.height() - $win.height() - ($foot.height()))) {
228                                IB.$.loadButton.click();
229                            }
230                        }
231                    });
232
233                } else {
234                    IB.$.loadButton.css('visibility', 'visible').fadeIn();
235                }
236
237                IRON.initAjaxBlocksLoadEvent();
238
239            } else {
240
241                IB.$.loadButton.remove();
242                IB.XHR.fail(xhr, 'error', 404);
243            }
244        },
245        fail: function(xhr, status, error) { // error : xhr, status, error
246
247            var IB = IRON.pagination;
248
249            setTimeout(function() {
250                alert(IB.$.loadButton.data('warning'));
251            }, 100);
252        },
253        always: function() { // complete : data|xhr, status, xhr|error
254
255            var IB = IRON.pagination;
256            IB.$.loadButton.prop('disabled', false);
257
258            IB.$.container.removeClass(IB.loadingClass);
259
260        },
261        before: function(xhr) {
262
263            var IB = IRON.pagination;
264            IB.$.loadButton.prop('disabled', true);
265        }
266    };
267
268
269    IRON.initTwitter = function() {
270
271        $('.iron_widget_twitter .query').each(function() {
272
273            var $query = $(this);
274            var username = $(this).data('username');
275
276            $(function($) {
277                $query.tweet({
278                    modpath: iron_vars.plugins_url + 'js/twitter/',
279                    join_text: 'auto',
280                    username: (username ? username : 'envato'),
281                    count: 1,
282                    auto_join_text_default: '',
283                    auto_join_text_ed: '',
284                    auto_join_text_ing: '',
285                    auto_join_text_reply: '',
286                    auto_join_text_url: '',
287                    loading_text: 'loading tweets...'
288                }).bind('loaded', function() {
289                    $(window).resize();
290                });
291            });
292
293        });
294    };
295
296
297    IRON.initPagePadding = function(){
298        var applyPadding = ( !IRON.state.responsive && !IRON.state.menu.classic_menu_over_content )? true : false ;
299
300        if (IRON.state.menu.menu_type == 'classic-menu') {
301            var heightPadding = $('.classic-menu').outerHeight(true);
302            if ( !applyPadding ){
303                $('#wrapper').css('padding-top', '0')
304                return
305            }else{
306                $('#wrapper').css('padding-top', heightPadding + 'px')
307            }
308
309        }else{
310            if ( !applyPadding ){
311                if ( $('#wrapper').hasClass('sr_it-padtop') )
312                    $('#wrapper').removeClass('sr_it-padtop')
313                return
314            }else{
315                if( !$('#wrapper').hasClass('sr_it-padtop') )
316                    $('#wrapper').addClass('sr_it-padtop')
317            }
318        }
319
320
321    }
322
323    $(window).resize( IRON.initPagePadding )
324
325    IRON.initFixedBar = function() {
326
327        var top = 0;
328
329        var waypoint = new Waypoint({
330            element: document.getElementById('wrapper'),
331            handler: function(direction) {
332                if (direction == 'down') {
333                    $('#fixed-panel').animate({
334                        opacity: "1",
335                        top: top
336                    }, 400);
337                } else if (direction == 'up') {
338                    $('#fixed-panel').animate({
339                        opacity: "0",
340                        top: "-78"
341                    }, 200);
342                }
343            },
344            offset: -1
345        })
346    };
347
348
349    IRON.initAjaxBlocksLoad = function() {
350
351        IRON.pagination.XHR.request = {
352            dataType: 'text',
353            data: {
354                ajax: 1
355            },
356            beforeSend: IRON.pagination.XHR.before
357        };
358
359        IRON.pagination.XHR.request = $.extend(true, IRON.pagination.XHR.request, IRON.XHR.settings);
360        IRON.initAjaxBlocksLoadEvent();
361
362        $('a.button-more').trigger('click');
363
364    };
365
366    IRON.initAjaxBlocksLoadEvent = function() {
367
368
369        $(document).off('click', 'a.button-more');
370        $(document).on('click', 'a.button-more', function(e) {
371            e.preventDefault();
372
373            var IB = IRON.pagination,
374                $this = $(this);
375
376            IB.isotope = ($('.isotope-wrap').length > 0);
377
378            if (IB.ajaxBusy)
379                return;
380
381            IB.$.loadButton = $this;
382            IB.$.container = $('#' + IB.$.loadButton.data('rel'));
383            IRON.pagination.XHR.request.url = IB.$.loadButton.attr('href');
384            IRON.XHR.settings.url = IB.$.loadButton.attr('href');
385
386            IB.method = $this.data('paginate');
387
388            $.ajax(IB.XHR.request)
389                .done(IB.XHR.done)
390                .fail(IB.XHR.fail)
391                .always(IB.XHR.always);
392        });
393    };
394
395    // add classes if item has dropdown
396    IRON.initDropDownClasses = function() {
397        jQuery('.side-menu #nav li').each(function() {
398            var item = jQuery(this);
399            var drop = item.find('ul');
400            var link = item.find('a').eq(0);
401            if (drop.length) {
402                item.addClass('has-drop-down');
403                if (link.length) {
404                    link.addClass('has-drop-down-a');
405                }
406            }
407        });
408    };
409
410    // handle flexible video size
411    IRON.initFitVids = function() {
412        jQuery('.video-block').fitVids();
413    };
414
415
416    IRON.initVideoLinks = function() {
417
418        $('.link-mode-inline a').off('click');
419        $('.link-mode-inline a').on('click', function(e) {
420
421            e.preventDefault();
422
423            var wrap = $(this).find('.image');
424            var permalink = $(this).attr('href');
425            var wrap_height = wrap.css('height');
426
427
428            $('.link-mode-inline a').not($(this)).find('.fluid-width-video-wrapper').each(function() {
429
430                var parent = $(this).parent();
431                $(this).remove();
432
433                parent.find('.loader').remove();
434                parent.find('.play-button').fadeIn();
435                parent.find('img').fadeIn();
436                parent.animate({ opacity: 1 }, 1000);
437
438            });
439
440
441
442            wrap.css('height', wrap_height);
443            wrap.animate({ opacity: 0 });
444
445            $.ajax({
446                url: permalink,
447                dataType: 'html',
448                type: 'post',
449                data: { ajax: 1 },
450                success: function(embed) {
451
452                    wrap.find('.play-button').hide();
453                    wrap.find('img').hide();
454                    if ((isiPhone || isiPad) && isSafari) {
455                        wrap.append(embed);
456                    } else {
457                        wrap.append(embed).fitVids();
458                    }
459
460                    wrap.animate({ opacity: 1 }, 1000);
461                }
462
463            });
464        });
465
466        var scrolling = false;
467        $(document).on('scrollstart', function() {
468            scrolling = true;
469        });
470        $(document).on('scrollstop', function() {
471            scrolling = false;
472        });
473
474
475        $(window).on('resize', function() {
476
477            if ((window.outerWidth == screen.width) || scrolling)
478                return false;
479
480
481            $('.link-mode-inline a .image').each(function() {
482
483                $(this).css('height', '');
484
485            });
486            $('.link-mode-inline a').not($(this)).find('.fluid-width-video-wrapper').each(function() {
487
488                var parent = $(this).parent();
489                $(this).remove();
490
491                parent.find('.loader').remove();
492                parent.find('.play-button').fadeIn();
493                parent.find('img').fadeIn();
494                parent.animate({ opacity: 1 }, 1000);
495
496            });
497
498
499        });
500
501        $(document).off('click','.link-mode-lightbox a');
502        $(document).on('click','.link-mode-lightbox a', function(e) {
503
504            e.preventDefault();
505
506            var permalink = $(this).attr('href');
507
508            $.ajax({
509                url: permalink,
510                dataType: 'html',
511                type: 'post',
512                data: { ajax: 1 },
513                success: function(embed) {
514
515                    jQuery.fancybox(embed, {
516                        // fancybox API options
517                        fitToView: true,
518                        autoSize: false,
519                        closeClick: false,
520                        //openEffect: 'none',
521                        //closeEffect: 'none'
522                    }); // fancybox
523
524
525                }
526
527
528            });
529        });
530
531    };
532
533    // popups init
534    IRON.initPopups = function() {
535        jQuery('.panel').contentPopup({
536            mode: 'click',
537            popup: '.nav-holder',
538            btnOpen: '.opener'
539        });
540    };
541
542    // clear inputs on focus
543    IRON.initInputs = function() {
544        PlaceholderInput.replaceByOptions({
545            // filter options
546            clearInputs: true,
547            clearTextareas: true,
548            clearPasswords: true,
549            skipClass: 'default',
550            // input options
551            wrapWithElement: false,
552            showUntilTyping: false,
553            getParentByClass: false,
554            placeholderAttr: 'value'
555        });
556    };
557
558    // align blocks height
559    IRON.initSameHeight = function() {
560        jQuery('.widget-area.grid-cols').sameHeight({
561            elements: '.widget',
562            flexible: true,
563            multiLine: true
564        });
565    };
566
567
568    // align blocks height
569    IRON.initSameHeight = function() {
570        jQuery('.widget-area.grid-cols').sameHeight({
571            elements: '.widget',
572            flexible: true,
573            multiLine: true
574        });
575    };
576
577
578    // fancybox modal popup init
579    IRON.initLightbox = function() {
580        var lightboxtransition = iron_vars.lightbox_transition;
581        jQuery('a.lightbox, a[rel*="lightbox"]').fancybox({
582            padding: 10,
583            cyclic: false,
584            overlayShow: true,
585            overlayOpacity: 0.65,
586            overlayColor: '#000000',
587            titlePosition: 'inside',
588            transitionIn: 'fade',
589            transitionOut: 'fade',
590            prevEffect: lightboxtransition,
591            nextEffect: lightboxtransition
592        });
593    };
594
595
596
597
598    // Animation for side menu
599
600    IRON.animation = {
601        right: {
602            perspective: anime({
603                targets: ['#pusher', '#overlay .perspective'],
604                translateX: 0,
605                translateY: 0,
606                translateZ: -1000,
607                rotateY: 15,
608                autoplay: false,
609                easing: 'linear',
610                duration: 350
611            })
612
613        },
614        left: {
615            perspective: anime({
616                targets: ['#pusher', '#overlay .perspective'],
617                translateX: 0,
618                translateY: 0,
619                translateZ: -1000,
620                rotateY: -15,
621                autoplay: false,
622                easing: 'linear',
623                duration: 350
624            })
625        },
626        overlay :  anime.timeline({
627            autoplay: false,
628            direction: 'alternate',
629            loop:false
630
631        })
632
633    }
634
635    IRON.animation.overlay.add({
636        targets: '.side-menu',
637        opacity:[0,1],
638        duration: 800,
639        elasticity: 0,
640        easing: 'linear',
641        offset: 1,
642    }).add({
643        targets: '.content-menu',
644        opacity:[0,1],
645        scale: [0.9,1],
646        duration: 250,
647        offset: '-=250',
648        easing: 'linear',
649        elasticity: 100
650    })
651
652
653
654    $(window).resize(function(){
655        IRON.initSideMenu()
656
657
658
659        if ( $('.side-menu.type2 .content-menu').outerHeight(true) > $(window).height() ) {
660            $('.side-menu.type2').addClass('smallOverlay')
661        }else if ( $('.side-menu.type2').hasClass('smallOverlay') ) {
662            $('.side-menu.type2').removeClass('smallOverlay')
663        }
664    })
665    /* SIDE MENU */
666    IRON.initSideMenu = function() {
667
668        var typeside = iron_vars.menu.top_menu_position;
669        var typeclass = iron_vars.menu.menu_transition;
670        var mobile = false;
671
672        if( $(window).width() < 1144 ){
673            var mobile = true;
674            typeclass = 'type2'
675
676        }
677
678        var bodyScroll = {}
679        var pusherScroll = {}
680            // debugger
681        jQuery('.side-menu, #pusher').removeClass('type1').removeClass('type2').removeClass('type3');
682        jQuery('.site-logo,.menu-toggle,.side-menu,#pusher').addClass(typeside);
683        jQuery('.side-menu, #pusher').addClass(typeclass);
684
685
686        jQuery(".menu-toggle").off('click').on('click', function(event) {
687
688            if ( !$('.side-menu').hasClass('open') ) {
689            var bodyScroll = $(document).scrollTop()
690
691
692                event.preventDefault();
693                var timeout = 1;
694
695
696                setTimeout(function() {
697                    if (typeclass == 'type3'){
698                        IRON.animation.right.perspective.reset()
699                        IRON.animation.right.perspective.play()
700                        $('body').addClass('pushMenu');
701                        // jQuery('.menu-toggle').css('display', 'none');
702                        jQuery('.site-logo').css('opacity', '0');
703                        jQuery('.header-top-menu').fadeOut();
704                        jQuery('#pusher').addClass('open');
705                        $('.side-menu').css('opacity', '1')
706                        // $('.side-menu').css('z-index', '2001')
707                        $('.content-menu').css('transform', 'scale(1)')
708                        $('.content-menu').css('opacity', '1')
709                        $('#pusher').scrollTop(bodyScroll)
710
711                    }
712
713                    if (typeclass == 'type2') {
714
715                        IRON.animation.overlay.reset()
716                        IRON.animation.overlay.play()
717                        jQuery('#pusher').addClass('open');
718                        $('#pusher').scrollTop(bodyScroll)
719
720                    }
721                        jQuery('.menu-toggle').addClass('toggled')
722                        jQuery('#pusher').addClass(typeclass);
723                        jQuery('.side-menu').addClass('open');
724                }, 1);
725            }
726
727            if ( $('.side-menu').hasClass('open') ) {
728
729                var pusherScroll = $('#pusher').scrollTop()
730
731
732                if (typeclass == 'type3') {
733
734                    IRON.animation.right.perspective.reverse()
735                    IRON.animation.right.perspective.play()
736
737                    $('body').removeClass('pushMenu');
738                    jQuery('.panel-networks').css('opacity', '1');
739                    jQuery('.site-logo').css('opacity', '1');
740                    jQuery('.header-top-menu').fadeIn();
741
742
743                    jQuery('.side-menu').removeClass('open');
744
745                    setTimeout(function(){
746                        $('#pusher').removeClass('open');
747                        $(document).scrollTop(pusherScroll)
748                    }, 350)
749
750                    setTimeout(function(){
751                        jQuery('.nav-menu li a, ul.nav-menu ul a, .nav-menu ul ul a').css('pointer-events', 'auto');
752                        jQuery('ul.nav-menu a').css('opacity', '1');
753                        jQuery('.sub-menu').removeClass('active');
754                    }, 1200 )
755
756                }
757                if (typeclass == 'type2') {
758
759                    IRON.animation.overlay.reverse()
760                    IRON.animation.overlay.play()
761
762
763
764
765                    setTimeout(function(){
766                        $('#pusher').removeClass('open');
767                        jQuery('.side-menu').removeClass('open');
768                        jQuery('.nav-menu li a, ul.nav-menu ul a, .nav-menu ul ul a').css('pointer-events', 'auto');
769                        jQuery('ul.nav-menu a').css('opacity', '1');
770                        jQuery('.sub-menu').removeClass('active');
771                        if( mobile == true){
772                            $(document).scrollTop(pusherScroll)
773                        }
774                    }, 1200 )
775
776                }
777                if (typeclass == 'type1'){
778                    $('#pusher').removeClass('open');
779                    jQuery('.side-menu').removeClass('open');
780                    jQuery('.nav-menu li a, ul.nav-menu ul a, .nav-menu ul ul a').css('pointer-events', 'auto');
781                    jQuery('ul.nav-menu a').css('opacity', '1');
782                    jQuery('.sub-menu').removeClass('active');
783                }
784
785                jQuery('.menu-toggle').removeClass('toggled')
786
787
788
789
790                }
791        });
792        jQuery('.side-menu').css('display', 'block');
793    };
794//
795    IRON.initTopMenu = function() {
796
797        $(document).on('scroll', function() {
798
799            if ($(this).scrollTop() >= 400) {
800
801                jQuery('.header-top-menu').stop().animate({
802                    top: '-100px',
803                    opacity: 0
804                }, 600);
805            } else {
806
807                if ($('html').hasClass('wp-admin-bar')){
808                    var topHeight = '31px';
809                }else{
810                    var topHeight = '0px';
811                }
812                jQuery('.header-top-menu').stop().animate({     
813                    top: topHeight,
814                    opacity: 1
815                }, 600);
816            }
817
818        });
819
820    };
821
822    /* CIRCLE CENTERING */
823    IRON.initCircleCentering = function() {
824        jQuery(".centering, .circle .wpb_wrapper").each(function() {
825            var halfheight = (jQuery(this).height()) / 2;
826            jQuery(this).css('margin-top', (-halfheight));
827        });
828
829        jQuery(window).resize(function() {
830            if (jQuery(window).innerWidth() < 660) {
831                if (jQuery(".circle").length > 0) {
832                    jQuery(".circle").each(function() {
833                        jQuery(this).closest(".wpb_column").css({
834                            "float": "none",
835                            "margin-left": "0",
836                            "width": "100%"
837                        });
838                    });
839                }
840            } else {
841                if (jQuery(".circle").length > 0) {
842                    jQuery(".circle").each(function() {
843                        jQuery(this).closest(".wpb_column").removeAttr("style");
844                    });
845                }
846            }
847        });
848    };
849
850    /* PHOTO ALBUM GRID DISPLAY */
851    IRON.initGridDisplayPhoto = function() {
852        setTimeout(function() {
853            jQuery('.listing-section.photo').each(function() {
854                var leftColumnHeight = 0;
855                var rightColumnHeight = 0;
856                var $articles = jQuery(this).find('.photo-wrap');
857                for (var i = 0; i < $articles.length; i++) {
858                    if (leftColumnHeight > rightColumnHeight) {
859                        rightColumnHeight += $articles.eq(i).addClass('right').outerHeight(true);
860                    } else {
861                        leftColumnHeight += $articles.eq(i).outerHeight(true);
862                    }
863                }
864                jQuery(this).css('visibility', 'visible');
865            });
866        }, 250);
867        setTimeout(function() {
868            jQuery('.photo-wrap').css('opacity', '1');
869        }, 250);
870    };
871
872    /* MUSIC ALBUM GRID DISPLAY */
873    IRON.initGridDisplayAlbum = function() {
874        setTimeout(function() {
875            jQuery('.two_column_album').each(function() {
876                var leftColumnHeight = 0;
877                var rightColumnHeight = 0;
878                var $articles = jQuery(this).find('.media-block');
879                for (var i = 0; i < $articles.length; i++) {
880                    if (leftColumnHeight > rightColumnHeight) {
881                        rightColumnHeight += $articles.eq(i).addClass('right').outerHeight(true);
882                    } else {
883                        leftColumnHeight += $articles.eq(i).outerHeight(true);
884                    }
885                }
886                jQuery(this).css('visibility', 'visible');
887            });
888        }, 250);
889        setTimeout(function() {
890            jQuery('.two_column_album .media-block').css('opacity', '1');
891        }, 250);
892    };
893
894    /* NEWS GRID DISPLAY */
895    IRON.initGridDisplayNews = function() {
896        setTimeout(function() {
897            jQuery('.iron_widget_posts, .articles-section').each(function() {
898                var leftColumnHeight = 0;
899                var rightColumnHeight = 0;
900                var $articles = jQuery(this).find('.news-grid-wrap');
901                for (var i = 0; i < $articles.length; i++) {
902                    if (leftColumnHeight > rightColumnHeight) {
903                        rightColumnHeight += $articles.eq(i).addClass('right').outerHeight(true);
904                    } else {
905                        leftColumnHeight += $articles.eq(i).outerHeight(true);
906                    }
907                }
908                jQuery(this).css('visibility', 'visible');
909            });
910        }, 250);
911        setTimeout(function() {
912            jQuery('.news-grid-wrap').css('opacity', '1');
913        }, 250);
914    };
915
916    /* VIDEO GRID DISPLAY */
917    IRON.initGridDisplayVideo = function() {
918        setTimeout(function() {
919            jQuery('.sr_it-videolist-container.video_grid, .listing-section.videos').each(function() {
920                var leftColumnHeight = 0;
921                var rightColumnHeight = 0;
922                var $articles = jQuery(this).find('.videogrid');
923                for (var i = 0; i < $articles.length; i++) {
924                    if (leftColumnHeight > rightColumnHeight) {
925                        rightColumnHeight += $articles.eq(i).addClass('right').outerHeight(true);
926                    } else {
927                        leftColumnHeight += $articles.eq(i).outerHeight(true);
928                    }
929                }
930                jQuery(this).css('visibility', 'visible');
931            });
932        }, 250);
933        setTimeout(function() {
934            jQuery('.videogrid').css('opacity', '1');
935        }, 250);
936    };
937
938    // pjax
939
940    IRON.btnPlayAudio = function() {
941        jQuery('.pjax-container').on('click', '.vc_btn3[data-album="1"]', function() {
942            event.preventDefault();
943            IRON.continuousPlayer.setPlaylist(jQuery(this))
944            IRON.continuousPlayer.setCurrentTrack(0, jQuery(this))
945        })
946    }
947
948    IRON.fetch_Oembed = function() {
949        if ($('.sr_it-videolist-screen').length) {
950            $(document).off('click', '.sr_it-videolist-list article')
951            $(document).on('click', '.sr_it-videolist-list article', function(e) {
952                e.preventDefault()
953                var oembedURL = $(this).attr('data-url')
954
955                jQuery.post(
956                    ajax_vars.ajax_url, {
957                        'action': 'fetch_Oembed',
958                        'oembedURL': oembedURL
959
960                    },
961                    function(data, textStatus, xhr) {
962
963                        if ('success' == textStatus && data.length) {
964                            $('.sr_it-videolist-screen').html(data)
965                        };
966                    })
967
968
969            })
970        }
971    }
972
973    IRON.fetch_Oembed();
974
975    IRON.grid_column = function() {
976
977        $.each(IRON.grid, function(index, value) {
978            value.inview.destroy()
979            value.inviewBottom.destroy()
980
981            if (value.rellax.hasOwnProperty('destroy'))
982                value.rellax.destroy()
983        })
984
985        IRON.grid = [];
986        if ($('.iron_widget_grid').length) {
987
988            $('.sr_it-grid').each(function(e, el) {
989
990                var grid = $(this);
991                var column = grid.attr('data-column');
992                var parallax = grid.attr('data-parallax');
993                var speeds = JSON.parse(grid.attr('data-parallax-speed'));
994                var gridClassMap = grid.attr('class').split(' ').map(function(elclass) {
995                    return '.' + elclass + ''
996                })
997
998
999                for (var i = 1; i <= column; i++) {
1000
1001
1002                    var colunmContainer = $('<div/>', {
1003                        'class': 'sr_it-column-' + column + ' rellax sr_it-col-' + i + '',
1004                        'data-rellax-speed': speeds[i - 1],
1005                        'data-rellax-percentage': '0'
1006                    }).appendTo(grid)
1007
1008                    var elements = grid.find('article:not(.columnyse):nth-of-type(' + column + 'n+' + i + ')')
1009                    elements.clone().appendTo(colunmContainer).addClass('columnyse')
1010
1011
1012                }
1013
1014                var elementsBoom = grid.find('article:not(.sr_it-column-' + column + ' article)')
1015                elementsBoom.remove()
1016
1017                if (grid.attr('data-parallax') === '0' || $(window).width() < 768) {
1018                    grid.addClass('columnactive')
1019                }
1020                if (grid.attr('data-parallax') !== '0' && $(window).width() > 768) {
1021
1022                    var gridObj = {
1023                        inview: {},
1024                        inviewBottom: {},
1025                        rellax: {}
1026                    }
1027
1028                    grid.addClass('columnactive')
1029
1030                    gridObj.inview = new Waypoint({
1031                        element: grid[0],
1032                        handler: function(direction) {
1033                            if ('up' === direction) {
1034                                gridObj.rellax.destroy()
1035                                // grid.removeClass('columnactive')
1036                            }
1037                            if ('down' === direction) {
1038                                gridObj.rellax = new Rellax('#' + grid[0].id + ' .rellax')
1039                                // grid.addClass('columnactive')
1040                            }
1041                        },
1042                        offset: function() {
1043                            return (Waypoint.viewportHeight() + 0)
1044                        }
1045                    })
1046                    gridObj.inviewBottom = new Waypoint({
1047                        element: grid[0],
1048                        handler: function(direction) {
1049                            if ('up' === direction) {
1050                                gridObj.rellax = new Rellax('#' + grid[0].id + ' .rellax')
1051                                // grid.addClass('columnactive')
1052                            }
1053                            if ('down' === direction) {
1054                                gridObj.rellax.destroy()
1055                                // grid.removeClass('columnactive')
1056                            }
1057                        },
1058                        offset: function() {
1059                            return -(this.element.clientHeight + (Waypoint.viewportHeight() / 2))
1060                        }
1061                    })
1062
1063
1064                    IRON.grid.push(gridObj);
1065                }
1066            })
1067
1068
1069
1070        }
1071    }
1072    jQuery(window).resize(function(){
1073        Waypoint.refreshAll()
1074    })
1075    IRON.grid_column();
1076
1077
1078
1079
1080    IRON.pjax = {
1081
1082        oldDocument: '',
1083        newDocument: '',
1084        enablePjax: IRON.state.enable_ajax,
1085
1086        defaultBarba: function() {
1087            var pjax = this;
1088            var originalFn = Barba.Pjax.Dom.parseResponse;
1089            var originalCheck = Barba.Pjax.preventCheck
1090
1091            Barba.Pjax.Dom.wrapperId = 'pusher';
1092            Barba.Pjax.Dom.containerClass = 'pjax-container';
1093            Barba.Pjax.ignoreClassLink = 'no-ajax';
1094
1095            Barba.Pjax.Dom.parseResponse = function(response) {
1096                pjax.oldDocument = window.document;
1097                var parser = new DOMParser();
1098                pjax.newDocument = parser.parseFromString(response, "text/html");
1099
1100
1101
1102                return originalFn.apply(Barba.Pjax.Dom, arguments);
1103
1104            };
1105
1106            Barba.Pjax.preventCheck = function(evt, element) {
1107                if (element == null || element.hasAttribute('data-vc-container') || element.hasAttribute('data-slide')) {
1108                    return false
1109                }
1110
1111                var elementToAvoidList = $("#wpadminbar a, .esgbox, .link-mode-inline a, .link-mode-lightbox a, .languages-selector a, .lang-item a, .no-ajax a");
1112                var YouCanGo = true;
1113
1114                elementToAvoidList.each(function(e, el) {
1115                        if (el == element)
1116                            YouCanGo = false;
1117                    })
1118                    // debugger
1119                if (element.hash != '' && element != null) {
1120
1121                    var scrollToElement = $(element.hash).offset();
1122                    var topPosition = scrollToElement.top
1123
1124                    if( jQuery('.classic-menu').length ){
1125                        if( jQuery('.classic-menu').hasClass('responsive') ){
1126                            var topPosition = topPosition - jQuery('.responsive-header').outerHeight();
1127                        }else{
1128                            var topPosition = topPosition - jQuery('.classic-menu').outerHeight();
1129                        }
1130                    }
1131
1132                    $('html, body').animate({
1133                        scrollTop: topPosition
1134                    }, 800);
1135                }
1136
1137                if (!YouCanGo)
1138                    return YouCanGo;
1139
1140                return originalCheck.apply(Barba.Pjax, arguments);
1141            }
1142        },
1143
1144        init: function() {
1145
1146            var pjax = this;
1147            pjax.defaultBarba();
1148
1149            if (pjax.enablePjax && !$('body').hasClass('woocommerce-page')) {
1150                Barba.Pjax.start();
1151                $('body').addClass('pjax');
1152            }
1153
1154
1155            Barba.Pjax.getTransition = function() {
1156                return pjax.HideShowTransition();
1157            };
1158
1159            Barba.Dispatcher.on('transitionCompleted', function() {
1160
1161                pjax.customJs()
1162                IRON.initCustomJS()
1163                IRON.btnPlayAudio()
1164                IRON.initCountdownLang();
1165                IRON.initCountdownCenter();
1166                IRON.initPagePadding();
1167                pjax.ironAudioPlayer();
1168                pjax.wooCommerce();
1169                pjax.vc_slide();
1170                if (typeof eventsFilter === 'function') {
1171                    eventsFilter();
1172                }
1173                if (typeof vc_js === 'function') {
1174                    vc_js()
1175                }
1176
1177
1178
1179
1180                IRON.grid_column()
1181
1182                // if ($("[data-vc-grid-settings]").length) {
1183                // $("[data-vc-grid-settings]").vcGrid()
1184                // }
1185
1186            });
1187
1188            Barba.Dispatcher.on('initStateChange', function() {
1189                if (typeof ga === 'function') {
1190                    ga('send', 'pageview', location.pathname);
1191                }
1192            })
1193
1194            Barba.Dispatcher.on('newPageReady', function() {
1195
1196
1197
1198                pjax.swapMenuClass()
1199                pjax.swapWPAdminbar()
1200				pjax.swapLanguageLink()
1201
1202
1203
1204                pjax.cleanHtml()
1205                pjax.updateState()
1206                if (IRON.state.menu.menu_type == 'classic-menu') {
1207
1208                    IRON.setupMenu()
1209                }
1210
1211                pjax.swapLogo();
1212
1213
1214
1215                IRON.initFitVids();
1216                IRON.initVideoLinks();
1217                IRON.initDropDownClasses();
1218                IRON.initAjaxBlocksLoad();
1219                IRON.initLightbox();
1220                IRON.initTwitter();
1221                // IRON.initSideMenu();
1222
1223                if (iron_vars.header_top_menu_hide_on_scroll == 1)
1224                    IRON.initTopMenu();
1225
1226                IRON.initCircleCentering();
1227                IRON.initGridDisplayPhoto();
1228                IRON.initGridDisplayAlbum();
1229                IRON.initGridDisplayNews();
1230                IRON.initGridDisplayVideo();
1231
1232                if (!isMobile && !isiPad)
1233                    IRON.initPusherHeight();
1234
1235                IRON.initEventCenter();
1236                IRON.initTwitterCenter();
1237                IRON.initHeadsetCenter();
1238                IRON.initIOSCenter();
1239                IRON.initSubmenuPosition();
1240                IRON.initSingleDisco();
1241                IRON.initNewsletterLabel();
1242                // IRON.initScrollToSection();
1243                IRON.initDisableHovers();
1244                IRON.initVcAnimations();
1245                IRON.initIsotope();
1246                IRON.initWooImageBack();
1247                IRON.initWpAdminBar();
1248                IRON.initSocialShare();
1249                IRON.fetch_Oembed();
1250
1251                if (IRON.state.menu.menu_type == 'classic-menu') {
1252                    $(window).on('resize', responsiveMenu);
1253                }
1254
1255            });
1256
1257
1258        },
1259
1260        AjaxPagePass: function() {
1261            var pjax = this;
1262            if ($(pjax.newDocument).find('body.woocommerce').length) {
1263                window.location.reload()
1264                return false;
1265            } else {
1266                return true;
1267            }
1268        },
1269        swapMenuClass: function() {
1270            var pjax = this;
1271            $('#menu-main-menu li').removeClass('current-menu-ancestor current-menu-parent current-menu-item current_page_item')
1272
1273            $('#' + $(pjax.newDocument).find('#menu-main-menu li.current-menu-ancestor').attr('id')).addClass('current-menu-ancestor')
1274            $('#' + $(pjax.newDocument).find('#menu-main-menu li.current-menu-parent').attr('id')).addClass('current-menu-parent')
1275            $('#' + $(pjax.newDocument).find('#menu-main-menu li.current-menu-item').attr('id')).addClass('current-menu-item')
1276            $('#' + $(pjax.newDocument).find('#menu-main-menu li.current_page_item').attr('id')).addClass('current_page_item')
1277
1278
1279        },
1280        swapLogo: function() {
1281            var logoSelect = ( IRON.state.logo.page_logo_select !== false ) ? IRON.state.logo.page_logo_select : IRON.state.logo.logo_select;
1282            if(typeof IRON.state.logo[logoSelect] !== "undefined"){
1283        		var logo_url = IRON.state.logo[logoSelect].url.slice( IRON.state.logo[logoSelect].url.indexOf('/') )
1284        		var retina_logo_url = IRON.state.logo[logoSelect].url_retina.slice( IRON.state.logo[logoSelect].url_retina.indexOf('/') )
1285        	}
1286            $('.site-logo img').attr('src', logo_url);
1287            $('.site-logo img').attr('srcset', logo_url+' 1x, '+retina_logo_url+' 2x');
1288        },
1289        swapLanguageLink : function(){
1290			var pjax = this;
1291
1292			if ( $( pjax.newDocument ).find('.languages-selector').length ){
1293				var langContent = $( pjax.newDocument ).find('.languages-selector').html()
1294				$( pjax.oldDocument ).find('.languages-selector').html(langContent)
1295			}
1296		},
1297
1298        updateState: function() {
1299            var pjax = this;
1300
1301            var pjax_iron_vars = $(pjax.newDocument).find('script[src$="'+ iron_vars.theme_url +'/js/main.js"]').prev('script').text();
1302            var pos1 = pjax_iron_vars.indexOf('{');
1303            var pos2 = pjax_iron_vars.lastIndexOf('}') - pjax_iron_vars.length + 1;
1304
1305            pjax_iron_vars = JSON.parse(pjax_iron_vars.slice(pos1, pos2));
1306
1307            for (var prop in pjax_iron_vars) {
1308                IRON.state[prop] = pjax_iron_vars[prop];
1309            }
1310
1311
1312
1313        },
1314
1315        HideShowTransition: function() {
1316            var pjax = this;
1317            var overlay = $('#overlay .perspective');
1318            var transition = Barba.BaseTransition.extend({
1319                start: function() {
1320                    Promise
1321                        .all([this.newContainerLoading, this.fadeOut()])
1322                        .then(this.fadeIn.bind(this))
1323                },
1324
1325                fadeOut: function() {
1326                    var _this = this;
1327                    
1328                    $('html, body').animate({
1329                    scrollTop: 0
1330                    }, 800);
1331
1332                    if ( $('.side-menu').hasClass('open') ) {
1333                        $('.menu-toggle').trigger('click')
1334                    }
1335                    // $('#pusher').removeAttr('style')
1336                    var fadeOut = anime({
1337                        targets: [this.oldContainer, '#overlay .perspective'],
1338                        opacity: 0,
1339                        // scale:0.9,
1340                        easing: 'easeOutExpo',
1341                        duration: 1000,
1342                    })
1343                    return fadeOut.finished;
1344                },
1345
1346
1347                fadeIn: function() {
1348                    var _this = this;
1349                    var $el = $(this.newContainer);
1350                    // pjax.AjaxPagePass();
1351                    if (pjax.AjaxPagePass()) {
1352
1353                        pjax.swapBodyClass();
1354                        $(this.oldContainer).hide();
1355                        pjax.customCss();
1356                        $el.css({
1357                            visibility: 'visible',
1358                            opacity: 0
1359                        });
1360
1361
1362                        var fadeIn = anime({
1363                            targets: [this.newContainer, '#overlay .perspective'],
1364                            opacity: 1,
1365                            // scale:1,
1366                            easing: 'easeOutExpo',
1367                            duration: 1000,
1368                        })
1369                        return fadeIn.finished.then(_this.done())
1370
1371                    }
1372                }
1373            });
1374
1375            return transition;
1376
1377        },
1378        customCss: function() {
1379            var pjax = this;
1380            var oldStyleSheet = $(pjax.oldDocument).find('link[rel="stylesheet"]')
1381            var newStyleSheet = $(pjax.newDocument).find('link[rel="stylesheet"]')
1382
1383
1384            $(pjax.oldDocument).find('style[data-type*="vc"]').remove()
1385            $(pjax.newDocument).find('style[data-type*="vc"]').appendTo('head')
1386            $(pjax.oldDocument).find('#iron-custom-styles-inline-css').remove()
1387            $(pjax.newDocument).find('#iron-custom-styles-inline-css').appendTo('head')
1388
1389            oldStyleSheet.each(function(index, element) {
1390                if (!$(pjax.newDocument).find('link[id="' + $(this).attr('id') + '"]').length) {
1391                    $(this).remove()
1392                }
1393            })
1394
1395            newStyleSheet.each(function(index, element) {
1396                if (!$(pjax.oldDocument).find('link[id="' + $(this).attr('id') + '"]').length) {
1397                    $(this).appendTo('body')
1398                }
1399            })
1400
1401            var customStyle = $(pjax.oldDocument).find('#custom-styles-inline-css')
1402            var newStyle = $(pjax.newDocument).find('#custom-styles-inline-css')
1403
1404
1405            customStyle.remove()
1406            newStyle.appendTo('head')
1407
1408
1409
1410        },
1411
1412        swapWPAdminbar: function() {
1413            var pjax = this;
1414            var newBar = $(pjax.newDocument).find('#wpadminbar')
1415            $('#wpadminbar').html(newBar.html())
1416
1417        },
1418        customJs: function() {
1419            var pjax = this;
1420
1421            $(pjax.oldDocument).find("#rs-plugin-settings-inline-css").remove();
1422			$(pjax.newDocument).find("#rs-plugin-settings-inline-css").appendTo("body");
1423
1424            function loadInline() {
1425                $('script[type="text/javascript"]').each(function() {
1426                    var text = $(this).text()
1427                    if (text == '')
1428                        return
1429
1430                    if (text.substring(7, 12) == 'CDATA') {
1431                        eval(text.substring(16, text.length - 10))
1432                    } else {
1433                        eval(text)
1434                    }
1435
1436                })
1437            }
1438
1439
1440            var oldScript = $(pjax.oldDocument).find('script[src]')
1441            var newScript = $(pjax.newDocument).find('script[src]')
1442            var loadScript = [];
1443            var apiFetchScriptLoaded = false;//Fix TMP ajax conflict betweem scripts api-fetch and underscore 
1444			var underscoreScript ='';//Fix TMP ajax conflict betweem scripts api-fetch and underscore
1445
1446
1447            oldScript.each(function(index, element) {
1448                if (!$(pjax.newDocument).find('script[src="' + $(this).attr('src') + '"]').length) {
1449                    $(this).remove()
1450                        // console.log('removing' + $(this).attr('src'))
1451                }
1452            })
1453
1454            
1455
1456            newScript.each(function(index, element) {
1457                var script = $(this).attr('src');
1458                if( script.includes('api-fetch')){
1459					apiFetchScriptLoaded = true;//Fix TMP ajax conflict betweem scripts api-fetch and underscore
1460				}
1461				if( script.includes('underscore')){
1462					underscoreScript=$(this).attr('src');//Fix TMP ajax conflict betweem scripts api-fetch and underscore
1463				}
1464                if (!$(pjax.oldDocument).find('script[src="' + $(this).attr('src') + '"]').length) {
1465                    loadScript.push($(this).attr('src'))
1466                }
1467            })
1468            if(apiFetchScriptLoaded){
1469				loadScript.push(underscoreScript);//Fix TMP ajax conflict betweem scripts api-fetch and underscore
1470			}
1471            // console.dir(loadScript)
1472
1473            if (loadScript.length) {
1474                $.ajaxSetup({ async: false });
1475
1476                for (var i = 0; i < loadScript.length; i++) {
1477                    $.getScript(loadScript[i], function() {
1478                        if (i == loadScript.length - 1) {
1479                            loadInline()
1480                        }
1481                    })
1482                }
1483                $.ajaxSetup({ async: true });
1484            } else {
1485                loadInline();
1486            }
1487
1488             /*Loading Revolution Slider*/
1489				  $(pjax.oldDocument).find("#rs-initialisation-scripts").remove();
1490				  if ($(pjax.newDocument).find("#rs-initialisation-scripts").length) {
1491					let srp_rsInitScripts = $(pjax.newDocument).find("#rs-initialisation-scripts").html();
1492					srp_rsInitScripts = srp_rsInitScripts.split('.revolutionInit({');
1493					let srp_nextNodeID = srp_rsInitScripts[0].split('document.getElementById("');
1494					srp_nextNodeID = srp_nextNodeID[1].split('")');
1495					srp_nextNodeID = srp_nextNodeID[0];
1496					srp_rsInitScripts.shift();
1497			
1498					var i = 0;
1499					function srp_rsInitScriptsLoop() {
1500					  setTimeout(function () {
1501						let srp_revapi_code = srp_rsInitScripts[i].split('});');
1502						let srp_revapi_param = srp_revapi_code[0];
1503						srp_revapi_param = eval('({' + srp_revapi_param + '})');
1504						let srp_revapi = $('#' + srp_nextNodeID);
1505						if (typeof srp_revapi === 'object' && typeof srp_revapi.revolutionInit !== 'undefined') {
1506						  srp_revapi.revolutionInit(srp_revapi_param);
1507						}
1508						srp_nextNodeID = srp_revapi_code[1].split('document.getElementById("');
1509						if (srp_nextNodeID.length > 1) {
1510						  srp_nextNodeID = srp_nextNodeID[1].split('")');
1511						  srp_nextNodeID = srp_nextNodeID[0];
1512						}
1513						i++;
1514						if (i < srp_rsInitScripts.length) {
1515						  srp_rsInitScriptsLoop();
1516						}
1517					  }, 200)
1518					}
1519					srp_rsInitScriptsLoop();
1520				  }
1521
1522
1523
1524        },
1525
1526        cleanHtml: function() {
1527            var pjax = this;
1528            $(pjax.oldDocument).find('.esgbox-overlay, .esgbox-wrap').remove()
1529        },
1530        swapBodyClass: function() {
1531            var pjax = this;
1532            var newClass = $(pjax.newDocument).find('body').attr('class');
1533            $('.vc_row.wpb_row.vc_row-fluid.in_container').has('.rev_slider_wrapper.fullscreen-container, .rev_slider_wrapper.fullwidthbanner-container').removeClass('in_container').addClass('full_width');
1534            $('body').attr('class', newClass);
1535            $('body').addClass('pjax');
1536
1537
1538
1539            if ($('.continuousPlayer').hasClass('enable')) {
1540                $('body').addClass('continuousPlayer-enable');
1541            }
1542        },
1543        activateEsgGrid: function() {
1544            $('.esg-grid').parents('.wpb_wrapper').find('script').each(function() {
1545                eval($(this).text())
1546            })
1547        },
1548        wooCommerce: function() {
1549            $('.product.has-default-attributes.has-children>.images').css('opacity', 1)
1550        },
1551
1552        vc_slide: function(){
1553          if ( $('.vc_slide.vc_images_carousel').length ) {
1554              $('.vc_slide.vc_images_carousel').addClass('vc_build')
1555              $('.vc_carousel-indicators li:first').click()
1556          }
1557        },
1558
1559        ironAudioPlayer: function() {
1560            $('.iron-audioplayer').each(function() {
1561                var player = Object.create(IRON.audioPlayer);
1562                player.init($(this));
1563            })
1564            if ($('.artist_player').length) {
1565                IRON.artistPlayer.setPlayer()
1566            }
1567            if (typeof elementAudio !== 'undefined') {
1568                if (elementAudio.src && elementAudio.played.length) {
1569                    IRON.initPusherHeight()
1570                    $('.continuousPlayer').addClass('enable')
1571                    $('body').addClass('continuousPlayer-enable')
1572                    if (IRON.continuousPlayer.wavesurfer.isPlaying()) {
1573                        IRON.continuousPlayer.play()
1574                        IRON.continuousPlayer.play()
1575                    }
1576                }
1577            }
1578        }
1579
1580
1581
1582    }
1583
1584
1585
1586    /* PUSHER FORCED HEIGHT */
1587    IRON.initPusherHeight = function() {
1588        return
1589    };
1590
1591    /* RESET PUSHER HEIGHT */
1592    IRON.resetPusherHeight = function() {
1593        return
1594    };
1595
1596    /* EVENT WIDGET CENTERING */
1597    IRON.initEventCenter = function() {
1598        if (jQuery(window).width() >= 767) {
1599            jQuery(".event-text-wrap, .event-text-wrap-single").each(function() {
1600                var halfheight = (jQuery(this).height()) / 2;
1601                jQuery(this).css('margin-top', (-halfheight));
1602            });
1603        } else {
1604            jQuery(".event-text-wrap").css('margin-top', 0);
1605        }
1606
1607        jQuery(window).resize(function() {
1608            if (jQuery(window).width() >= 767) {
1609                jQuery(".event-text-wrap, .event-text-wrap-single").each(function() {
1610                    var halfheight = (jQuery(this).height()) / 2;
1611                    jQuery(this).css('margin-top', (-halfheight));
1612                });
1613            } else {
1614                jQuery(".event-text-wrap").css('margin-top', 0);
1615            }
1616        });
1617
1618        jQuery('.title-row').mouseenter(function() {
1619            if (jQuery(window).width() >= 767) {
1620                jQuery(".event-text-wrap.btn").each(function() {
1621                    var halfheight = (jQuery(this).height()) / 2;
1622                    jQuery(this).css('margin-top', (-halfheight));
1623                });
1624            } else {
1625                jQuery(".event-text-wrap.btn").css('margin-top', 0);
1626            }
1627        });
1628    };
1629
1630    /* TWITTER WIDGET CENTERING */
1631    IRON.initTwitterCenter = function() {
1632        jQuery(".twitter-center").each(function() {
1633            var halfheight = (jQuery(this).height()) / 2;
1634            jQuery(this).css('margin-top', (-halfheight));
1635        });
1636        jQuery(window).resize(function() {
1637            jQuery(".twitter-center").each(function() {
1638                var halfheight = (jQuery(this).height()) / 2;
1639                jQuery(this).css('margin-top', (-halfheight));
1640            });
1641        });
1642    };
1643
1644    /* HEADSET ICON CENTERING */
1645    IRON.initHeadsetCenter = function() {
1646        jQuery(".album-listen").each(function() {
1647            var halfheight = (jQuery(this).height()) / 2;
1648            jQuery(this).css('margin-top', (-halfheight));
1649        });
1650        jQuery(window).resize(function() {
1651            jQuery(".album-listen").each(function() {
1652                var halfheight = (jQuery(this).height()) / 2;
1653                jQuery(this).css('margin-top', (-halfheight));
1654            });
1655        });
1656    };
1657
1658    /* IOS SLIDER TEXT CENTERING */
1659    IRON.initIOSCenter = function() {
1660        jQuery(".iosSlider .slider .item .inner a").each(function() {
1661            var halfheight = (jQuery(this).height()) / 2;
1662            jQuery(this).css('margin-top', (-halfheight));
1663        });
1664        jQuery(window).resize(function() {
1665            jQuery(".album-listen").each(function() {
1666                var halfheight = (jQuery(this).height()) / 2;
1667                jQuery(this).css('margin-top', (-halfheight));
1668            });
1669        });
1670    };
1671
1672    IRON.initCountdownLang = function() {
1673
1674        if (iron_vars.lang)
1675            $.countdown.setDefaults($.countdown.regionalOptions[iron_vars.lang]);
1676
1677    };
1678
1679    /* COUNTDOWNS CENTERING */
1680    IRON.initCountdownCenter = function() {
1681        jQuery(".countdown-wrap,.event-centering").each(function() {
1682            var halfheight = (jQuery(this).height()) / 2;
1683            jQuery(this).css('margin-top', (-halfheight));
1684        });
1685        jQuery(window).resize(function() {
1686            jQuery(".countdown-wrap,.event-centering").each(function() {
1687                var halfheight = (jQuery(this).height()) / 2;
1688                jQuery(this).css('margin-top', (-halfheight));
1689            });
1690        });
1691
1692        /* New Type */
1693        jQuery(".event-line-countdown-wrap .countdown-block").each(function() {
1694            var halfheight = (jQuery(this).height()) / 2;
1695            jQuery(this).css('margin-top', (-halfheight));
1696        });
1697        jQuery(window).resize(function() {
1698            jQuery(".event-line-countdown-wrap .countdown-block").each(function() {
1699                var halfheight = (jQuery(this).height()) / 2;
1700                jQuery(this).css('margin-top', (-halfheight));
1701            });
1702        });
1703
1704    };
1705
1706    /* MENU HIERARCHY */
1707    IRON.initMenuHierarchy = function() {
1708        var menulevel = 0;
1709        jQuery(".menu-item").each(function() {
1710            if (jQuery(this).has("ul").length) {
1711                jQuery(this).children(".has-drop-down-a").append("<div class='sub-
1711arrow'><i class='fa-solid fa-angle-right'></i></div>");
1712            }
1713        });
1714        jQuery(".has-drop-down-a").click(function(event) {
1715            event.preventDefault();
1716            menulevel = menulevel + 1;
1717            jQuery(this).parent('li').parent('ul').children('li').each(function() {
1718                jQuery(this).children('a').css('opacity', '0');
1719                jQuery(this).children('a').css('pointer-events', 'none');
1720                if (menulevel > 0) {
1721                    jQuery('.panel-networks').css('opacity', '0');
1722                    jQuery('.panel-networks').css('pointer-events', 'none');
1723                }
1724            });
1725            jQuery(this).next('ul').addClass('active');
1726        });
1727        jQuery(".backlist").click(function(event) {
1728            event.preventDefault();
1729            menulevel = menulevel - 1;
1730            jQuery(this).parent('ul.sub-menu').parent('li').parent('ul').children('li').each(function() {
1731                jQuery(this).children('a').css('opacity', '1');
1732                jQuery(this).children('a').css('pointer-events', 'auto');
1733                if (menulevel === 0) {
1734                    jQuery('.panel-networks').css('opacity', '1');
1735                    jQuery('.panel-networks').css('pointer-events', 'auto');
1736                }
1737            });
1738            jQuery(this).parent("ul").removeClass('active');
1739        });
1740    };
1741
1742    /* SUB-MENU DYNAMIC POSITIONING */
1743    IRON.initSubmenuPosition = function() {
1744        function sidemenuoffset() {
1745            var menuoffset = jQuery('.nav-menu').offset();
1746            jQuery('.sub-menu').css('top', menuoffset);
1747        }
1748        jQuery(window).resize(function() {
1749            sidemenuoffset();
1750        });
1751        sidemenuoffset();
1752    };
1753
1754    /* LARGE SINGLE DISCOGRAPHY */
1755    IRON.initSingleDisco = function() {
1756        var discocount = $('.two_column_album .media-block').length;
1757        if (discocount == 1) {
1758            $('.two_column_album .media-block').addClass('single');
1759        }
1760    };
1761
1762    /* NEWSLETTER LABEL TRANSFORM */
1763    IRON.initNewsletterLabel = function() {
1764        jQuery(".nm_mc_input").each(function() {
1765            var thelabel = $(this).prev("label").text();
1766            $(this).attr('placeholder', thelabel);
1767        });
1768        $(".nm_mc_form label").css('display', 'none');
1769    };
1770
1771    /* DISABLE HOVERS ON MOBILE */
1772    IRON.initDisableHovers = function() {
1773        $(document).ready(function() {
1774
1775            if (isMobile === true || isiPad === true) {
1776                jQuery('.countdown-wrap').css('display', 'none');
1777                jQuery('.button-wrap').css('display', 'none');
1778                jQuery('.buttons').removeClass('no-touchevents');
1779                jQuery('html').removeClass('no-touchevents');
1780            }
1781        });
1782    };
1783
1784    /* ISOTOPE NEWS GRID */
1785    IRON.initIsotope = function() {
1786       var grid = document.querySelector('.isotope-wrap');
1787       if( $(grid).length ){
1788            var iso = new Isotope( grid, {
1789                // options...
1790                itemSelector: '.isotope-item',
1791                masonry: {
1792                    isFitWidth: true
1793                }
1794            });
1795        }
1796    };
1797
1798
1799    IRON.initBackToTop = function() {
1800
1801        $('#back-to-top, #back-to-top-mobile').on('click', function(e) {
1802
1803            e.preventDefault();
1804
1805            $('html, body').animate({
1806                scrollTop: 0
1807            }, 800);
1808        });
1809    };
1810
1811    IRON.initScrollToSection = function() {
1812
1813        var animating = false;
1814        // Iterate over all nav links, setting the "selected" class as-appropriate.
1815
1816        $(document).on('click', 'a[href*="#"]:not([data-vc-tabs]):not(.sandwich-icon)', function(e) {
1817
1818            var target = $(this).attr('href');
1819
1820            if (target.charAt(0) != '#') {
1821                target = target.split('#');
1822                target = '#' + target[1];
1823            }
1824            var $target = $(target);
1825            if ($(target).hasClass('vc_tta-panel'))
1826                return
1827
1828            if( $(target).parents('.woocommerce-tabs').length ) 
1829                return; 
1830
1831            if ($(this).parents('.comment-navigation').length) {
1832                return true;
1833            }
1834
1835
1836            if (animating || $(this).hasClass('ui-tabs-anchor'))
1837                return false;
1838
1839
1840
1841            if ($(target).length > 0) {
1842                e.preventDefault();
1843                animating = true;
1844
1845                var menu_open = $('.side-menu').hasClass('open');
1846                var timeout = 10;
1847
1848                if (menu_open) {
1849                    $('.side-menu.open .menu-toggle-off').click();
1850                    timeout = 400;
1851                }
1852
1853                //Push menu -- anchor link for mobile
1854                if( $(this).parents('.nav-menu').length && //if it is push menu item
1855                    target.charAt(0) == '#' && target.length > 1 //if it is anchor link
1856                    ){
1857                        timeout = 1000;
1858                        $( '.menu-toggle' ).trigger( "click" );
1859                    }
1860                
1861                setTimeout(function() {
1862
1863                    var topPosition = $(target).offset().top;
1864
1865                    if( jQuery('.classic-menu').length ){
1866                        if( jQuery('.classic-menu').hasClass('responsive') ){
1867                            var topPosition = topPosition - jQuery('.responsive-header').outerHeight();
1868                        }else{
1869                            var topPosition = topPosition - jQuery('.classic-menu').outerHeight();
1870                        }
1871                    }
1872
1873                    animating = true;
1874                    $('html, body').animate({
1875                        scrollTop: topPosition
1876                    }, 800, function() {
1877
1878                        animating = false;
1879                    });
1880
1881                }, timeout);
1882
1883            }
1884
1885        });
1886
1887    };
1888
1889    IRON.initVcAnimations = function() {
1890
1891        if (navigator.userAgent.match(/iPhone|iPad|iPod/i))
1892            jQuery('.wpb_animate_when_almost_visible').removeClass('wpb_animate_when_almost_visible');
1893
1894        var single_album = $('body').hasClass('single-photo-album');
1895
1896
1897    };
1898
1899    IRON.initWooImageBack = function() {
1900        $('.attachment-shop_catalog').each(function() {
1901            $(this).wrap('<div class="tint"></div>');
1902        });
1903    };
1904
1905    //Apply in the Custom JS (use 'px' unit ex: IRON.responsiveText('26px', '65px', '750px', '426px');)
1906    IRON.responsiveText = function(newheadingFontSizeSmall, newheadingFontSizeMedium, tabletSize, mobileSize) {
1907        function caculateLineHeight(element, newFontSize) {
1908            var heightFactor = parseInt((window.getComputedStyle(element, null).getPropertyValue('font-size')), 10) / parseInt(newFontSize, 10);
1909            var newLineHeight = parseInt((window.getComputedStyle(element, null).getPropertyValue('line-height')), 10) / heightFactor;
1910            return (parseInt(newLineHeight, 10) + 'px');
1911        }
1912        var headingFontSize;
1913
1914        if (window.matchMedia('(max-width:' + tabletSize + ')').matches) {
1915
1916            $('h1, h2, .iron-responsive').each(function() {
1917                caculateLineHeight(this, newheadingFontSizeMedium);
1918                headingFontSize = parseInt((window.getComputedStyle(this, null).getPropertyValue('font-size')), 10);
1919                if (headingFontSize > parseInt(newheadingFontSizeMedium, 10)) {
1920                    if (window.matchMedia('(max-width:' + mobileSize + ')').matches) {
1921                        $(this).css({
1922                            'line-height': caculateLineHeight(this, newheadingFontSizeSmall),
1923                            'font-size': newheadingFontSizeSmall
1924                        });
1925                    } else {
1926                        $(this).css({
1927                            'line-height': caculateLineHeight(this, newheadingFontSizeMedium),
1928                            'font-size': newheadingFontSizeMedium
1929                        });
1930                    }
1931                }
1932            });
1933        }
1934    };
1935
1936    IRON.initCustomJS = function() {
1937        /* Video archive */
1938        if ($('#sr_it-perfectscrollbar').length) {
1939            var container = document.getElementById('sr_it-perfectscrollbar');
1940            Ps.initialize(container);
1941        }
1942        /* End Video archive */
1943
1944        /* GradientMaps effect */
1945        function gradientMapsDarkOrLight(target) { // Reverse gradientmap on dark background FUNCTION
1946            if ($('#overlay').lightOrDark() == 'dark') {
1947                var gradientMap = colors[1] + ' 0%, ' + colors[0] + ' 100%';
1948            } else {
1949                var gradientMap = colors[0] + ' 0%, ' + colors[1] + ' 100%';
1950            }
1951            return gradientMap;
1952        }
1953
1954        function gradientMapsColors() { // pick colors FUCNTION
1955            var color1 = iron_vars.look_and_feel.color_1;
1956            var color2 = iron_vars.look_and_feel.body_background.color;
1957            return [color1, color2];
1958        }
1959
1960
1961        if ($('.sr_it-gradientmaps-skin').length) {
1962            var colors = gradientMapsColors(); // pick colors
1963            var x = document.getElementsByClassName("sr_it-gradientmaps-skin");
1964            var i;
1965            var ii;
1966            var target = [];
1967            for (i = 0; i < x.length; i++) {
1968                if (x[i].className.indexOf('wpb_single_image') >= 0) { // If single image
1969                    target = x[i].querySelectorAll('img');
1970                }
1971                if (x[i].className.indexOf('vc_row') >= 0) { // If Row
1972                    target = [x[i]];
1973                }
1974                if (x[i].className.indexOf('vc_row') >= 0 && x[i].getElementsByClassName('esg-grid').length > 0) { //If Essential Grid
1975                    if (x[i].getElementsByClassName('esg-media-poster').length > 0) {
1976                        target = x[i].querySelectorAll('.esg-media-poster');
1977                    } else {
1978                        target = x[i].querySelectorAll('.esg-entry-media');
1979                    }
1980                }
1981                var gradientMap = gradientMapsDarkOrLight(target); // Reverse gradientmap on dark background
1982                for (ii = 0; ii < target.length; ii++) {
1983                    GradientMaps.applyGradientMap(target[ii], gradientMap);
1984                }
1985            }
1986        }
1987
1988
1989        if (iron_vars.custom_js !== '') {
1990            eval(iron_vars.custom_js);
1991        }
1992
1993
1994        /*Footer: Align social media icon*/
1995        $('#footer .vc_btn3-inline, #footer .vc_btn2-inline, #footer .vc_btn1-inline').parent().css('text-align', 'center');
1996        /*Footer: remove touchmove on the image gallery element*/
1997        $('#footer .vc_carousel-inner').bind('touchmove', false);
1998    };
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009    $(document).ready(function() {
2010
2011        $(window).resize();
2012        setTimeout(function() {
2013            $(window).resize();
2014            jQuery('header').animate({ 'opacity': 1 });
2015        }, 1000);
2016
2017
2018        $('.vc_row.wpb_row.vc_row-fluid.in_container').has('.rev_slider_wrapper.fullscreen-container, .rev_slider_wrapper.fullwidthbanner-container').removeClass('in_container').addClass('full_width');
2019
2020
2021        $('.button-widget').each(function() {
2022            var initialcolor = $(this).css('color');
2023            var initialbg = $(this).css('background-color');
2024            var initialborder = $(this).css('border-top-color');
2025
2026            $(this).mouseover(function() {
2027                var bghovercolor = $(this).attr('data-hoverbg');
2028                var texthovercolor = $(this).attr('data-hovertext');
2029                var borderhovercolor = $(this).attr('data-hoverborder');
2030                $(this).css('border-color', borderhovercolor);
2031                $(this).css('background-color', bghovercolor);
2032                $(this).css('color', texthovercolor);
2033            });
2034            $(this).mouseout(function() {
2035                $(this).css('border-color', initialborder);
2036                $(this).css('background-color', initialbg);
2037                $(this).css('color', initialcolor);
2038            });
2039        });
2040    });
2041
2042    /* Portfolio Button Hover */
2043    $(document).ready(function() {
2044        $('.portfolio-button').each(function() {
2045            var initialcolor = $(this).css('color');
2046            var initialbg = $(this).css('background-color');
2047            var initialborder = $(this).css('border-top-color');
2048
2049            $(this).mouseover(function() {
2050                $(this).css('background-color', initialborder);
2051                $(this).css('color', '#FFF');
2052            });
2053            $(this).mouseout(function() {
2054                $(this).css('background-color', initialbg);
2055                $(this).css('color', initialcolor);
2056            });
2057        });
2058    });
2059
2060    /* Fit Text - Auto-Resize page titles */
2061    $(document).ready(function() {
2062        /*$('.page-title h1, h1.page-title').fitText(1.2,{maxFontSize:'60px'});*/
2063        $('.fittext h1, .fittext h2, .fittext h3, .fittext h4, .fittext h5, .fittext h6').fitText(1.2, { maxFontSize: '85px' });
2064    });
2065
2066    /* SUB-MENU ARROW CENTERING */
2067    $(document).ready(function() {
2068        jQuery(".sub-arrow i").each(function() {
2069            var halfheight = (jQuery(this).height()) / 2;
2070            jQuery(this).css('margin-top', (-halfheight));
2071        });
2072        jQuery(window).resize(function() {
2073            jQuery(".sub-arrow i").each(function() {
2074                var halfheight = (jQuery(this).height()) / 2;
2075                jQuery(this).css('margin-top', (-halfheight));
2076            });
2077        });
2078    });
2079
2080    /* Remove link on ancestor item from responsive menu */
2081    $(document).ready(function() {
2082        if ($('.responsive-header').length || $('.side-menu').length) {
2083            $('.menu-item-has-children>a').attr('href', '#');
2084        }
2085    });
2086
2087    /* FOOTER TEXT CENTERING */
2088    $(document).ready(function() {
2089        function footertext() {
2090            var footerheight = $('.footer-wrapper').height();
2091            $(".footer-wrapper .text").each(function() {
2092                var footertextheight = $(this).height();
2093                var centeredtext = (footerheight / 2) - (footertextheight / 2);
2094                $(this).css('top', centeredtext);
2095            });
2096        }
2097        footertext();
2098        $(window).resize(function() {
2099            footertext();
2100        });
2101    });
2102
2103
2104    /* BACKTOTOP BUTTON */
2105    $(document).ready(function() {
2106        var wrapper = document.getElementById("wrapper")
2107        var offsetNeg = $(wrapper).height() / 2
2108        waypoints = new Waypoint({
2109            element: wrapper,
2110            handler: function(direction) {
2111                if (direction == 'down') {
2112                    $('.footer-wrapper-backtotop').addClass('active');
2113                } else if (direction == 'up') {
2114                    $('.footer-wrapper-backtotop').removeClass('active');
2115                }
2116            },
2117            offset: '-' + offsetNeg + 'px',
2118        })
2119    });
2120
2121    /* WPML MENU CROP CURRENT LANGUAGE */
2122    $(document).ready(function() {
2123        $('.menu-item-language').first().css("display", "none");
2124    });
2125
2126
2127    /*Determine if the background color of an element is light or dark.*/
2128    //https://gist.github.com/larryfox/1636338
2129    $.fn.lightOrDark = function() {
2130        var r, b, g, hsp, a = this.css('background-color');
2131
2132        if (a.match(/^rgb/)) {
2133            a = a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
2134            r = a[1];
2135            g = a[2];
2136            b = a[3];
2137        } else {
2138            a = +("0x" + a.slice(1).replace( // thanks to jed : http://gist.github.com/983661
2139                a.length < 5 && /./g, '$&$&'
2140            ));
2141            r = a >> 16;
2142            b = a >> 8 & 255;
2143            g = a & 255;
2144        }
2145        hsp = Math.sqrt( // HSP equation from http://alienryderflex.com/hsp.html
2146            0.299 * (r * r) +
2147            0.587 * (g * g) +
2148            0.114 * (b * b)
2149        );
2150        if (hsp > 127.5) {
2151            return ('light');
2152        } else {
2153            return ('dark');
2154        }
2155    }
2156
2157
2158    /* Force Width of pagination */
2159    $(document).ready(function() {
2160        $('.pages').width($('#post-list').width());
2161        $(window).resize(function() {
2162            $('.pages').width($('#post-list').width());
2163        });
2164        setTimeout(function() {
2165            if ($('.isotope-wrap').length) {
2166                $('.pages .alignleft').css('margin-left', '7.5px');
2167                $('.pages .alignright').css('margin-right', '7.5px');
2168            }
2169        }, 500);
2170    });
2171
2172
2173
2174
2175    jQuery(window).on('load',function () {
2176        jQuery('header').animate({ 'opacity': 1 });
2177    });
2178
2179})(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.