PageSourceSearch

https://vickypulgarin.com/wp-content/themes/oshin/js/script.js?ver=5.0

js vickypulgarin.com collected 2026-10-05 06:19:38 UTC 55,264 bytes, 1,297 lines download raw bytes

1;(function($) {
2    jQuery.fn.center = function(parent) {
3        if (parent) {
4            parent = this.parent();
5        } else {
6            parent = window;
7        }
8        this.css({
9            "position": "absolute",
10            "top": (((jQuery(parent).height() - this.outerHeight()) / 2) + jQuery(parent).scrollTop() + "px"),
11            "left": (((jQuery(parent).width() - this.outerWidth()) / 2) + jQuery(parent).scrollLeft() + "px")
12        });
13        return this;
14    }
15})(jQuery);
16
17// Custom Side with Fade Animation
18;(function($) {
19    jQuery.fn.slideFadeToggle  = function(speed, easing, callback) {
20        return this.animate({opacity: 'toggle', height: 'toggle', padding: 'toggle', margin: 'toggle'}, speed, easing, callback);
21    };
22})();
23
24//Parallax
25;(function( $ ) {
26	var $window = $(window), update_parallax;
27	var windowHeight = $window.height();
28
29	$window.resize(function () {
30		windowHeight = $window.height();
31	});
32
33	$.fn.parallax = function(xpos, speedFactor, outerHeight) {
34		var $this = $(this);
35		var getHeight;
36		var firstTop;
37		var paddingTop = 0;
38		//get the starting position of each element to have parallax applied to it    
39		$this.each(function(){
40			firstTop = $this.offset().top;
41		});
42		if (outerHeight) {
43			getHeight = function(jqo) {
44			return jqo.outerHeight(true);
45		};
46		} else {
47			getHeight = function(jqo) {
48				return jqo.height();
49			};
50		}
51		// setup defaults if arguments aren't specified
52		if (arguments.length < 1 || xpos === null) xpos = "50%";
53		if (arguments.length < 2 || speedFactor === null) speedFactor = 0.5;
54		if (arguments.length < 3 || outerHeight === null) outerHeight = true;
55		// function to be called whenever the window is scrolled or resized
56		update_parallax = function() {
57			var pos = $window.scrollTop();
58			$this.each(function() {
59				var $element = $(this);
60				var top = $element.offset().top;
61				var height = getHeight($element);
62				// Check if totally above or totally below viewport
63				if (top + height < pos || top > pos + windowHeight) {
64					return;
65				}
66				$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
67			});
68		}
69		$window.on('scroll.parallaxscroll', update_parallax);
70		$window.on('smartresize.parallaxresize', update_parallax);
71		update_parallax();
72	};
73	jQuery(document).on("update_content", function() {
74		if(jQuery(this).find('.be-section.be-bg-parallax').length == 0) {
75			$window.off('scroll.parallaxscroll', update_parallax);
76			$window.off('scroll.parallaxresize', update_parallax);
77		}
78    });
79})(jQuery);
80
81
82;(function( $ ) {
83    'use strict';
84
85    var vendorScriptsUrl = oshineThemeConfig.vendorScriptsUrl;
86
87	asyncloader.register( vendorScriptsUrl+'fitvids.js', 'fitvids' );
88	asyncloader.register( vendorScriptsUrl+'superfish.js', 'superfish' );
89	asyncloader.register( vendorScriptsUrl+'hoverintent.js', 'hoverintent' );
90	asyncloader.register( vendorScriptsUrl+'imagesloaded.js' , 'imagesloaded' );
91	asyncloader.register( vendorScriptsUrl+'horizontalcarousel.js' , 'horizontalcarousel' );
92	asyncloader.register( 'https://f.vimeocdn.com/js/froogaloop2.min.js' , 'vimeo' );
93	asyncloader.register( vendorScriptsUrl+'resizetoparent.js' , 'resizetoparent' );
94	asyncloader.register( vendorScriptsUrl+'mousewheel.js' , 'mousewheel' );
95	asyncloader.register( vendorScriptsUrl+'patterncanvas.js' , 'patterncanvas' );
96	asyncloader.register( vendorScriptsUrl+'greensock.js' , 'greensock' );
97	asyncloader.register( vendorScriptsUrl+'galaxycanvas.js' , 'galaxycanvas' );
98	asyncloader.register( vendorScriptsUrl+'waterdropcanvas.js' , 'waterdropcanvas' );
99	asyncloader.register( vendorScriptsUrl+'request_animation_frame.js' , 'request_animation_frame' );
100	asyncloader.register( vendorScriptsUrl+'transparentheader.js' , 'transparentheader' );
101	asyncloader.register( vendorScriptsUrl+'scrolltosections.js' , 'scrolltosections' );
102	asyncloader.register( vendorScriptsUrl+'fullscreenheight.js' , 'fullscreenheight' );
103	asyncloader.register( vendorScriptsUrl+'flickity.js' , 'flickity' );
104	asyncloader.register( vendorScriptsUrl+'backgroundcheck.js' , 'backgroundcheck' );
105	//asyncloader.register( vendorScriptsUrl+'scrollbar.js' , 'scrollbar' );
106	asyncloader.register( vendorScriptsUrl+'backgroundposition.js' , 'backgroundposition' );
107	asyncloader.register( vendorScriptsUrl+'easing.js' , 'easing' );  
108	asyncloader.register( vendorScriptsUrl+'magnificpopup.js', 'magnificpopup' );   
109
110    function Selector_Cache() {
111	    var collection = {};
112
113	    function get_from_cache( selector ) {
114	        if ( undefined === collection[ selector ] ) {
115	            collection[ selector ] = jQuery( selector );
116	        }
117
118	        return collection[ selector ];
119	    }
120
121	    return { get: get_from_cache };
122	}
123
124    jQuery(document).ready( function() {
125
126
127	    var oshine_scripts = (function() {
128
129	    	var page_loader = jQuery('.page-loader'), 
130	    	 	 ajax_url = jQuery('#ajax_url').val(), 
131	    	 	 transition, 
132	    	 	 exclude_links,
133	    	 	 body = jQuery('body'),
134	    	 	 html = jQuery('html'),
135	    	 	 selectors = new Selector_Cache(),
136	    	 	 to_top_button = jQuery('#back-to-top'),
137	    	 	 fullscreen_wrap = jQuery('.hero-section-wrap, .full-screen-section, .tatsu-fullscreen'),
138	    	 	 
139
140	    	resize_gallery_video =  function() {
141		        if (jQuery(window).width() < 769) {
142		        	var width = jQuery('#gallery-container-wrap').width();
143		            jQuery('iframe.gallery').each(function () {
144		                jQuery(this).width( width );
145		            });
146		        } else {
147		            jQuery('iframe.gallery').each(function () {
148		                jQuery(this).width( ( jQuery(this).height() * 1.77 ) );
149		            });
150		        }
151	    	},
152
153	    	menu_link_animation = function() {
154		        var delay_time = 500, 
155		            index = 0,
156		            slidebar_menu = document.getElementById("slidebar-menu").children,
157		            child_count = slidebar_menu.length;
158		        for( index; index<child_count; index++ ) {
159		            jQuery(slidebar_menu[index]).delay(delay_time).addClass("menu-loaded",200);
160		            delay_time += 100;
161		        }	    		
162	    	},
163
164	    	custom_scrollbar = function() {
165	    		if( !body.hasClass('tatsu-frame') ) {
166	    			
167		    		//var gallery_content = jQuery('.gallery_content_area, .gallery_content_slide, .fixed-sidebar-content-inner');
168		    		var gallery_content = jQuery('.simplebar-content');
169				        if ( gallery_content.length > 0 ) {
170
171				            // gallery_content.mCustomScrollbar({
172				            //     autoHideScrollbar: true
173				            // });
174							
175							//gallery_content.nanoScroller();
176							//gallery_content.simplebar({ wrapContent: false });
177							gallery_content.perfectScrollbar();
178							
179				        }
180				} 		
181	    	}, 
182
183	    	single_page_nav = function() {
184	    		if ( body.hasClass('single-page-version') && !body.hasClass('section-scroll') ) {
185			        var append_section = '',
186			            specific_section = jQuery('.tatsu-section'),
187			            section_length = specific_section.length,
188			            section_id, 
189			            section_title,
190			            index = 0;
191			        if( jQuery('.single-page-nav-wrap').length > 0 ){
192			            body.find('.single-page-nav-wrap').remove();
193			        }
194		           
195		            if( jQuery('#hero-section').length > 0 ){
196		                append_section = '<a class="single-page-nav-link back-to-top" href="#"><span>Home</span></a>';
197		            }
198		            for ( index; index < section_length; index++ ) {
199		                section_id = specific_section.eq(index).attr('id');
200		                section_title = specific_section.eq(index).attr('data-title');
201		                if( section_id ){
202		                    if( section_title ){   
203		                        section_title = "<span>" + section_title + "</span>";                                                 
204		                    } else {
205		                        section_title = '';
206		                    }
207		                    append_section += '<a class="single-page-nav-link" href="#'+section_id+'">'+section_title+'</a>';       
208		                }
209		            }
210		            body.append('<div class="single-page-nav-wrap clearfix"><div class="single-page-nav-wrap-inner clearfix"><div class="sinle-page-nav-links">'+append_section+'</div></div></div>');
211		        } 
212		        
213	    	},
214
215	    	menu_item_update = function() {
216		        var header_height = jQuery('#wpadminbar').height() + 1,
217		            main_menu_items = jQuery('li.menu-item'),
218		            single_page_nav_dots = jQuery('.single-page-nav-link'),  //Should add context after converting single-page-nav-wrap and single-page-nav-links to ID
219		            total_sections = jQuery('.tatsu-section'),
220		            section_count = total_sections.length,
221		            window_height = jQuery(window),
222		            header_bottom_bar = jQuery('#header-bottom-bar'),
223		            index = 0;
224		        if( body.hasClass('top-header') ){
225		            header_height += Number( jQuery('#header-wrap').attr('data-default-height') );
226		            if( header_bottom_bar.length > 0 ){
227		                header_height += header_bottom_bar.height();
228		            }
229		        }
230		        if( body.hasClass('single-page-version') ){
231		            main_menu_items.removeClass('current-menu-item');
232		            for( index; index < section_count; index++ ) {
233		                var current_object = total_sections.eq(index),
234		                    current_object_id = current_object.attr('id');           
235		                if( window_height.scrollTop() + header_height >= current_object.offset().top ){
236		                    main_menu_items.removeClass('current-menu-item current-section');
237		                    single_page_nav_dots.removeClass('current-section-nav-link');
238		                    if( current_object_id ){
239		                        main_menu_items.find('a[href$="#'+ current_object_id +'"]').closest('li.menu-item').addClass('current-menu-item current-section');
240		                        single_page_nav_dots.filter('a[href$="#' + current_object_id + '"]').addClass('current-section-nav-link');
241		                    }
242		                }
243		            }
244		        }
245	    	},
246
247
248
249	    	open_leftstrip = function() {
250		        jQuery('.left-strip-wrapper').removeClass('hide');
251		        html = html.removeClass('hide-overflow');	    		
252	    	},
253
254
255
256	    	animate_scroll = function( element ) {
257		        if ( body.hasClass('section-scroll') && ( jQuery(window).width() > 1024 ) && html.hasClass('csstransforms') ) {
258		            jQuery.fn.translate(element);
259		            return false;
260		        }
261		        var $scroll_to = 1, 
262		        $sticky_offset,
263		        header_wrap = jQuery('#header-wrap'),
264		        header_wrap_default_height = Number( header_wrap.attr('data-default-height') ),
265		        header_wrap_sticky_height = Number( header_wrap.attr('data-sticky-height') ),
266		        top_bar_height = Number( jQuery('#header-top-bar-wrap').innerHeight() ),
267		        bottom_bar_height = Number( jQuery('#header-bottom-bar').innerHeight() ),
268		        admin_bar_height = Number( jQuery('#wpadminbar').height() ),
269		        hero_section = jQuery('.header-hero-section'),
270		        first_pb_section = jQuery( '#page-content div' ).children( '.tatsu-section:nth-child(1)'),
271		        bordered_header_layout = jQuery('#main').hasClass('layout-border-header-top');
272
273
274		        if ( element.length > 0 ) {
275		            $scroll_to = Number( element.offset().top ) - admin_bar_height;
276		        }
277
278		        if ( jQuery(window).width() > 960 && !( body.hasClass('page-template-page-splitscreen-left')  || body.hasClass('page-template-page-splitscreen-right') ) ) {
279		            if ( body.hasClass('sticky-header') || body.hasClass('transparent-sticky') ) {
280		                if ( body.hasClass('sticky-header') ) {
281		                	//console.log( top_bar_height, bottom_bar_height, header_wrap_sticky_height );
282		                    $sticky_offset = jQuery('#header').offset().top + header_wrap_default_height + top_bar_height + bottom_bar_height;
283		                }
284		                if ( body.hasClass('transparent-sticky') ) {
285		                    if( hero_section.length > 0 ){
286		                        $sticky_offset = Number( hero_section.offset().top ) + Number( hero_section.height() )  - admin_bar_height;    
287		                    } else {
288		                        $sticky_offset = Number( first_pb_section.offset().top ) + Number( first_pb_section.height() ) - admin_bar_height;
289		                    }
290		                }
291		                if( bordered_header_layout ) { 
292		                    $scroll_to = $scroll_to - ( header_wrap_default_height + bottom_bar_height );
293		                } else {
294		                    if ($scroll_to > $sticky_offset) {
295		                        $scroll_to = $scroll_to - ( header_wrap_sticky_height + bottom_bar_height );
296		                    }
297		                    if ($scroll_to < $sticky_offset) {
298		                        $scroll_to = $scroll_to - ( header_wrap_default_height + bottom_bar_height );
299		                    }
300		                    if ($scroll_to === $sticky_offset && jQuery('body').hasClass('transparent-sticky')) {
301		                        $scroll_to = $scroll_to - ( header_wrap_sticky_height + bottom_bar_height );
302		                    }
303		                }
304		            } else {
305		                if( bordered_header_layout ) {
306		                    $scroll_to = $scroll_to - Number( jQuery('#header-inner-wrap' ).innerHeight() );
307		                }
308		            }
309		        }
310
311		        jQuery('body, html').animate({scrollTop: $scroll_to }, 1000, 'easeOutQuart', function () {
312		            close_sidebar();
313		            open_leftstrip();
314		            menu_item_update();
315		        });	    		
316	    	},
317
318		    sticky_sidebar = function() {
319		        var $window = jQuery(window), 
320		        $sidebar = jQuery( ".floting-sidebar" ), 
321		        offset = jQuery( '#content-wrap' ).offset(), 
322		        $scrollHeight = jQuery( "#page-content" ).height(), 
323		        $scrollOffset = jQuery( "#page-content" ).offset(), 
324		        $headerHeight = 0,
325		        admin_bar_height = Number( jQuery('#wpadminbar').innerHeight() );
326
327		        if ( jQuery(".floting-sidebar").length > 0 && !body.hasClass('tatsu-frame') ) {
328		            if ( body.hasClass('sticky-header') || body.hasClass('transparent-sticky')) {
329		                $headerHeight = Number( jQuery('#header-inner-wrap').innerHeight() ) + admin_bar_height;
330		            } else {
331		                $headerHeight = admin_bar_height;
332		            }
333		            if ( $window.width() > 960 ) {
334		                if ( ( $window.scrollTop() + $headerHeight ) > offset.top ) {
335		                    if ( $window.scrollTop() + $headerHeight + $sidebar.height() + 50 < $scrollOffset.top + $
335scrollHeight ) {
336		                        $sidebar.stop().animate({
337		                            marginTop: ( $window.scrollTop() - offset.top ) + $headerHeight + 30,
338		                            paddingTop: 30
339		                        });
340		                    } else {
341		                        $sidebar.stop().animate({
342		                            marginTop: ( $scrollHeight - $sidebar.height() - 80 ) + 30,
343		                            paddingTop: 30
344		                        });
345		                    }
346		                } else {
347		                    $sidebar.stop().animate({
348		                        marginTop: 0,
349		                        paddingTop: 0
350		                    });
351		                }
352		            } else {
353		                $sidebar.css('margin-top', 0);
354		            }
355		        }
356		        if ( jQuery(".fixed-sidebar").length > 0 ) {
357		            var $sidebarSelector = jQuery(".fixed-sidebar"),
358		            offset = jQuery('#content-wrap').offset(),
359		            $scrollHeight = jQuery("#page-content").height(),
360		            $scrollOffset = jQuery("#page-content").offset(),
361		            $scroll_top = $window.scrollTop(),
362		            $footerHeight = jQuery('#footer').outerHeight(),
363		            $widgetsHeight = jQuery('#bottom-widgets').outerHeight(),
364		            $sidebarHeight = $sidebarSelector.find('.fixed-sidebar-content .be-section').outerHeight(),
365		            $headerHeight = Number(jQuery('#header-inner-wrap').height()),// + Number(jQuery('#wpadminbar').height()),
366		            $heroSectionHeight = Number(jQuery('.hero-section-wrap').height()),
367		            $headerTopPadding = 0,
368		            $breakingPoint1 = 0,
369		            $breakingPoint2 = 0;
370
371		            // Sticky Default Header
372		            if ( body.hasClass('sticky-header') || body.hasClass('transparent-sticky')) {
373		                $headerTopPadding = $headerHeight;
374		            } 
375
376		            // Non Sticky Header 
377		            if(  body.hasClass('header-transparent') ){ //Transparent 
378		                if($heroSectionHeight > 0){ //With Hero Section
379		                    $breakingPoint1 = $heroSectionHeight;
380		                }else{ //Without Hero Section
381		                    $breakingPoint1 = 1;
382		                }
383		            }else{ //Non Transparent
384		                if($heroSectionHeight > 0){ //With Hero Section
385		                    $breakingPoint1 = $heroSectionHeight + $headerHeight;
386		                }else{ //Without Hero Section
387		                    $breakingPoint1 = $headerHeight;
388		                }
389		            }
390
391		            $breakingPoint2 = (jQuery(document).height()) - ($scroll_top +  jQuery(window).height() + $footerHeight + $widgetsHeight);
392
393		            if ($window.width() > 960) {
394		                if ($scroll_top < $breakingPoint1) {
395		                    $sidebarSelector.removeClass('active-fixed').css('top', 0);
396		                    // $sidebarSelector.width('30%');
397		                    $sidebarSelector.width($sidebarSelector.parent().outerWidth() * 0.30);
398		                } 
399		                else if($breakingPoint2 <= 0){
400		                    var $negative =  ( $breakingPoint2 );
401		                    $sidebarSelector.addClass('active-fixed').removeClass('top-animate').css('top', $negative);
402		                    $sidebarSelector.width($sidebarSelector.parent().outerWidth() * 0.30);
403
404		                }
405		                else if(($scroll_top >= $breakingPoint1) && ($breakingPoint2 > 0)){
406		                    $sidebarSelector.addClass('active-fixed  top-animate').css('top', $headerTopPadding);
407		                    $sidebarSelector.width($sidebarSelector.parent().outerWidth() * 0.30);
408		                }
409	                	
410	                	//jQuery(".fixed-sidebar-content-inner").mCustomScrollbar('update');
411		                
412		            }
413		        }
414		    },
415
416		    split_screen = function() {
417		        if ( ( jQuery(".page-template-page-splitscreen-left").length > 0 ) || ( jQuery(".page-template-page-splitscreen-right").length > 0 ) ) {
418		            var $heroSection = jQuery("#hero-section"),
419		            $window = jQuery(window),
420		            $scroll_top = $window.scrollTop(),
421		            $footerHeight = jQuery('#footer').outerHeight(),
422		            $widgetsHeight = jQuery('#bottom-widgets').outerHeight(),
423		            $headerHeight = Number(jQuery('#header-inner-wrap').height()),
424		            $headerTopPadding = 0,
425		            $headerTopPaddingonScroll = 0,
426		            $breakingPoint1 = 0,
427		            $breakingPoint2 = 0;
428
429		            // Non Sticky Header 
430		            if(  body.hasClass('header-transparent') ){ //Transparent 
431		                $breakingPoint1 = 1;
432		                $headerTopPadding = 0;
433		            }else{ //Non Transparent
434		                $breakingPoint1 = $headerHeight;
435		                $headerTopPadding = $headerHeight;
436		            }
437
438		            $breakingPoint2 = (jQuery(document).height()) - ($scroll_top +  $window.height() + $footerHeight + $widgetsHeight);
439
440		            if ($window.width() > 960) {
441		                $heroSection.css('top', $headerTopPadding);
442		                if ($scroll_top < $breakingPoint1) {
443		                    $heroSection.css('top', $headerTopPadding - ($scroll_top));
444		                } 
445		                else if($breakingPoint2 <= 0){
446		                    $heroSection.css('top', $breakingPoint2);
447		                }
448		                else if(($scroll_top >= $breakingPoint1) && ($breakingPoint2 > 0)){
449		                    $heroSection.css('top', 0 );
450		                }
451		            }
452		        }
453		    },
454
455		    superfish = function() {
456		    	asyncloader.require( [ 'superfish', 'hoverintent' ], function(){
457			        var $menu = jQuery('#navigation .menu, #navigation-left-side .menu, #navigation-right-side .menu').children('ul');
458			        $menu.superfish({
459			            animation: {opacity: 'show'},
460			            animationOut: {opacity: 'hide'},
461			            speed : 400,
462			            delay: 600
463			        });
464			    });		    	
465		    },
466
467		    sliders = function() {
468		    	var gallery_wrap = jQuery('#gallery-container-wrap');
469		        if ( gallery_wrap.length > 0 ) {		        	
470		        	asyncloader.require( [ 'horizontalcarousel', 'fitvids', 'vimeo', 'resizetoparent', 'mousewheel' ], function(){
471			            gallery_wrap.fitVids();
472			            gallery_wrap.CenteredSlider();
473			            //gallery_wrap.thumbnailSlider();
474			            resize_gallery_video();
475			            jQuery('.be-carousel-thumb').thumbnailSlider();
476			        });
477		        }		    	
478		    },
479
480			carousel_thumb = function() {
481		        jQuery(document).on('mouseenter', '.carousel_bar_dots', function () {
482		            jQuery(this).parent().find('.carousel_bar_wrap').css('opacity', '0').stop().animate({ opacity: 1, bottom: '0px' }, 500);
483		        });
484		        jQuery(document).on('mouseleave', '.carousel_bar_area', function () {
485		            jQuery(this).find('.carousel_bar_wrap').stop().animate({ opacity: 0, bottom: '-500px' }, 500);
486		        });				
487			},
488
489		    // update_scrollbar = function() {
490		    // 	var fixed_sidebar = jQuery('.fixed-sidebar-content-inner');
491		    //     if ( fixed_sidebar.length > 0 ) {
492		    //     	//asyncloader.require( 'scrollbar', function(){	
493			   //          if ( fixed_sidebar.hasClass('mCustomScrollbar') ) {
494			   //              fixed_sidebar.mCustomScrollbar('update');
495			   //          } else {
496			   //              fixed_sidebar.mCustomScrollbar({
497			   //                  autoHideScrollbar: true,
498			   //                  mouseWheelPixels: 300
499			   //              });
500			   //          }
501			   //     // });
502		    //     }		    	
503		    // },
504
505		    rev_slider_bg_check = function() {
506	
507		        if ( !body.hasClass('disable_rev_slider_bg_check') && !body.hasClass('semi') ) {
508
509		        	var rev_slider_wrapper = jQuery('#hero-section').find('.rev_slider_wrapper');
510
511		            if ( body.hasClass('header-transparent') && rev_slider_wrapper.length > 0 ) {
512		            	asyncloader.require( 'backgroundcheck', function() {
513			                rev_slider_wrapper.each(function () {
514			                    var $wrapper = jQuery(this).attr('id'), 
515			                    $instance = jQuery(this).find('.rev_slider').attr('id'), 
516			                    be_revapi = $instance.split('_');
517			                    window['revapi'+be_revapi[2]].bind("revolution.slide.onchange", function (e, data) {
518			                        setTimeout(function () {
519			                            BackgroundCheck.init({
520			                                targets: '#header #header-inner-wrap',
521			                                images: '.active-revslide .tp-bgimg'
522			                            });
523			                            BackgroundCheck.refresh();
524			                        }, 100);
525			                    });
526			                });
527			            });
528		            }
529		        }
530		    },
531
532		    header_search = function() {
533		        jQuery(document).on('click', '.header-search-controls .search-button', function () {
534		        	var search_box = jQuery('.search-box-wrapper');
535		            search_box.fadeToggle().find('.s').focus();
536		            if ( search_box.hasClass('style2-header-search-widget') ) {
537		                html = html.toggleClass('hide-overflow');
538		            }
539		        });
540
541		        jQuery(document).on('click', '.header-search-form-close', function (e) {
542		            e.preventDefault();
543		            close_search_box();
544		        });		        		    	
545		    },
546
547		    mobile_menu = function() {   	
548		        jQuery(document).on('click','#mobile-menu li a', function() {
549		            if( jQuery(this).attr('href') != '#' && !jQuery(this).closest('li').hasClass('menu-item-has-children') ){
550		                close_mobile_menu();   
551		            }
552		        });
553
554		        jQuery(document).on('click', '.mobile-nav-controller-wrap', function () {
555		            jQuery('.mobile-menu').slideFadeToggle();
556		            jQuery('.mobile-nav-controller .be-mobile-menu-icon').toggleClass('is-cl
556icked'); 
557		        });
558
559		        jQuery(document).on('click', '.mobile-sub-menu-controller', function () {
560		            jQuery(this).siblings('.sub-menu').slideFadeToggle();
561		            jQuery(this).toggleClass('isClicked');
562		        });
563		    },
564
565		    falling_menu = function() {
566		        jQuery(document).on('click', '.menu-falling-animate-controller', function () {
567		            var delay = 1, 
568		            $this = jQuery(this);  
569
570	                jQuery('#menu, #left-menu, #right-menu').children('.menu-item').each(function() {
571	                	if( body.hasClass('menu-animate-fall-active') ) {
572	                    	jQuery(this).delay(delay).removeClass('return-position', 400);
573	                    } else {
574	                    	jQuery(this).delay(delay).addClass('return-position', 400);
575	                    }
576	                    delay += 50;
577	                }).promise().done( function(){
578	                	if( body.hasClass('menu-animate-fall-active') ) {
579	                		body = body.removeClass('menu-animate-fall-active');
580	                	} else {
581	                		body = body.addClass('menu-animate-fall-active');
582	                	}
583	                    
584	                    jQuery('.menu-falling-animate-controller .be-mobile-menu-icon').toggleClass('is-clicked');
585	                }); 
586
587		        });		    	
588			},
589
590			sub_menu = function() {
591		        jQuery(document).on('click', '.top-overlay-menu .menu-item-has-children a, .left-header .menu-item-has-children a , #mobile-menu .menu-item-has-children a', function () {
592		            if(jQuery(this).attr('href') == '#'){
593		                jQuery(this).siblings('.sub-menu').slideFadeToggle();
594		                jQuery(this).siblings('.mobile-sub-menu-controller').toggleClass('isClicked');
595		            }
596		        });				
597			},
598
599			local_scroll = function() {
600				asyncloader.require( 'easing', function() {
601			        jQuery(document).on('click', 'a[href="#"]', function (e) {
602			            e.preventDefault();
603			        });
604			        jQuery(document).on('click', 'a', function (e) {
605			            var $link_to = jQuery(this).attr('href'), 
606			            url_arr, 
607			            $element,
608			            mobile_menu = jQuery('.mobile-menu'),
609			            $path = window.location.href;
610
611			            if (jQuery(this).hasClass('ui-tabs-anchor')) {
612			                return false;
613			            }
614
615			            if ( $link_to ) {
616			                url_arr = $link_to.split('#');
617			                if ($link_to.indexOf('#') >= 0 && $path.indexOf(url_arr[0]) >= 0) {
618			                    $element = $link_to.substring($link_to.indexOf('#') + 1);
619			                    if ($element) {
620			                        if (jQuery('#' + $element).length > 0) {
621			                            e.preventDefault();
622			                            if (jQuery(window).width() < 960 && mobile_menu.length > 0 ) {
623			                                mobile_menu.slideUp(500, function () {
624			                                    animate_scroll(jQuery('#' + $element));
625			                                });
626			                            } else {
627			                                animate_scroll(jQuery('#' + $element));
628			                            }
629			                        }
630			                    }
631			                }
632			            }
633			        });	
634			    });			
635			},
636
637			sliderbar_navigation = function() {
638		        jQuery(document).on('click', '.sliderbar-nav-controller-wrap', function () {
639		            jQuery('.sb-slidebar').toggleClass('opened');
640		            body = body.toggleClass('slider-bar-opened');
641
642		            if( body.hasClass('top-overlay-menu') ) {
643		               html = html.toggleClass('hide-overflow');
644		                // jQuery('.layout-box-container').fadeOut();
645		                if( body.hasClass('be-themes-layout-layout-border-header-top') ){
646		                    jQuery('.sliderbar-menu-controller .be-mobile-menu-icon').toggleClass('is-clicked');
647		                }
648		            } else{
649		                jQuery('.sliderbar-menu-controller .be-mobile-menu-icon').toggleClass('is-cl
649icked');
650		            }
651		        });				
652			},
653
654			left_strip = function() {
655		        jQuery(document).on('click', '#sb-left-strip', function () {
656		            var $this = jQuery(this);
657		            jQuery('.sb-slidebar').toggleClass('opened');   
658		            if( $this.hasClass('menu_push_main') ){
659		                body = jQuery('body').toggleClass('slider-bar-opened');  
660		            }
661		            if($this.hasClass('overlay')) {
662		                html = html.toggleClass('hide-overflow');
663		                jQuery('.layout-box-container').fadeOut();     
664		            }
665		            if( $this.hasClass('strip') ) {
666		                jQuery('.left-strip-wrapper').toggleClass('hide');    
667		                jQuery('#main-wrapper').toggleClass('hidden-strip'); 
668		            }
669		        });				
670			},
671
672	    	close_sidebar = function() {		        
673		        if( body.hasClass('top-overlay-menu') || body.hasClass('left-overlay-menu') ){
674		            if( body.hasClass('be-themes-layout-layout-border-header-top')){
675		                close_slidebar_menu();
676		            }
677		            jQuery('.layout-box-container').fadeIn();  
678		            jQuery('#slidebar-menu li').removeClass('menu-loaded');
679		        } else {
680		            close_slidebar_menu();
681		        }
682		        jQuery('.sb-slidebar').removeClass('opened');
683
684		        body = body.removeClass( 'slider-bar-opened' );  
685	    	},
686
687	    	close_slidebar_menu = function() {
688		        var be_sidebar_mobile_menu = jQuery('.sliderbar-menu-controller').find('.be-mobile-menu-icon');
689		        if( body.hasClass( 'slider-bar-opened') && body.hasClass('top-header' ) ){
690		            be_sidebar_mobile_menu.toggleClass('is-clicked');
691		        }	    		
692	    	},
693
694	    	close_mobile_menu = function() {
695	    		var mobile_menu = jQuery('.mobile-menu');
696		        if ( mobile_menu.is(":visible") ) {
697		            mobile_menu.slideFadeToggle();
698		            jQuery('.mobile-nav-controller .be-mobile-menu-icon').toggleClass('is-clicked');
699		        }
700	    	},
701
702	    	close_search_box = function() {
703	    		var search_box = jQuery('.search-box-wrapper');
704		        if ( search_box.is(":visible") ) {
705		            search_box.fadeOut();
706		            html = html.toggleClass('hide-overflow');
707		        }
708	    	},			
709
710			close_overlay_menu = function() {
711		        jQuery(document).on('click', '.overlay-menu-close', function () {    
712		            close_sidebar();
713		            open_leftstrip();
714		        });				
715			},
716
717			close_gallery_info_box = function() {
718		        jQuery(document).on('click', '.single_portfolio_info_close', function () {
719		            jQuery(this).closest('.gallery_content').toggleClass('show');
720		            //jQuery(".gallery_content_area").mCustomScrollbar("update");
721		        });				
722			},
723
724			close_popups = function() {
725		        jQuery(document).on('mouseup', '.sliderbar-menu-controller, .sb-slidebar, .mobile-nav-controller, .mobile-menu, .header-search-controls .search-button, .search-box-wrapper', function () {
726		            if (jQuery(this).hasClass('sliderbar-menu-controller') || jQuery(this).hasClass('sb-slidebar')) {
727		                close_mobile_menu();
728		                close_search_box();
729		            }
730		            if (jQuery(this).hasClass('mobile-nav-controller') || jQuery(this).hasClass('mobile-menu')) {
731		                close_sidebar();
732		                close_search_box();
733		            }
734		            if (jQuery(this).hasClass('search-button') || jQuery(this).hasClass('search-box-wrapper')) {
735		                close_mobile_menu();
736		                close_sidebar();
737		            }
738		            return false;
739		        });	
740
741		        jQuery(document).on('mouseup', function () {
742		            close_sidebar();
743		            open_leftstrip();
744		            close_mobile_menu();
745		            close_search_box();
746		        });
747
748		        jQuery(document).on('keyup', function (e) {
749		            if (e.keyCode === 27) {
750		                close_sidebar();
751		                open_leftstrip();
752		                close_search_box();
753		                if (jQuery('.gallery_content').hasClass('show')) {
754		                    jQuery('.gallery_content').removeClass('show');
755		                } else {
756		                    if (jQuery('.gallery-slider-wrap').hasClass('opened')) {
757		                        jQuery('html').removeClass('overflow-hidden');
758		                        jQuery('.gallery-slider-wrap').css('left', '100%').css('opacity', 0);
759		                        setTimeout(function () {
760		                            jQuery('.gallery-slider-wrap').removeClass('opened');
761		                            jQuery('.gallery-slider-content').empty();
762		                            jQuery('.gallery-slider-wrap').css('left', '-100%');
763		                        }, 300);
764		                    }
765		                }
766		            }
767		        });
768			},
769
770			back_to_top = function() {
771		        jQuery(document).on('click', '#back-to-top, .back-to-top', function (e) {
772		            e.preventDefault();
773		            jQuery('body,html').animate({ scrollTop: 0 }, 1000, 'easeInOutQuint');
774		        });				
775			},
776
777			show_back_to_top_button = function() {
778		        if ( jQuery(window).scrollTop() > 10 ) {
779		            to_top_button.fadeIn();
780		        } else {
781		            to_top_button.fadeOut();
782		        }
783			},
784
785		    flickity_default_header = function(){   
786		        if(jQuery('.portfolio-sliders').length){
787		            if(jQuery('body.header-transparent').length){
788		                if(Number(jQuery(window).width()) <= 960){
789		                    jQuery('#header-inner-wrap').css('position','relative');
790		                }
791		                else{
792		                    jQuery('#header-inner-wrap').css('position','absolute');
793		                }
794		            }
795		        }
796		    },  
797
798		    flickity_getHeight = function(){
799		        if(jQuery('#content.portfolio-sliders').length){
800		            var $this = jQuery('#content.portfolio-sliders'),
801		                $gutter_width = Number($this.attr('data-gutter-width')),
802		                $slider_type = $this.attr('data-slider-type'),
803		                $window_width = Number(jQuery(window).width()) + jQuery.getScrollbarWidth(), //Number(jQuery('#main-wrapper').width()) + jQuery.getScrollbarWidth()
804		                $mobile_calculation = true,
805		                $full_window_height = Number(jQuery(window).height()),
806		                $window_height = $full_window_height-(Number(jQuery('#header').innerHeight())+Number(jQuery('#wpadminbar').innerHeight())+Number(jQuery('#portfolio-title-nav-wrap').innerHeight()));
807
808
809		            if($this.find('.disable-flickity-mobile').length){
810		                $mobile_calculation = false;
811		            }
812		            if(jQuery('body').hasClass('be-themes-layout-layout-border-header-top')) {
813		                var $border_length = 1;  
814		            }else{
815		                var $border_length = 2;
816		            }
817		            //Calculate Height and Width of Image Wrappers
818		            //CONDITION 1 - If Flickity is Disabled for Mobile Devices 
819		            if($mobile_calculation == false && $window_width <= 960){  
820		                //Remove Scrollbar in Mobile View
821		                var $scrollable_content =  $this.find('.gallery_content_slide');
822		                $scrollable_content.height('auto');
823		               // if( 'undefined' !== typeof mCustomScrollbar ) {
824		                	//$scrollable_content.mCustomScrollbar("disable"); 
825		               // }
826		                //Add Image URL to src tag
827		                $this.find('.be-flickity .img-wrap').each(function(){
828		                    var $this_img_wrap = jQuery(this),
829		                        $this_img = $this_img_wrap.find('img'),
830		                        $data_source = $this_img.attr('data-flickity-lazyload');
831
832		                    $this_img.removeAttr("data-flickity-lazyload");
833		                    $this_img.attr('src',$data_source);
834		                    $this_img_wrap.width('100%').height('100%');
835		                }); 
836		            }
837		            //CONDITION 2 - Calculation for all Desktop Screen Sizes. And for Mobile Screen Size when Flickity is Enabled.
838		            if($mobile_calculation == true || $window_width > 960){  
839		                if($window_width <= 960 ) {
840		                    if($window_width >= 480 && $window_width < 640){
841		                        $window_height = $full_window_height;
842		                    }
843		                    $this.find('.img-wrap').width($window_width).height($window_height);
844		                    $this.find('.be-flickity').css('padding',0);
845		                }else{ 
846
847		                    if($slider_type == 'be-ribbon-carousel' || $slider_type == 'be-center-carousel'){ 
848		                        if(jQuery('#bottom-widgets').length){
849		                            var $footer_height = 0;
850		                        }else{
851		                            var $footer_height = Number(jQuery('#footer').innerHeight()) ;
852		                        }
853		                        var $window_height_addl = $window_height-((Number(jQuery('.layout-box-bottom:visible').height())*$border_length)+$footer_height),
854		                            $given_slider_height = $this.attr('data-height');
855		                        
856		                        //Set Height and Width according to above Calculations
857		                        var $slider_height = Math.round(($window_height_addl/100)*parseInt($given_slider_height)),
858		                            $padding = ($window_height_addl-$slider_height)/2;
859		                        
860		                        $this.find('.img-wrap').height($slider_height);
861		                        $this.find('.gallery_content_slide').height($slider_height);
862		                        
863		                        $this.find('.be-flickity').css('padding', $padding+'px 0px '+$padding+'px 0px').css('opacity', 1);
864		                        $this.find('.be-flickity .img-wrap').each(function(){
865		                            var $this_img = jQuery(this),
866		                                $img = $this_img.find('img'),
867		                                $img_actual_width = $this_img.attr('data-image-width'),
868		                                $img_actual_height = $this_img.attr('data-image-height'),
869		                                $img_width = Math.round(($img_actual_width * $slider_height)/$img_actual_height);  
870
871		                            $this_img.width($img_width);
872		                        }); 
873
874		                    } else if ($slider_type == 'be-centered' || $slider_type == 'be-fullscreen'){
875
876		                        $given_slider_height = $this.attr('data-height');//100;
877		                        //Larger Screens
878		                        if(jQuery('#bottom-widgets').length){
879		                            var $footer_height = 0;
880		                        }else{
881		                            var $footer_height = Number(jQuery('#footer').innerHeight()) ;
882		                        }                            
883		                        var $window_height_addl = $window_height-((Number(jQuery('.layout-box-bottom:visible').height())*$border_length)+$footer_height);
884
885		                        //Set Height and Width according to above Calculations
886		                        var $slider_height = (($window_height_addl/100)*parseInt($given_slider_height)),
887		                            $padding = ($window_height_addl-$slider_height)/2;
888
889		                        $this.find('.be-flickity').css('padding', $padding+'px 0px '+$padding+'px 0px').css('opacity', 1);
890		                        $this.find('.img-wrap').height($slider_height).width('100%'); 
891		                    }
892		                }
893		            } 
894		            
895		            //Calculation of Thumbnail Position if Flickity is Enabled for Mobile Devices
896		            if($mobile_calculation == true){
897		                if($window_width <= 960){
898		                    var $thumbnail_position =  $window_height+37 - Number(jQuery('#header').innerHeight()); 
899		                    jQuery('.portfolio-sliders .single-portfolio-slider.carousel_bar_area').css('top',$thumbnail_position);  
900		                }else{
901		                    jQuery('.portfolio-sliders .single-portfolio-slider.carousel_bar_area').css('top','initial'); 
902		                }
903		            }
904		        }
905		    },
906
907		    flickity_call = function(){
908		        var $flickity_gallery = jQuery('.main-gallery.be-flickity');
909		        if( $flickity_gallery.length > 0 ) {
910			        var    $slider_type = $flickity_gallery.closest('.portfolio-sliders').attr('data-sli
910der-type'),
911			            $nav_arrow = Boolean($flickity_gallery.attr('data-nav-arrow')),
912			            $auto_play_time = parseInt($flickity_gallery.attr('data-auto-play')),
913			            $free_scroll = Boolean($flickity_gallery.attr('data-free-scroll')),
914			            $keyboard_crtl = Boolean($flickity_gallery.attr('data-keyboard-crtl')),
915			            $loop_ctrl = Boolean($flickity_gallery.attr('data-loop-crtl')),
916			            $cell_align = 'center',
917			            $percentPosition = true,
918			            $body = jQuery('body');
919
920			        if($auto_play_time <= 0){
921			            $auto_play_time = false;
922			        }
923			        
924			        if($slider_type == 'be-ribbon-carousel'){
925			            $cell_align = 'left';
926			            $percentPosition = false;
927			        }
928			        if($slider_type == 'be-center-carousel'){
929			            $cell_align = 'center';
930			            $percentPosition = false;
931			        }
932			        if((Number(jQuery(window).width()) + jQuery.getScrollbarWidth()) <= 960){
933			            $free_scroll = false;
934			        }
935			        var $flickity_gallery = jQuery('.main-gallery.be-flickity').flickity({
936			            lazyLoad: 3,
937			            prevNextButtons: $nav_arrow,
938			            wrapAround: $loop_ctrl,
939			            freeScroll: $free_scroll,
940			            accessibility: $keyboard_crtl,
941			            autoPlay: $auto_play_time,
942			            contain: true,
943			            cellAlign: $cell_align,
944			            percentPosition:$percentPosition,
945			            pageDots: false,
946			            watchCSS: true,
947			            arrowShape: { 
948			              x0: 20,
949			              x1: 40, y1: 20,
950			              x2: 45, y2: 20,
951			              x3: 25
952			            }   
953			        });
954
955			        var $flickity_instance = $flickity_gallery.data('flickity');
956			       
957			        var iframes = $flickity_gallery.find('.img-wrap iframe');
958			        if($slider_type == 'be-ribbon-carousel' || $slider_type == 'be-center-carousel'){
959			            flickity_resetGutter($flickity_gallery);
960			        }
961			        $flickity_gallery.on('lazyLoad',function(event, cellElement){
962			            var img = event.originalEvent.target;
963			            // Resize to Parent
964			            if($slider_type != 'be-centered'){
965			                if(Number(jQuery(window).width()) > 960){
966			                    jQuery(img).resizeToParent(); 
967			                }
968			            }
969
970			        })
971			        // Apply Fit Vids
972			        $flickity_gallery.find('.img-wrap iframe').fitVids();
973			        $flickity_gallery.find('.img-wrap iframe').css('opacity',1);
974			        $flickity_gallery.find('.img-wrap .img-overlay-wrap').css('display','block');
975
976			        if($slider_type == 'be-fullscreen'){
977			            $flickity_gallery.flickity('resize');
978			        }
979
980			        $flickity_gallery.on( 'settle', function( event, pointer ){
981			            // Pause Video on Slider Movement
982			            iframes.each( function() {
983			                var iframe_id = jQuery(this).attr('id');
984			                if( iframe_id ) {
985			                    var iframe = document.getElementById( iframe_id );
986			                    var player = $f(iframe);
987			                    player.api("pause");
988			                }
989			            });
990
991			            var $this_img_wrap = jQuery($flickity_instance.selectedElement);
992			            // Increment Slider Count
993			            jQuery('.current-slide-count').text(($flickity_instance.selectedIndex) + 1);
994			            // Remove Overlay Wrapper
995			            $flickity_gallery.find('.img-wrap.is-selected').css('z-index','-1');
996			            // Background Check
997			            if (!($body.hasClass('disable_rev_slider_bg_check')) && !($body.hasClass('semi'))){
998			                if($slider_type == 'be-fullscreen' && ($this_img_wrap.find('iframe').length <= 0) ){
999			                    
1000			                    BackgroundCheck.init({
1001			                        targets: '#header #header-inner-wrap, .portfolio-sliders .transparent-nav-bar',
1002			                        images: '.be-fullscreen .img-wrap.is-selected img'
1003			                    });
1004			                    
1005			                    BackgroundCheck.refresh();
1006			                }
1007			            }
1008			        });
1009				}
1010		        // BackgroundCheck.destroy();
1011		    },
1012
1013		    flickity_resize = function(){
1014		        var $flickity_gallery = jQuery('.main-gallery.be-flickity'),
1015		            $slider_type = $flickity_gallery.closest('.portfolio-sliders').attr('data-slider-type'); 
1016
1017		        if($slider_type != 'be-centered'){
1018		            if(Number(jQuery(window).width()) > 960){
1019		                $flickity_gallery.find('.img-wrap img').resizeToParent(); 
1020		            }
1021		        }
1022		    },
1023
1024		    flickity_resetGutter = function(onFlickityGallery){
1025		        var $flickity_slider = onFlickityGallery.find('.flickity-slider'),
1026		            $flickity_wrapper = onFlickityGallery.closest('#content'),
1027		            $gutter_width = $flickity_wrapper.attr('data-gutter-width');
1028		        
1029		        if(Number(jQuery(window).width()) <= 960 ) {
1030		            $flickity_slider.css('left',0);
1031		        }else{
1032		            $flickity_slider.css('left',Number($gutter_width)); 
1033		        }
1034		    },
1035
1036		    flickity_thumb_call = function(){
1037
1038		        var $flickity_thumb_gallery = jQuery('.be-flickity-thumb').flickity({
1039		            asNavFor: '.main-gallery', 
1040		            freeScroll: true,
1041		            contain: true, 
1042		            pageDots: false,
1043		            prevNextButtons: false
1044		        });
1045		    },
1046
1047		    carousel_thumb_call = function(){
1048
1049		        var $flickity_thumb_gallery = jQuery('.be-carousel-thumb').flickity({
1050		            freeScroll: true,
1051		            contain: true, 
1052		            pageDots: false,
1053		            prevNextButtons: false
1054		        });
1055		    },
1056
1057		    woocommerce = function() {
1058				jQuery(document).on( 'mouseenter', '.header-cart-controls', function() {
1059					if(jQuery(this).find('.cart_list.product_list_widget ').length > 0) {
1060						jQuery(this).find('.widget_shopping_cart_wrap').stop(true, false).fadeIn();
1061					}
1062				});
1063
1064				jQuery(document).on( 'mouseleave', '.header-cart-controls', function() {
1065					if(jQuery(this).find('.cart_list.product_list_widget ').length > 0) {
1066						jQuery(this).find('.widget_shopping_cart_wrap').stop(true, false).fadeOut();
1067					}
1068				});
1069
1070				asyncloader.require( 'magnificpopup', function() {
1071					jQuery('.product-single-boxed-content .images').magnificPopup({
1072						delegate: 'a',
1073						type: 'image',
1074						tLoading: 'Loading image #%curr%...',
1075						mainClass: 'mfp-img-mobile',
1076						gallery: {
1077							enabled: true,
1078				            navigateByImgClick: true,
1079				            preload: [0,1] // Will preload 0 - before current, and 1 after the current image
1080						},
1081						image: {
1082				            tError: '<a href="%url%">The image #%curr%</a> could not be loaded.'
1083						}
1084				    });	
1085				});	    	
1086		    },
1087
1088		    heroSectionParallax = function() {
1089		    	var parallax = jQuery('.be-section.be-bg-parallax');
1090		        if( parallax.length > 0 ) {
1091		            parallax.each(function (i, el) {
1092		                var el = jQuery(el);
1093		                if (el.visible(true)) {
1094		                    if(!jQuery(this).hasClass('parallaxed')) {
1095		                        jQuery(this).parallax("50%", 0.4);
1096		                        jQuery(this).addClass('parallaxed');
1097		                    }
1098		                }
1099		            });
1100		        }		    	
1101		    },
1102
1103		    tatsuFirstSection = function() {
1104		    	if( jQuery('#hero-section').length == 0 ) {
1105		    		jQuery('#header-inner-wrap').addClass( jQuery('.tatsu-section:first-child').attr('data-headerscheme') );
1106		    	}
1107		    },
1108
1109		    ready = function() {
1110
1111		    	tatsuFirstSection();
1112
1113		    	jQuery('.component ul li:first-child').addClass('current');
1114
1115		    	asyncloader.require( 'fitvids' , function(){
1116	    	        body.find('iframe').not('.rev_slider iframe').each(function () {
1117	            		jQuery(this).parent().fitVids();
1118	        		});
1119	    	    });
1120
1121		        jQuery( document ).on( 'click', '.top-overlay-menu .sliderbar-nav-controller-wrap, .left-overlay-menu .left-strip-wrapper',  menu_link_animation );	
1122
1123		        //Handle Transparent & Sticky Headers
1124		        asyncloader.require( [ 'transparentheader' ], function(){
1125		        	jQuery('#header').Transparent();
1126		        });	 
1127
1128		        //Handle Scroll to Sections
1129		        if( body.hasClass('section-scroll') && !body.hasClass('tatsu-frame') ) {
1130		        	asyncloader.require( [ 'scrolltosections', 'mousewheel', 'vimeo' ], function(){
1131		        		body.SectionScroll();
1132		        	});
1133		        }
1134
1135		        if( jQuery('#galaxy-canvas').length > 0 ) {
1136		        	asyncloader.require( [ 'greensock', 'request_animation_frame', 'galaxycanvas' ], function(){
1137		            	galaxy_canvas();
1138		            });
1139		        }
1140
1141		        if( jQuery('#pattern-canvas').length > 0 ) {
1142		        	asyncloader.require( [ 'greensock', 'request_animation_frame', 'patterncanvas' ], function(){
1143		            	pattern_canvas();  
1144		          });
1145		        }
1146
1147		        if( jQuery('#waterdrops-canvas').length > 0 ) {
1148		        	asyncloader.require( [ 'greensock', 'request_animation_frame', 'waterdropcanvas' ], function(){
1149		            	water_drop_canvas();
1150		            });
1151		        }
1152
1153		        if( fullscreen_wrap.length > 0 ) {
1154					asyncloader.require( [ 'fullscreenheight' ], function(){
1155						fullscreen_wrap.FullScreen();
1156					});		        	
1157		        }	
1158
1159
1160		        custom_scrollbar();
1161		        close_sidebar();
1162		        open_leftstrip();
1163		        menu_item_update();
1164		        single_page_nav();
1165		        superfish();
1166		        sliders();
1167		        rev_slider_bg_check();
1168		        woocommerce();
1169		        heroSectionParallax();
1170
1171		        //Handle Click Events
1172		        close_overlay_menu();
1173		        close_gallery_info_box();
1174		        close_popups();
1175		        back_to_top();
1176		        left_strip();
1177		        sliderbar_navigation();
1178		        local_scroll();
1179		        sub_menu();
1180		        falling_menu();
1181		        mobile_menu();
1182		        header_search();
1183
1184		        //Handle Mouseover events
1185		        carousel_thumb();
1186
1187		        //Flickity
1188		        if( jQuery('.main-gallery.be-flickity').length > 0 ) {
1189			        asyncloader.require(['flickity', 'backgroundcheck', 'resizetoparent' ], function() {
1190				        flickity_default_header();
1191		        		flickity_getHeight();
1192		        		flickity_call();
1193		        		flickity_thumb_call();
1194		        				        	
1195			        });
1196			    }
1197
1198			    if( jQuery('.be-carousel-thumb').length > 0 ) {
1199			    	asyncloader.require('flickity', function() {
1200						carousel_thumb_call();  		
1201			    	});
1202			    }
1203       			//
1204
1205		    },
1206
1207		    run = function() {
1208
1209		    	ready();
1210
1211		    	//On Window Scroll Event
1212		    	jQuery(window).on('scroll.oshine', function () {
1213		    		show_back_to_top_button();
1214		    		menu_item_update();
1215		    		sticky_sidebar();
1216		    		split_screen();
1217		    	});
1218
1219
1220		    	//On Window Resize Event
1221		    	jQuery(window).on( 'resize.oshine', function() {
1222		    		sticky_sidebar();
1223		    		split_screen();
1224		    		//close_mobile_menu();
1225		    		menu_item_update();
1226			        if (jQuery(window).width() > 960) {
1227			            jQuery('.mobile-menu').slideUp();
1228			        }
1229
1230	        	 	//jQuery(".gallery_content_area, .ps-content-inner, .gallery_content_slide").mCustomScrollbar("update");
1231
1232
1233					if( jQuery('.main-gallery.be-flickity').length > 0 ) {
1234						asyncloader.require( ['flickity', 'backgroundcheck', 'resizetoparent'], function() {
1235						    flickity_default_header();
1236						    flickity_getHeight();
1237						    var $flickity_gallery = jQuery('.main-gallery.be-flickity');
1238
1239						    if(jQuery(window).width() > 960){
1240						        $flickity_gallery.find('.img-wrap').each(function(){
1241						            var $this_img = jQuery(this),
1242						                $img = $this_img.find('img');
1243						            //Reassign Img Source Attribute to Enable Lazyload in Larger Screen Sizes
1244						            if( ($img.attr('src') ) && !($img.hasClass('flickity-lazyloaded') ) ) {
1245						            var $data_source = $img.attr('src');
1246						                $img.removeAttr("src");
1247						                $img.attr('data-flickity-lazyload',$data_source);
1248						            }
1249						        });
1250						    }
1251						    $flickity_gallery.flickity('reloadCells');
1252						    // Resize to Parent
1253						    flickity_resize();
1254						    flickity_resetGutter($flickity_gallery);
1255						    flickity_thumb_call();
1256						});
1257					}
1258
1259				    if( jQuery('.be-carousel-thumb').length > 0 ) {
1260				    	asyncloader.require( 'flickity', function() {
1261							carousel_thumb_call();  		
1262				    	});
1263				    }									
1264		    	});
1265
1266		    	// On Window Load Event
1267				jQuery(window).load(function () {
1268				        var $hash = window.location.hash;
1269				        if ($hash) {
1270				            if (jQuery($hash).length > 0) {
1271				                animate_scroll( jQuery($hash) );
1272				            }
1273				        }
1274				        setTimeout(function () {
1275				        	asyncloader.require( 'imagesloaded' , function(){
1276					            body.imagesLoaded(function () {
1277					                sticky_sidebar();
1278					                split_screen();
1279					            });
1280					        });    
1281				        }, 200);
1282				        custom_scrollbar();
1283				});
1284		    }
1285
1286
1287			return {
1288				run: run
1289			}
1290
1291	    })();
1292		
1293	    oshine_scripts.run();
1294
1295	});    
1296
1297})( 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.