PageSourceSearch

https://mathgrrl.com/wp-content/themes/crocal/js/main.js?ver=2.2.1

js mathgrrl.com collected 2026-10-03 19:50:57 UTC 147,823 bytes, 4,616 lines download raw bytes

1
2// ================================================================================== //
3
4	// # Document on Ready
5	// # Document on Resize
6	// # Document on Load
7
8	// # Leader Post Size
9	// # Sticky Sidebar Widget
10	// # Sticky Sidebar
11	// # Feature Section
12	// # Feature Parallax
13	// # Page Settings
14	// # Basic Elements
15	// # Isotope
16	// # Parallax Section
17	// # Section Settings
18	// # Scroll Direction
19	// # Global Variables
20	// # Scrollbar Width
21	// # Full Page
22
23// ================================================================================== //
24
25
26var EUTHEM = EUTHEM || {};
27
28(function($){
29
30	"use strict";
31
32
33	// # Document on Ready
34	// ============================================================================= //
35	EUTHEM.documentReady = {
36		init: function(){
37			EUTHEM.pageSettings.bodyLoader();
38			EUTHEM.svgAnimation.init();
39			EUTHEM.advancedHiddenMenu.init();
40			EUTHEM.pageSettings.removeVideoBg();
41			EUTHEM.pageSettings.addVideoBg();
42			EUTHEM.slideToggleMenu.init( '#eut-hidden-menu', '#eut-hidden-menu .eut-menu' );
43			EUTHEM.slideToggleMenu.init( '#eut-main-header.eut-header-side', '#eut-main-menu.eut-vertical-menu .eut-menu' );
44			EUTHEM.slideToggleMenu.init( '#eut-sidearea', '.widget_nav_menu' );
45			EUTHEM.featureSection.init( '#eut-feature-section' );
46			EUTHEM.featureParallax.init();
47			EUTHEM.featureSection.init( '.eut-page-title' );
48			EUTHEM.pageSettings.init();
49			EUTHEM.sectionSettings.init();
50			EUTHEM.leaderPostSize.init();
51			EUTHEM.isotope.init();
52			EUTHEM.basicElements.init();
53			EUTHEM.pageSettings.lightGallery();
54			EUTHEM.fullPage.init();
55			EUTHEM.pillingPage.init();
56			EUTHEM.sectionNav.init();
57		}
58	};
59
60	EUTHEM.reCall = {
61		init: function(){
62			EUTHEM.sectionSettings.init();
63		}
64	};
65
66
67	// # Document on Resize
68	// ============================================================================= //
69		EUTHEM.documentResize = {
70		init: function(){
71			EUTHEM.featureSize.init( '#eut-feature-section' );
72			EUTHEM.featureSize.init( '.eut-page-title' );
73			EUTHEM.sectionSettings.init();
74			EUTHEM.sectionHeight.resetHeight( '.eut-section' );
75			EUTHEM.anchorMenu.resetSticky( '.eut-anchor-menu' );
76			EUTHEM.pageSettings.resizeVideoBg();
77			EUTHEM.pageSettings.stickyElements();
78			EUTHEM.isotope.relayout();
79			EUTHEM.pageSettings.closeSideArea();
80		}
81	};
82
83	// # Document on Load
84	// ============================================================================= //
85	EUTHEM.documentLoad = {
86		init: function(){
87			EUTHEM.sectionHeight.init( '.eut-section' );
88			EUTHEM.parallaxSection.init('#eut-content .eut-bg-parallax');
89			EUTHEM.parallaxSection.init('.eut-column.eut-bg-parallax');
90			EUTHEM.anchorMenu.init( '.eut-anchor-menu' );
91			EUTHEM.stickySidebarWidget.init();
92			EUTHEM.stickySidebar.init();
93			EUTHEM.pageSettings.stickyElements();
94			EUTHEM.basicElements.iconBox();
95			EUTHEM.pageSettings.columnEffect();
96			EUTHEM.wooThumbCarousel.init();
97			EUTHEM.wooProductRating.init();
98
99			// Location Hash
100			if (window.location.hash) {
101				setTimeout(function() {
102					var target = window.location.hash;
103					if( $(target).length ){
104						if ( $(target).hasClass('eut-tab-content') || $(target).hasClass('eut-accordion-content')  ) {
105							var tabLink =  $('.eut-tab-link[data-rel="' + target + '"]:visible');
106							if ( tabLink.length ) {
107								tabLink.click();
108								setTimeout(function() {
109									EUTHEM.pageSettings.linkGoToTop( tabLink );
110								}, 500);
111							}
112						} else {
113							$('html, body').scrollTop( $(target).offset().top );
114						}
115					}
116				}, 0);
117			}
118		}
119	};
120
121	// # Section Height
122	// ============================================================================= //
123	EUTHEM.sectionHeight = {
124		init: function(section){
125			var $section = $(section);
126			EUTHEM.sectionHeight.resetHeight( section );
127		},
128		settings: function(element){
129
130				var windowH = $(window).height(),
131					$section = element;
132				$section.each(function(){
133					var $that = $(this);
134
135					if( $that.find('.eut-big-post').length || $that.parents('.eut-big-post').length ) {
136						$that.removeClass('eut-loading-height');
137						return;
138					}
139
140					if( !$that.hasClass('eut-percentage-height') && !$that.find('.eut-percentage-height').length ) return;
141
142					if( $that.hasClass('eut-percentage-height') ){
143						EUTHEM.sectionHeight.getHeight( $that, windowH );
144					}
145					var $row = $that.find('.eut-row'),
146						$column = $that.find('.eut-column'),
147						sectionH = $that.hasClass('eut-percentage-height') ? $that.height() : windowH,
148						maxHeight = 0;
149
150					$column.each(function(){
151						var $col = $(this),
152							$colChild = $col.find('.eut-inner-section.eut-percentage-height'),
153							$colParent = $col.parents('.eut-row'),
154							elementSpace = EUTHEM.sectionHeight.getElementSpace( $colChild ),
155							colHeight = $col.height(),
156							parentH = sectionH - elementSpace;
157
158						$colChild.each(function(){
159							EUTHEM.sectionHeight.getHeight( $(this), parentH );
160						});
161						maxHeight = $colParent.height() > maxHeight ? $colParent.height() : maxHeight;
162					});
163
164					if( maxHeight >= sectionH ){
165						$row.css({'min-height' : maxHeight});
166					}
167				});
168
169		},
170		getRatio: function(element){
171			var ratio,
172				windowWidth = $(window).width() + scrollBarWidth;
173
174			if ( windowWidth > tabletLandscape ) {
175				ratio = element.data('height-ratio') !== undefined ? element.data('height-ratio')/100 : 0;
176			} else if ( windowWidth > tabletPortrait && windowWidth <= tabletLandscape ) {
177				ratio = element.data('tablet-height-ratio') !== undefined ? element.data('tablet-height-ratio')/100 : element.data('height-ratio') !== undefined ? element.data('height-ratio')/100 : 0;
178			} else if ( windowWidth > mobileScreen && windowWidth <= tabletPortrait ) {
179				ratio = element.data('tablet-sm-height-ratio') !== undefined ? element.data('tablet-sm-height-ratio')/100 : element.data('height-ratio') !== undefined ? element.data('height-ratio')/100 : 0;
180			} else {
181				ratio = element.data('mobile-height-ratio') !== undefined ? element.data('mobile-height-ratio')/100 : element.data('height-ratio') !== undefined ? element.data('height-ratio')/100 : 0;
182			}
183
184			return ratio;
185		},
186		getHeight: function( element, parentH ){
187			element.css({'height' : 'auto'});
188			var ratio = EUTHEM.sectionHeight.getRatio( element ),
189				minHeight = element.data('min-height') !== undefined ? element.data('min-height') : 0,
190				paddingT = parseInt( element.css('padding-top') ),
191				paddingB = parseInt( element.css('padding-bottom') ),
192				space = paddingT + paddingB,
193				content = element.find('.eut-percentage-content').first(),
194				contentH = content.height(),
195				elementH = Math.round( parentH * ratio ),
196				height = elementH > minHeight ? elementH - space : minHeight - space;
197
198			EUTHEM.sectionHeight.setHeight( element, content, height, contentH );
199		},
200		setHeight: function( element, content, height, contentH ){
201			if( height > contentH ){
202				content.css({ 'height' : height });
203			}
204			element.removeClass('eut-loading-height');
205		},
206		getElementSpace: function( element ){
207			var space = element.parent().children('.eut-element, .eut-empty-space'),
208				size = 0;
209			space.each(function(){
210				size += $(this).outerHeight();
211			});
212			return size;
213		},
214		resetHeight: function( section ){
215			var $section = $(section),
216				$row = $section.find('.eut-row'),
217				$content = $section.find('.eut-percentage-content');
218			$section.css({ 'height' : '' });
219			$row.css({ 'height' : '' });
220			$content.css({ 'height' : '' });
221			EUTHEM.sectionHeight.settings( $section );
222		}
223	};
224
225	// # Fixed Custom Position Column
226	// ============================================================================= //
227	EUTHEM.customPositionColumn = {
228		init: function(){
229			$('.eut-column.eut-custom-position').each(function(){
230				var $column = $(this),
231					columnW, columnX, windowW;
232
233				setup();
234
235				if( !isMobile.any() ) {
236					$(window).on('resize', resizer);
237				} else {
238					$(window).on('orientationchange', resizer);
239				}
240				function setup(){
241					resetPosition();
242					updateParams();
243					if( columnW + columnX >= windowW ){
244						resetPosition();
245						fixedPositionRight();
246					}
247
248					if( columnX < 0 ){
249						resetPosition();
250						fixedPositionLeft();
251					}
252				}
253				function updateParams(){
254					columnW = $column.outerWidth();
255					columnX = $column.offset().left;
256					windowW = $(window).width();
257				}
258				function resizer(){
259					var delay;
260					window.clearTimeout(delay);
261					delay = window.setTimeout(function() {
262						setup();
263					}, 200);
264				}
265				function fixedPositionRight(){
266					var newPosX = ( windowW - columnW ) - $column.offset().left;
267					$column.css({'left' : newPosX, 'right' : '' });
268				}
269				function fixedPositionLeft(){
270					var newPosX = - $column.offset().left;
271					$column.css({'left' : newPosX, 'right' : '' });
272				}
273				function resetPosition(){
274					$column.css({'left' : '', 'right' : ''});
275				}
276			});
277		}
278	};
279
280	// SVG Animation
281	EUTHEM.svgAnimation = {
282		init : function(){
283			if(bodyLoader){
284				return false;
285			}
286			var $svg = $('.eut-svg-icon');
287			$svg.each(function(){
288				var $icon = $(this),
289					duration = $icon.data('duration'),
290					id = $icon.attr('id'),
291					file = $icon.data('file'),
292					myVivus,
293					parentDelay = 0;
294
295					if ( 'svg' !== file.split('.').pop() ) {
296						return false;
297					}
298
299					if( $icon.parents('.eut-element').hasClass('eut-animated-item') ){
300						parentDelay = $icon.parents('.eut-element').data('delay');
301					}
302
303					$icon.appear(function() {
304						setTimeout(function () {
305							myVivus = new Vivus( id, {
306								duration : duration,
307								file : file,
308								type: 'async',
309								start : 'inViewport'
310							});
311						}, parentDelay);
312					},{accX: 0, accY: 0});
313			});
314		}
315	};
316
317
318
319	// # Advanced Hidden Menu
320	// ============================================================================= //
321	EUTHEM.advancedHiddenMenu = {
322		init : function(){
323			var $header = $('#eut-header'),
324				$mainHeader = $('#eut-main-header'),
325				$menu = $('#eut-main-menu'),
326				$menuEl = $menu.find('.eut-first-level'),
327				$headerEl = $mainHeader.find('.eut-header-elements-wrapper'),
328				$btn = $mainHeader.find('.eut-hidden-menu-btn a'),
329				openHeader = false,
330				hoverDelay;
331
332			if( !$menu.length || !$header.hasClass('eut-advanced-hidden-menu') ) return;
333
334			$mainHeader.on('mouseenter.advancedHidden', function(){
335				var $that = $(this);
336				if( !openHeader ){
337					openHeader = true;
338					toggleHeader();
339				}
340
341			});
342
343			$mainHeader.on('mouseleave.advancedHidden', function(){
344				var $that = $(this);
345				if( openHeader ){
346					openHeader = false;
347					toggleHeader();
348				}
349			});
350
351			$btn.on('click.advancedHidden', function(e){
352				e.preventDefault();
353				if( !openHeader ){
354					openHeader = true;
355					toggleHeader();
356				} else {
357					openHeader = false;
358					toggleHeader();
359				}
360			});
361
362			if( isMobile.any() ) {
363				$mainHeader.off('mouseenter.advancedHidden');
364				$mainHeader.off('mouseleave.advancedHidden');
365			}
366
367			var itemLength = $menuEl.length -1,
368				startTimer = false,
369				count = -1,
370				counter;
371
372			function toggleHeader(){
373				if( openHeader ){
374					clearInterval(hoverDelay);
375					$header.addClass('eut-header-hover');
376					$menuEl.removeClass('hide');
377
378					// Show Menu
379					startTimer = true;
380					counter = setInterval(timer, 100);
381
382				} else {
383					hoverDelay = setTimeout(function(){
384						$header.removeClass('eut-header-hover');
385						$menuEl.removeClass('show');
386						$headerEl.removeClass('show');
387					},400);
388
389					// Hide Menu
390					startTimer = false;
391					count = -1;
392					clearInterval(counter);
393					$header.removeClass('eut-open-menu');
394					$menuEl.addClass('hide');
395				}
396			}
397
398			function timer() {
399				count += 1;
400				if (count >= itemLength) {
401					clearInterval(counter);
402					$header.addClass('eut-open-menu');
403					$headerEl.addClass('show');
404				}
405				$menuEl.eq(count).addClass('show');
406			}
407		}
408	};
409
410	// # Leader Post Size
411	// ============================================================================= //
412	EUTHEM.leaderPostSize = {
413		init : function(){
414			var $leaderElement = $('.eut-blog-leader.eut-layout-1.eut-crocal-style');
415
416			if( !$leaderElement.length ) return;
417
418			var windowWidth,
419				maxHeight,
420				leaderHeight;
421
422			$leaderElement.each(function(){
423				var $this = $(this),
424					$leaderPost = $this.find('.eut-post-leader'),
425					resizing  = false;
426
427
428				resetHeight();
429				$(window).smartresize(resetHeight);
430
431				function resetHeight(){
432					if(!resizing){
433						resizing  = true;
434
435						$leaderPost.css({
436							'height' : ''
437						});
438
439						updateParams();
440					}
441				}
442
443				function updateParams() {
444					windowWidth = $(window).width();
445
446					$this.imagesLoaded('always',function(){
447						maxHeight = $this.outerHeight();
448						leaderHeight = $leaderPost.outerHeight();
449
450						setLeaderHeight();
451					});
452				}
453
454				function setLeaderHeight(){
455					if( maxHeight > leaderHeight && windowWidth + scrollBarWidth > tabletPortrait ){
456						$leaderPost.css({
457							'height' : maxHeight,
458							'visibility' : 'visible'
459						});
460					} else {
461						$leaderPost.css({
462							'visibility' : 'visible'
463						});
464					}
465
466					resizing = false;
467				}
468			});
469		}
470	};
471
472	// # Anchor Menu
473	// ============================================================================= //
474	var openAnchorMenu = false;
475	EUTHEM.anchorMenu = {
476		init: function( anchor ){
477			var $anchor = $(anchor);
478			if( !$anchor.length ) return;
479			EUTHEM.anchorMenu.resetSticky( anchor );
480		},
481		updateSticky: function( $wrapper, topOffset, topPos ){
482			var scroll = $(window).scrollTop(),
483				sticky = false;
484
485			if( scroll >= topOffset ){
486				sticky = true;
487				$wrapper
488					.addClass('eut-sticky')
489					.css({'top' : topPos});
490			} else {
491				sticky = false;
492				$wrapper
493					.removeClass('eut-sticky')
494					.css({'top' : ''});
495				$wrapper.css(EUTHEM.anchorMenu.doTranslate( 0 ));
496			}
497		},
498		setOffset: function( anchor ){
499			var $anchor   = $(anchor),
500				anchorT   = $anchor.offset().top,
501				$header   = $('#eut-header'),
502				stikyType = $header.data('sticky'),
503				headerH   = $header.data('sticky-height') !== undefined && stikyType != 'scrollup' && stikyType != 'none' ? $header.data('sticky-height') : 0,
504				frameSize = $('body').hasClass('eut-framed') ? $('#eut-frames').find('.eut-frame.eut-top').height() : 0,
505				offset    = 0;
506
507			offset = {
508				topOffset : anchorT - headerH - frameSize,
509				topPos : headerH + frameSize
510			};
511			return offset;
512		},
513		resetSticky: function( anchor ){
514			var $anchor  = $(anchor);
515			if( !$anchor.length ) return;
516			var $wrapper = $anchor.children('.eut-anchor-wrapper'),
517				windowW  = $(window).width();
518
519			EUTHEM.anchorMenu.resetResponsive( anchor );
520
521			if( windowW + scrollBarWidth < 1023 ) {
522				$anchor.addClass('eut-anchor-responsive');
523				$wrapper.removeClass('eut-sticky');
524				$wrapper.css(EUTHEM.anchorMenu.doTranslate( 0 ));
525				$(window).off('scroll.eut_anchor');
526				EUTHEM.anchorMenu.responsive( anchor );
527			} else {
528				$anchor.removeClass('eut-anchor-responsive');
529				var topOffset = EUTHEM.anchorMenu.setOffset( anchor ).topOffset,
530					topPos = EUTHEM.anchorMenu.setOffset( anchor ).topPos;
531				$(window).on('scroll.eut_anchor', function(){
532					EUTHEM.anchorMenu.updateSticky( $wrapper, topOffset, topPos );
533				});
534			}
535		},
536		moveAnchor : function( anchor, position ){
537			var $anchor  = $(anchor),
538				$wrapper = $anchor.children('.eut-anchor-wrapper');
539				if( $wrapper.hasClass('eut-sticky') ){
540					$wrapper.css(EUTHEM.anchorMenu.doTranslate( position ));
541				}
542		},
543		doTranslate : function(value){
544			return {
545				'-webkit-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
546				'-moz-transform'    : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
547				'-ms-transform'     : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
548				'-o-transform'      : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
549				'transform'         : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)'
550			};
551		},
552		responsive : function( anchor ){
553			var $anchor   = $(anchor),
554				$btn      = $anchor.find('.eut-anchor-btn'),
555				$menu     = $anchor.find('.menu'),
556				$menuLink = $menu.find('a');
557
558			$btn.on('click',function(e){
559				e.preventDefault();
560				if(openAnchorMenu){
561					$anchor.css({'height' : ''});
562					$menu.slideUp(function(){
563						openAnchorMenu = false;
564						$(this).removeAttr('style');
565					});
566				} else {
567					$anchor.css({'height' : 'auto'});
568					$menu.slideDown(function(){
569						openAnchorMenu = true;
570					});
571				}
572			});
573		},
574		resetResponsive: function( anchor ){
575			var $anchor = $(anchor),
576				$menu   = $anchor.find('.menu');
577			$menu.removeAttr('style');
578			openAnchorMenu = false;
579		}
580	};
581
582	// # Menu Slide or Toggle
583	// ============================================================================= //
584	EUTHEM.slideToggleMenu = {
585
586		init: function( parrent, element ){
587
588			$(element).each(function(){
589				if( !$(this).length ) return;
590
591				var $menu = $(this),
592				$menuParent = $menu.parents(parrent),
593				$menuItem   = $menu.find('li.menu-item-has-children > a'),
594				menuType    = $menuParent.hasClass('eut-slide-menu') ? 'slide' : 'toggle',
595				$arrow      = $('<i class="eut-arrow"></i>'),
596				$goBack     = $('<li class="eut-goback"><a href="#" aria-label="' + crocal_eutf_main_data.string_go_back + '"><i class="eut-arrow"></i></a></li>');
597
598				EUTHEM.slideToggleMenu.removeHiddenMenuItems( $menu );
599
600				if( menuType === 'slide' ) {
601					// Add Arrows
602					$arrow.appendTo( $menuItem.parent() );
603					// Add Go Back Button for Slide Menu
604					$goBack.prependTo( $menuItem.parent().find('>ul') );
605				} else {
606					// Add Arrows
607					$arrow.appendTo( $menuItem );
608				}
609
610				$menuItem.on('tap click',function(e){
611					var $this = $(this),
612						link  = $this.attr('href'),
613						open  = false;
614
615					if((link != '#' || link === '#') && menuType == 'toggle' ) {
616						if( !$this.parent().hasClass('open') && !open ) {
617							e.preventDefault();
618							$this.parent().addClass('open');
619							toggle( $this, open );
620						} else {
621							open = true;
622							toggle( $this, open );
623							$this.parent().removeClass('open');
624						}
625					} else if( link === '#' && menuType == 'slide' ) {
626						e.preventDefault();
627						var listLevel  = $this.parents('ul').length,
628							$firstItem = $this.parent().find('ul').first(),
629							menuOffset = $menu.offset().top,
630							offset     = $this.offset().top,
631							title      = $this.html();
632
633							appendTitle( title, $firstItem );
634
635						$firstItem.addClass('show').css({ 'top' : - ( offset - menuOffset ) });
636						var firstItemH = $firstItem.outerHeight();
637
638						if( $('body').hasClass('rtl') ) {
639							animRightMenu( firstItemH, listLevel );
640						} else {
641							animLeftMenu( firstItemH, listLevel );
642						}
643					}
644				});
645
646				if( menuType === 'slide' ) {
647					var $arrowBtn = $menuItem.parent().find('.eut-arrow');
648					$arrowBtn.on('click',function(){
649						var $this = $(this),
650							listLevel  = $this.parents('ul').length,
651							$firstItem = $this.parent().find('ul').first(),
652							menuOffset = $menu.offset().top,
653							offset     = $this.offset().top,
654							title      = $this.parent().find('a').first().html();
655
656						appendTitle( title, $firstItem );
657
658						$firstItem.addClass('show').css({ 'top' : - ( offset - menuOffset ) });
659						var firstItemH = $firstItem.outerHeight();
660
661						if( $('body').hasClass('rtl') ) {
662							animRightMenu( firstItemH, listLevel );
663						} else {
664							animLeftMenu( firstItemH, listLevel );
665						}
666
667					});
668				}
669
670				$('li.eut-goback a').on('click', function(e) {
671					e.preventDefault();
672					var listLevel  = $(this).parents('ul ul').length - 1,
673						$firstItem = $(this).closest('.sub-menu'),
674						firstItemH = $firstItem.closest('.menu-item-has-children').closest('ul').height();
675
676					setTimeout(function(){
677						$firstItem.removeClass('show');
678					},300);
679					if( $('body').hasClass('rtl') ) {
680						animRightMenu( firstItemH, listLevel );
681					} else {
682						animLeftMenu( firstItemH, listLevel );
683					}
684				});
685
686				function toggle( $this, open ){
687					var $subMenu = $this.parent().find('>ul');
688					if( open ) {
689						$subMenu.slideUp(200);
690					} else {
691						$subMenu.slideDown(200);
692					}
693				}
694
695				function animLeftMenu( height, listLevel ) {
696					$menu.parent().height(height);
697					$menu.css('transform', 'translate3d(' + - listLevel * 100 + '%,0,0)');
698				}
699
700				function animRightMenu( height, listLevel ) {
701					$menu.parent().height(height);
702					$menu.css('transform', 'translate3d(' + listLevel * 100 + '%,0,0)');
703				}
704
705				function appendTitle( title, list ){
706					if( list.find('.eut-goback .eut-item').length ) return;
707					$(title).appendTo( list.find('> .eut-goback a') );
708				}
709			});
710		},
711		removeHiddenMenuItems: function( $menu ){
712			var $hiddenMenuItem = $menu.find('li.eut-hidden-menu-item'),
713				$link = $hiddenMenuItem.find('>a'),
714				$subMenu = $hiddenMenuItem.find('>.sub-menu');
715
716			$link.remove();
717			$subMenu.unwrap().children().unwrap();
718		}
719
720	};
721
722	// # Sticky Sidebar Widget
723	// ============================================================================= //
724	EUTHEM.stickySidebarWidget = {
725		init: function(){
726
727			var $stickyWidget = $('#eut-content .eut-sticky-widget'),
728				sidebarWidget = false;
729
730			$stickyWidget.each(function(){
731				var $this = $(this);
732
733				if( $this.length > 0 ) {
734
735					if( $('.eut-sticky-widget').parent().parent().is('#eut-sidebar') ) {
736						sidebarWidget = true;
737					}
738
739					if( sidebarWidget && $('#eut-sidebar').hasClass('eut-fixed-sidebar') ) return;
740
741					var $content         = sidebarWidget ? $('#eut-main-content .eut-main-content-wrapper') : $this.parents('.eut-row'),
742						$sidebar         = $this.parent(),
743						headerHeight     = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0,
744						anchorHeight     = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0,
745						topOffset        = headerHeight + anchorHeight + 40;
746
747					var windowWidth,sidebarWidth,sidebarHeight,contentTop,contentPadding,sidebarTop;
748
749					var scrolling        = false,
750						sidebarAnimation = false,
751						resizing         = false;
752
753					updateParams();
754
755					if( windowWidth + scrollBarWidth > tabletPortrait ) {
756						$(window).on('scroll', checkSidebar);
757					}
758					$(window).smartresize(resetScroll);
759
760				}
761
762				function checkSidebar() {
763					if( !sidebarAnimation ) {
764						sidebarAnimation = true;
765						updateSidebarPosition();
766					}
767				}
768
769				function resetScroll() {
770					if( !resizing ) {
771						resizing = true;
772						$sidebar.removeClass('fixed').attr('style', '');
773						updateParams();
774					}
775				}
776
777				function updateParams() {
778					windowWidth    = $(window).width();
779					sidebarWidth   = $sidebar.width();
780					sidebarHeight  = $sidebar.height();
781					contentTop     = $content.offset().top;
782					contentPadding = parseInt( $content.css('padding-top') );
783					sidebarTop     = $this.offset().top;
784
785					$(window).off('scroll', checkSidebar);
786
787					if( windowWidth + scrollBarWidth > tabletPortrait ) {
788						$(window).on('scroll', checkSidebar);
789					}
790					resizing = false;
791				}
792
793				function updateSidebarPosition() {
794					var contentHeight = $content.height(),
795						scrollTop     = $(window).scrollTop(),
796						topPosition   = sidebarTop - contentTop - topOffset - contentPadding;
797
798					if( scrollTop < sidebarTop - topOffset ) {
799						$sidebar.removeClass('fixed').attr('style', '');
800					} else if( scrollTop >= sidebarTop - topOffset && scrollTop < sidebarTop + contentHeight - sidebarHeight - topOffset ) {
801						$sidebar.addClass('fixed').css({ 'top' : - topPosition, 'position' : 'fixed', 'width' : sidebarWidth });
802					} else {
803						if( $sidebar.hasClass('fixed') ) {
804							$sidebar.removeClass('fixed').css({ 'top' : contentHeight - sidebarHeight + 'px', 'position' : 'relative' });
805						}
806					}
807					sidebarAnimation =  false;
808				}
809			});
810		}
811	};
812
813	// # Sticky Sidebar
814	// ============================================================================= //
815	EUTHEM.stickySidebar = {
816		init: function(){
817
818			var $sidebar = $('#eut-sidebar');
819			if( $sidebar.length > 0 && $sidebar.hasClass('eut-fixed-sidebar') ) {
820
821				var $content         = $('#eut-main-content .eut-main-content-wrapper'),
822					$sidebarWrapper  = $sidebar.find('.eut-wrapper'),
823					headerHeight     = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0,
824					anchorHeight     = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0,
825					topOffset        = headerHeight + anchorHeight + 100,
826					bottomOffset     = 0;
827
828				var windowWidth,sidebarWidth,sidebarHeight,contentPadding,sidebarTop;
829
830				var scrolling        = false,
831					sidebarAnimation = false,
832					resizing         = false;
833
834				updateParams();
835
836				if( windowWidth + scrollBarWidth > tabletPortrait ) {
837					$(window).on('scroll', checkSidebar);
838				}
839
840				$(window).smartresize(resetScroll);
841			}
842
843			function checkSidebar() {
844				if( !sidebarAnimation ) {
845					sidebarAnimation = true;
846					updateSidebarPosition();
847				}
848			}
849
850			function resetScroll() {
851				if( !resizing ) {
852					resizing = true;
853					$sidebarWrapper.removeClass('fixed').attr('style', '');
854					updateParams();
855				}
856			}
857
858			function updateParams() {
859				windowWidth    = $(window).width();
860				sidebarWidth   = $sidebar.width();
861				sidebarHeight  = $sidebar.height();
862				contentPadding = parseInt( $content.css('padding-top') );
863				sidebarTop     = $sidebar.offset().top;
864
865				if( $('.eut-navigation-bar').length ) {
866					bottomOffset = $('.eut-navigation-bar').outerHeight() + 60;
867				}
868
869				$(window).off('scroll', checkSidebar);
870
871				if( windowWidth + scrollBarWidth > tabletPortrait ) {
872					checkSidebar();
873					$(window).on('scroll', checkSidebar);
874				}
875
876				$sidebar.css({
877					'visibility' : 'visible'
878				});
879
880				resizing = false;
881			}
882
883			function updateSidebarPosition() {
884				var contentHeight = $content.height(),
885					scrollTop     = $(window).scrollTop();
886
887				if( scrollTop < sidebarTop - topOffset + contentPadding ) {
888					$sidebarWrapper.removeClass('fixed').attr('style', '');
889				} else if( scrollTop >= sidebarTop - topOffset + contentPadding && scrollTop < sidebarTop + contentHeight - sidebarHeight - topOffset + contentPadding - bottomOffset ) {
890					$sidebarWrapper.addClass('fixed').css({ 'top' : topOffset, 'position' : 'fixed', 'width' : sidebarWidth });
891				} else {
892					if( $sidebarWrapper.hasClass('fixed') ) {
893						$sidebarWrapper.removeClass('fixed').css({ 'top' : contentHeight - sidebarHeight - bottomOffset + 'px', 'position' : 'relative' });
894					}
895				}
896				sidebarAnimation =  false;
897			}
898
899		}
900	};
901
902	// # Set Feature Section Size
903	// ============================================================================= //
904	EUTHEM.featureSize = {
905		init: function( section ){
906			if( !$(section).length ) return;
907			var $section = $(section);
908			if( $section.hasClass('eut-fullscreen') ) {
909				this.fullscreenSize( $section );
910			} else if( $section.hasClass('eut-custom-size') ) {
911				this.customSize( $section );
912			}
913		},
914		getTopBarHeight : function( topBar ){
915			var height = 0,
916				$topBar = $(topBar);
917			if( $topBar.length ) {
918				height = $topBar.outerHeight();
919			}
920			return height;
921		},
922		getHeaderHeight : function( header, responsiveHeader ){
923			var height = 0,
924				$header = $(header),
925				$resHeader = $(responsiveHeader);
926			if( $header.length && $header.is(':visible') && !$header.hasClass('eut-overlapping') && !$header.hasClass('eut-header-below') ) {
927				height = $header.outerHeight();
928			}
929			if( $resHeader.length && $resHeader.is(':visible') && !$header.hasClass('eut-responsive-overlapping') && !$header.hasClass('eut-header-below') ) {
930				height = $resHeader.outerHeight();
931			}
932			return height;
933		},
934		fullscreenSize : function( $section ){
935			var windowH   = $(window).height(),
936				headerH   = this.getHeaderHeight( '#eut-header', '#eut-responsive-header' ),
937				topBarH   = this.getTopBarHeight( '#eut-top-bar' ),
938				frameSize = $('body').hasClass('eut-framed') ? $('#eut-frames').find('.eut-frame.eut-top').height() : 0,
939				sectionH  = windowH - headerH - topBarH - (frameSize * 2);
940			$section.css( 'height', sectionH).find('.eut-wrapper').css( 'height', sectionH);
941		},
942		customSize : function( $section ){
943			var windowH    = $(window).height(),
944				initHeight = $section.data('height'),
945				newHeight  = ((windowH * initHeight) / 100);
946			if( newHeight > this.windowH ) {
947				newHeight = this.windowH;
948			}
949			$section.css( 'height', newHeight).find('.eut-wrapper').css( 'height', newHeight);
950		}
951	};
952
953	// # Feature Section
954	// ============================================================================= //
955	EUTHEM.featureSection = {
956		init : function(section){
957			if( !section.length ) return;
958			var $section = $(section),
959				$bgImage = $section.find('.eut-bg-image'),
960				$bgVideo = $section.find('.eut-bg-video'),
961				$spinner = $(spinner),
962				animateContent = false;
963
964			// Set Size
965			EUTHEM.featureSize.init( section );
966
967			if( $bgImage.length ) {
968				// Load Background Images
969				loadFeatureImage();
970			} else if( !$bgImage.length && $bgVideo.length ) {
971				showFeature();
972			} else {
973				// Play Animation Content
974				featureAnimation( $section );
975			}
976
977			// Load Background Images
978			function loadFeatureImage(){
979				var totalBgImage = $bgImage.length,
980					waitImgDone = function() {
981						totalBgImage--;
982						if (!totalBgImage) {
983							showFeature();
984						}
985					};
986				$bgImage.each(function () {
987					function imageUrl(input) {
988						return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
989					}
990					var image = new Image(),
991						$that = $(this);
992					image.src = imageUrl($that.css('background-image'));
993					$(image).on('load',waitImgDone).on( "error", waitImgDone );
994				});
995			}
996
997			// Add Spinner
998			function addSpinner(){
999				$spinner.appendTo( $section );
1000				$section.addClass('eut-with-spinner');
1001			}
1002
1003			// Remove Spinner
1004			function removeSpinner(){
1005				$spinner.fadeOut(900,function(){
1006					$spinner.remove();
1007					// Show Feature Section
1008					showFeature();
1009				});
1010			}
1011
1012			// Show Feature Section
1013			function showFeature(){
1014				var $overlay   = $section.find('.eut-bg-overlay'),
1015					$content   = $section.find('.eut-content'),
1016					$bgImage   = $section.find('.eut-bg-image'),
1017					$bgVideo   = $section.find('.eut-bg-video');
1018
1019				$bgImage.addClass('show');
1020				$bgVideo.addClass('show');
1021				$overlay.addClass('show');
1022
1023				animateContent = true;
1024				if( $section.hasClass('eut-with-slider') ) {
1025					// Init Feature Slider
1026					featureSlider();
1027				} else {
1028					// Play Feature Animation
1029					featureAnimation( $section );
1030				}
1031			}
1032
1033			// Feature Slider
1034			function featureSlider(){
1035				var $slider         = $('#eut-feature-slider'),
1036					pauseHover      = $slider.attr('data-slider-pause') == 'yes' ? true : '',
1037					sliderSpeed     = parseInt( $slider.attr('data-slider-speed') ) ? parseInt( $slider.attr('data-slider-speed') ) : 6000,
1038					transition      = $slider.attr('data-slider-transition'),
1039					slidersLength   = $slider.find('.eut-slider-item').length,
1040					pagination      = $slider.attr('data-pagination') != 'no' ? true : false,
1041					$nextNav        = $slider.parent().find('.eut-carousel-next'),
1042					$prevNav        = $slider.parent().find('.eut-carousel-prev'),
1043					loop            = true,
1044					animateOut      = false,
1045					animateIn       = false,
1046					stopSlider      = false;
1047
1048				// Slider Trantition
1049				if( transition != 'slide' ){
1050					animateOut = 'carousel-' + transition + '-out';
1051					animateIn = 'carousel-' + transition + '-in';
1052				}
1053
1054				EUTHEM.featureSection.addPaginationNumbers();
1055
1056
1057				$slider.on('initialized.owl.carousel changed.owl.carousel',function(event){
1058					var current = event.item.index !== null ? event.item.index : 0,
1059						$currentSlide = $(event.target).find('.eut-slider-item').eq(current),
1060						sliderColor = $currentSlide.attr('data-header-color'),
1061						color = 'eut-' + sliderColor;
1062
1063					if( !$currentSlide.length) return;
1064
1065					// Slider Animation
1066					featureAnimation( $currentSlide );
1067
1068					EUTHEM.featureSection.getActiveNumber( current );
1069
1070					// Set Header Color
1071					if( !$('#eut-main-header').hasClass('eut-header-side') ) {
1072						$('#eut-main-header').removeClass('eut-light eut-dark').addClass(color);
1073					}
1074
1075					// Set Navigation Color
1076					$('#eut-feature-slider').removeClass('eut-light eut-dark eut-default').addClass(color);
1077					$('#eut-feature-section .eut-carousel-navigation').removeClass('eut-light eut-dark eut-default').addClass(color);
1078					$('#eut-feature-section .eut-carousel-pagination').removeClass('eut-light eut-dark eut-default').addClass(color);
1079
1080					$('#eut-feature-section .eut-slider-numbers').removeClass('eut-light eut-dark eut-default').addClass(color);
1081				});
1082
1083				if ( $slider.find('.eut-slider-item').length == 1 ) {
1084					loop = false;
1085				}
1086
1087				$slider.owlCarousel({
1088					items : 1,
1089					loop : loop,
1090					autoplay : true,
1091					autoplayTimeout : sliderSpeed,
1092					autoplayHoverPause : pauseHover,
1093					smartSpeed : 500,
1094					dots : pagination,
1095					dotsClass : 'eut-carousel-pagination',
1096					animateOut : animateOut,
1097					animateIn : animateIn,
1098					responsiveClass : false,
1099					itemClass : 'eut-slider-item-wrapper'
1100				});
1101
1102				$(window).on('scroll',autoplayHandler);
1103
1104				function autoplayHandler(){
1105					var scroll = $(window).scrollTop();
1106					if( scroll > 300 && !stopSlider ){
1107						stopSlider = true;
1108						$slider.trigger('stop.owl.autoplay');
1109					} else if( scroll < 300 && stopSlider ) {
1110						stopSlider = false;
1111						$slider.trigger('play.owl.autoplay');
1112					}
1113				}
1114
1115				// Go to the next item
1116				$nextNav.on( 'click', function() {
1117					$slider.trigger('next.owl.carousel');
1118				});
1119				// Go to the previous item
1120				$prevNav.on( 'click', function() {
1121					$slider.trigger('prev.owl.carousel');
1122				});
1123			}
1124
1125			// Feature Animation
1126			function featureAnimation(section){
1127				var $section = section,
1128					$wrapper = $section.find('.eut-title-content-wrapper'),
1129					effect = $section.find('.eut-content').data('animation'),
1130					effectClass = 'eut-animate-' + effect,
1131					delay = 200,
1132					cnt = 0,
1133					contentItems = {
1134						graphic     : $section.find(' .eut-graphic '),
1135						subheading  : $section.find(' .eut-subheading '),
1136						title       : $section.find(' .eut-title '),
1137						description : $section.find(' .eut-description '),
1138						titleMeta   : $section.find(' .eut-title-meta-content '),
1139						button1     : $section.find(' .eut-btn-1 '),
1140						button2     : $section.find(' .eut-btn-2 '),
1141						gotoArrow   : $section.find(' .eut-goto-section-wrapper ')
1142					};
1143
1144				// Show Content
1145				$section.find('.eut-content').addClass('show');
1146
1147				if( !$wrapper.hasClass('eut-bg-none') ){
1148					contentItems = $wrapper;
1149				}
1150
1151				// Add Animation Class
1152				$.each( contentItems, function( key, item ) {
1153					$(item).removeClass('eut-animate-fade-in eut-animate-fade-in-up eut-animate-fade-in-down eut-animate-fade-in-left eut-animate-fade-in-right eut-animate-zoom-in eut-animate-zoom-out');
1154
1155					if( $(item).length ){
1156						cnt++;
1157						if( effect != 'none' ){
1158							setTimeout(function(){
1159								$(item).addClass( effectClass );
1160							},cnt * delay);
1161						}
1162					}
1163				});
1164			}
1165		},
1166		addPaginationNumbers: function(){
1167			var $slider = $('#eut-feature-slider'),
1168				$sliderItems = $slider.find('.eut-slider-item'),
1169				$list = $slider.parent().find('.eut-slider-numbers'),
1170				sliderSpeed = parseInt( $slider.attr('data-slider-speed') ) ? parseInt( $slider.attr('data-slider-speed') ) : 6000;
1171
1172			if( $list.length > 0 ) {
1173				$list.appendTo( $slider.parent() );
1174				$sliderItems.each(function(num,item){
1175					var number = (num + 1) < 10 ? '0' + (num + 1) : num + 1,
1176						$listIem = $('<li class="eut-link-text">' + number +'</li>');
1177					$listIem.appendTo( $list );
1178				});
1179
1180				$list.find('li').on('click',function(){
1181					var $that = $(this),
1182						goTo = $that.index(),
1183						timer;
1184					$slider.trigger('to.owl.carousel', [goTo, 300]);
1185					$slider.trigger('stop.owl.autoplay');
1186					$that.addClass('active').siblings().removeClass('active');
1187					clearTimeout(timer);
1188					timer = setTimeout(function(){
1189						$slider.trigger('play.owl.autoplay');
1190					},sliderSpeed);
1191				});
1192			}
1193		},
1194		getActiveNumber: function( currentSlider ){
1195			var $slider = $('#eut-feature-slider'),
1196				$list = $slider.parent().find('.eut-slider-numbers'),
1197				$listIem = $list.find('li');
1198			if( $list.length > 0 ) {
1199				var currentNumber = currentSlider - 2 <= 0 ? 0 : currentSlider - 2;
1200				$listIem.eq(currentNumber).addClass('active').siblings().removeClass('active');
1201			}
1202		}
1203	};
1204
1205	// # Feature Parallax
1206	// ============================================================================= //
1207	var featureParallaxScroll = false;
1208	EUTHEM.featureParallax = {
1209		init: function(){
1210			var section = $('#eut-feature-section'),
1211				scroll = false,
1212				smallDelay;
1213
1214			if( !section.hasClass('eut-bg-parallax') && !section.hasClass('eut-bg-advanced-parallax') && !section.hasClass('eut-bg-fixed-section') ) {
1215				return;
1216			}
1217
1218			// Create Parallax Wrapper
1219			section.children().wrapAll('<div class="eut-feature-inner"><div class="eut-parallax-wrapper"></div></div>');
1220
1221			updateParallax();
1222
1223			// Add window events
1224			$(window).on('resize', function(){
1225				window.clearTimeout(smallDelay);
1226				smallDelay = window.setTimeout(function () {
1227					updateParallax();
1228				}, 100);
1229			});
1230			$(window).on('scroll', onWindowScroll);
1231
1232			function onWindowScroll(){
1233				if( window.requestAnimationFrame ) {
1234					if(!scroll){
1235						window.requestAnimationFrame( updateParallax );
1236						scroll = true;
1237					}
1238				} else {
1239					updateParallax();
1240				}
1241			}
1242
1243			function updateParallax(){
1244				var wrapper = section.find('.eut-parallax-wrapper');
1245				var parallaxType;
1246				if( section.hasClass('eut-bg-advanced-parallax') ){
1247					parallaxType = 'advanced';
1248				} else if( section.hasClass('eut-bg-fixed-section') ){
1249					parallaxType = 'fixed';
1250				} else {
1251					parallaxType = 'classic';
1252				}
1253
1254				if( inViewport( section ) ){
1255					// References
1256					var scrollTop = $( window ).scrollTop();
1257					var sectionTop = section.offset().top;
1258					var sectionW = section.outerWidth();
1259					var sectionH = section.outerHeight();
1260					var topBarHeight = $('#eut-top-bar').length ? $('#eut-top-bar').height() : 0;
1261					var position = scrollTop * 0.2;
1262					var elementH = sectionH + sectionTop;
1263					var opacity = ( ( ( sectionH + sectionTop ) - scrollTop ) / sectionH ).toFixed(2);
1264					var scale = ( ( ( sectionH + sectionTop ) + scrollTop ) / sectionH );
1265					var content = section.find('.eut-wrapper, .eut-background-wrapper');
1266					var bgImage = section.find('.eut-bg-image');
1267					if( tSupport ){
1268
1269						if( parallaxType == 'advanced' ) {
1270							wrapper.css({
1271								'position' : 'fixed',
1272								'top' : sectionTop,
1273								'height' : elementH,
1274								'width' : sectionW,
1275								transform: 'translate3d( 0px' + ', ' + - (position + topBarHeight) + 'px' + ', 0px) translateZ(0)',
1276								visibility: 'visible'
1277							});
1278						} else if( parallaxType == 'fixed' ) {
1279							wrapper.css({
1280								'position' : 'fixed',
1281								'top' : sectionTop,
1282								'height' : elementH,
1283								'width' : sectionW,
1284								visibility: 'visible'
1285							});
1286						} else {
1287							wrapper.css({
1288								'position' : 'relative',
1289								'height' : elementH,
1290								'width' : sectionW,
1291								transform: 'translate3d( 0px' + ', ' + (position - topBarHeight) + 'px' + ', 0px) translateZ(0)',
1292								visibility: 'visible'
1293							});
1294						}
1295
1296						bgImage.css({visibility: 'visible'});
1297					}
1298				} else {
1299					wrapper.css({
1300						'position' : 'relative'
1301					});
1302				}
1303				scroll = false;
1304			}
1305
1306			function inViewport( element ){
1307				var winTop = $( window ).scrollTop();
1308				var winBottom = winTop + $( window ).height();
1309				var elTop = element.offset().top;
1310				var elBottom = elTop + element.outerHeight();
1311				return ( winBottom >= elTop && winTop <= elBottom );
1312			}
1313
1314		}
1315	};
1316
1317	// # Woocommerce Carousel Thumb Gallery
1318	// ============================================================================= //
1319	EUTHEM.wooThumbCarousel = {
1320		init : function(){
1321			var $thumbs = $('#eut-product-feature-image').find('.thumbnails'),
1322				$thumbsWrapper = $thumbs.find('.eut-thumbnails-wrapper'),
1323				$thumbsInner = $thumbs.find('.eut-thumbnails-inner'),
1324				$items = $thumbs.find('.eut-thumb-item'),
1325				$arrowPrev = $('<i class="eut-icon-nav-up-small eut-arrow-prev"></i>'),
1326				$arrowNext = $('<i class="eut-icon-nav-down-small eut-arrow-next"></i>'),
1327				wrapper = false,
1328				smallDelay,
1329				wrapperH,
1330				slidesLength,
1331				cnt;
1332
1333
1334			if( !$thumbs.length || $items.length <= 4 ) {
1335				$thumbsWrapper.css({
1336					'visibility' : 'visible'
1337				});
1338				return false;
1339			}
1340
1341			setSlider();
1342			$(window).on('resize', function(){
1343				window.clearTimeout(smallDelay);
1344				smallDelay = window.setTimeout(function () {
1345					setSlider();
1346				}, 300);
1347			});
1348
1349			function addWrapper(){
1350				if( !wrapper ) {
1351					for (var i = 0, len = $items.length; i < len; i += 4) {
1352						$items.slice(i, i + 4).wrapAll('<div class="eut-thumb-wrapper"/>');
1353					}
1354
1355					wrapperH = $('.eut-thumb-wrapper').first().outerHeight();
1356					slidesLength = $('.eut-thumb-wrapper').length - 1;
1357
1358					$thumbsWrapper.css({
1359						'height' : wrapperH,
1360						'overflow' : 'hidden',
1361						'visibility' : 'visible'
1362					});
1363
1364					addArrows();
1365					$thumbsInner.addClass('eut-with-transition');
1366
1367					wrapper = true;
1368				}
1369			}
1370
1371			function addArrows(){
1372				$arrowPrev.appendTo( $thumbs );
1373				$arrowNext.appendTo( $thumbs );
1374				// Add Classes
1375				$arrowPrev.addClass('eut-disable-arrow');
1376				$arrowNext.removeClass('eut-disable-arrow');
1377
1378				cnt = 0;
1379				bindEvents();
1380			}
1381
1382			function moveSlide(n){
1383				$thumbsInner.css( doTranslate( n * wrapperH ) );
1384			}
1385
1386			function setSlider(){
1387				if( $(window).width() + scrollBarWidth < tabletPortrait && wrapper) {
1388					resetSlider();
1389				} else if( $(window).width() + scrollBarWidth > tabletPortrait && !wrapper) {
1390					addWrapper();
1391				}
1392			}
1393
1394			function resetSlider(){
1395				$thumbsInner.removeClass('eut-with-transition');
1396				$thumbsInner.css( doTranslate( 0 ) );
1397				$items.unwrap();
1398				$thumbsWrapper.css({
1399					'height' : '',
1400					'overflow' : 'visible',
1401					'visibility' : 'visible'
1402				});
1403
1404				$arrowPrev.remove();
1405				$arrowNext.remove();
1406
1407				wrapper = false;
1408			}
1409
1410			function bindEvents(){
1411				$arrowNext.on('click.thumb-arrows',function(){
1412					var $that = $(this);
1413					if( cnt > - slidesLength ){
1414						cnt--;
1415						moveSlide( cnt );
1416						$arrowPrev.removeClass('eut-disable-arrow');
1417					}
1418					if(cnt == -slidesLength ){
1419						$that.addClass('eut-disable-arrow');
1420					}
1421				});
1422
1423				$arrowPrev.on('click.thumb-arrows',function(){
1424					var $that = $(this);
1425					if( cnt < 0 ){
1426						cnt++;
1427						moveSlide( cnt );
1428						$arrowNext.removeClass('eut-disable-arrow');
1429					}
1430					if(cnt === 0 ){
1431						$that.addClass('eut-disable-arrow');
1432					}
1433				});
1434			}
1435
1436			function doTranslate( value ){
1437				return {
1438					'-webkit-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
1439					'-moz-transform'    : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
1440					'-ms-transform'     : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
1441					'-o-transform'      : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)',
1442					'transform'         : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)'
1443				};
1444			}
1445		}
1446	};
1447
1448	// # Woocommerce Product Rating
1449	// ============================================================================= //
1450	EUTHEM.wooProductRating = {
1451		init : function(){
1452			if ( typeof wc_single_product_params !== 'undefined' ) {
1453				var $rating = $( '.woocommerce-Reviews #respond' ).find( '#rating' );
1454				if ( $rating.length > 0 && wc_single_product_params.review_rating_required === 'no' ) {
1455					$('.woocommerce-Reviews #respond #rating').removeAttr('required');
1456				}
1457			}
1458		}
1459	};
1460
1461	// # Page Settings
1462	// ============================================================================= //
1463	EUTHEM.pageSettings = {
1464
1465		init: function(){
1466			this.opacityScroll();
1467			this.changeOrder();
1468			this.mainMenu();
1469			this.setClippingWrappers();
1470			this.setAppearWrappers();
1471			this.stickyHeader();
1472			this.responsiveStickyHeader();
1473			this.eutModal();
1474			this.gotoFirstSection();
1475			this.bgLoader();
1476			this.fitVid();
1477			this.hiddenArea();
1478			this.sideArea();
1479			this.backtoTop();
1480			this.animatedBg();
1481			this.onePageSettings();
1482			this.socialShareLinks();
1483			this.productImageParallax();
1484			this.lightBox();
1485			this.showList();
1486			this.fixedFooter();
1487		},
1488		opacityScroll: function(){
1489			var $bgImage = $('.eut-bg-scroll-effect');
1490			$bgImage.each(function(){
1491				var $that = $(this),
1492					offset = $that.data('opacity-offset') / 100,
1493					initialOpacity = $that.data('initial-opacity') / 100,
1494					finalOpacity = $that.data('final-opacity') / 100,
1495					invert = $that.data('initial-opacity') > $that.data('final-opacity') ? false : true;
1496
1497				$(window).on('scroll', function () {
1498					var scrollTop = invert ? ($(window).scrollTop() + $(window).height()) - $that.offset().top : $(window).scrollTop() - $that.offset().top,
1499						scroll = scrollTop / ( $that.outerHeight() * offset ),
1500						opacity = initialOpacity + ( scroll * ( finalOpacity - initialOpacity ) );
1501					opacity = opacity.toFixed(2);
1502					if ( invert ) {
1503						if( opacity >= finalOpacity ) { opacity = finalOpacity; }
1504						if( opacity <= initialOpacity ) { opacity = initialOpacity ;}
1505					} else {
1506						if( opacity <= finalOpacity ) { opacity = finalOpacity; }
1507						if( opacity >= initialOpacity ) { opacity = initialOpacity; }
1508					}
1509					$that.css({ 'opacity': opacity });
1510				});
1511			});
1512		},
1513		setClippingWrappers: function(){
1514			var $element = $('.eut-clipping-animation'),
1515				wrapper = '<div class="eut-clipping-wrapper"><div class="eut-clipping-content"></div></div>';
1516			if( isMobile.any() && !deviceAnimAppear ) {
1517				$element.removeClass('eut-clipping-animation');
1518			} else {
1519				$element.wrapInner( wrapper );
1520				$element.each(function(){
1521					var $that = $(this),
1522						$wrapper = $that.find('.eut-clipping-wrapper');
1523					if( $that.hasClass('eut-colored-clipping') ) {
1524						var color = $that.data('clipping-color'),
1525							overlay = '<div class="eut-clipping-overlay eut-bg-' + color + '"></div>';
1526						$(overlay).appendTo( $wrapper );
1527					}
1528				});
1529				this.clippingAppear();
1530			}
1531		},
1532		setAppearWrappers: function(){
1533			var $element = $('.eut-appear-animation'),
1534				wrapper = '<div class="eut-appear-wrapper eut-animation-wrapper"><div class="eut-appear-content"></div></div>';
1535			if( isMobile.any() && !deviceAnimAppear ) {
1536				$element.removeClass('eut-appear-animation');
1537			} else {
1538				$element.wrapInner( wrapper );
1539				this.animAppear();
1540			}
1541		},
1542		animAppear: function(){
1543			var $animationItem = $('.eut-appear-animation');
1544
1545			if( bodyLoader || $('body').hasClass('page-template-template-full-page') || $('body').hasClass('page-template-template-pilling-page') ){
1546				return;
1547			}
1548			if( isMobile.any() && !deviceAnimAppear ) {
1549				$animationItem.removeClass('eut-appear-animation');
1550			} else {
1551				$animationItem.each(function() {
1552					var $that = $(this),
1553						timeDelay = $that.attr('data-delay');
1554
1555					$that.appear(function() {
1556						setTimeout(function () {
1557							$that.addClass('eut-appear-animated');
1558						}, timeDelay);
1559					},{accX: 0, accY: -150});
1560				});
1561			}
1562		},
1563		clippingAppear: function(){
1564			var $clippingEl = $('.eut-clipping-animation');
1565			if( bodyLoader || $('body').hasClass('page-template-template-full-page') || $('body').hasClass('page-template-template-pilling-page') ){
1566				return;
1567			}
1568			if( isMobile.any() && !deviceAnimAppear ) {
1569				$clippingEl.removeClass('eut-clipping-animation');
1570			} else {
1571				$clippingEl.each(function() {
1572					var $that = $(this),
1573						timeDelay = $that.attr('data-delay');
1574
1575					$that.appear(function() {
1576						setTimeout(function () {
1577							EUTHEM.pageSettings.clippingAnimated( $that );
1578						}, timeDelay);
1579					},{accX: 0, accY: -150});
1580				});
1581			}
1582		},
1583		clippingAnimated: function( $element ){
1584			var delay = 700,
1585				$overlay = $element.find( '.eut-clipping-overlay' );
1586
1587			$element.addClass('eut-clipping-animated');
1588
1589			if ( $element.hasClass('eut-colored-clipping') ) {
1590				setTimeout(function(){
1591					$element.addClass('eut-clipping-show-content');
1592				},delay);
1593
1594				delay = 1400;
1595			}
1596			setTimeout(function(){
1597				$overlay.remove();
1598				$element.removeClass('eut-clipping-animation eut-clipping-animated eut-colored-clipping eut-clipping-show-content');
1599				EUTHEM.basicElements.animAppear();
1600			},delay);
1601		},
1602		bodyLoader: function(){
1603			var $overflow = $('#eut-loader-overflow'),
1604				$loader   = $('.eut-spinner'),
1605				$link = $('a');
1606
1607			if( $overflow.length > 0 ){
1608				bodyLoader = true;
1609			} else {
1610				return;
1611			}
1612
1613			if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
1614				window.onpageshow = function(event) {
1615					if (event.persisted) {
1616						$overflow.removeClass('eut-visible eut-hide');
1617						window.location.reload();
1618					}
1619				};
1620			} else if(navigator.userAgent.indexOf('Firefox') != -1) {
1621				window.onunload = function(){};
1622			}
1623
1624			if( $overflow.hasClass('eut-page-transition') ) {
1625				var exclude = ['.eut-no-transition', '.eut-toggle-modal'],
1626					comp = new RegExp(location.host);
1627
1628				$('a:not(' + exclude + ')').on('click',function(e){
1629					var link = this;
1630					if( comp.test(link.href) && link.href.split(/\?|#/)[0] != location.href.split(/\?|#/)[0] && link.target != '_blank' && link.href[0] != '#') {
1631						if( link.href.indexOf( '#' ) == -1 &&
1632							link.href.indexOf( 'skype:' ) == -1 &&
1633							link.href.indexOf( 'mailto:' ) == -1 &&
1634							link.href.indexOf( 'tel:' ) == -1 &&
1635							link.href.indexOf( 'jpg' ) == -1 &&
1636							link.href.indexOf( 'jpeg' ) == -1 &&
1637							link.href.indexOf( 'png' ) == -1 &&
1638							link.href.indexOf( 'gif' ) == -1 &&
1639							link.href.indexOf( 'bmp' ) == -1 &&
1640							link.href.indexOf( 'pdf' ) == -1 &&
1641							link.href.indexOf( 'zip' ) == -1 &&
1642							link.href.indexOf('add-to-cart=') == -1 ) {
1643							e.preventDefault();
1644							var newLocation = this.href;
1645							$overflow.addClass('eut-visible').removeClass('eut-hide');
1646							setTimeout(function(){
1647								window.location = newLocation;
1648							}, 600);
1649						}
1650					}
1651				});
1652			}
1653
1654			var images = $('img, .eut-bg-image');
1655			$.each(images, function(){
1656				var el = $(this),
1657				image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
1658				if(image && image !== '' && image !== 'none')
1659					images = images.add($('<img>').attr('src', image));
1660				if(el.is('img'))
1661					images = images.add(el);
1662			});
1663
1664			images.imagesLoaded(function(){
1665				setTimeout(function () {
1666					if( $overflow.hasClass('eut-page-transition') ) {
1667						$overflow.removeClass('eut-visible').addClass('eut-hide');
1668						setTimeout(function(){
1669							bodyLoader = false;
1670							EUTHEM.basicElements.animAppear();
1671							EUTHEM.pageSettings.clippingAppear();
1672							EUTHEM.pageSettings.animAppear();
1673							EUTHEM.svgAnimation.init();
1674							EUTHEM.basicElements.counter();
1675						}, 1200);
1676					} else {
1677						$loader.fadeOut(500);
1678						$overflow.delay(500).fadeOut(700,function(){
1679							bodyLoader = false;
1680							EUTHEM.basicElements.animAppear();
1681							EUTHEM.pageSettings.clippingAppear();
1682							EUTHEM.pageSettings.animAppear();
1683							EUTHEM.svgAnimation.init();
1684							EUTHEM.basicElements.counter();
1685						});
1686					}
1687				}, 600);
1688			});
1689
1690		},
1691		changeOrder: function(){
1692			var $element = $('.eut-change-order'),
1693				$parent = $element.parent();
1694			$parent.each(function(){
1695				var $that = $(this),
1696					$column = $that.children(),
1697					colLength = $column.length,
1698					tabletArr = $.makeArray( $column.not('.eut-change-order') ),
1699					tabletSmArr = $.makeArray( $column.not('.eut-change-order') ),
1700					mobileArr = $.makeArray( $column.not('.eut-change-order') );
1701
1702				$column.each(function(num,value){
1703					var $that = $(value);
1704					if( $that.hasClass('eut-change-order') ){
1705						var tabletOrder = $that.data('tablet-order') !== undefined && $that.data('tablet-order') <= colLength ? $that.data('tablet-order') - 1 : $that.index(),
1706							tabletSmOrder = $that.data('tablet-sm-order') !== undefined && $that.data('tablet-sm-order') <= colLength ? $that.data('tablet-sm-order') - 1 : $that.index(),
1707							mobileOrder = $that.data('mobile-order') !== undefined && $that.data('mobile-order') <= colLength ? $that.data('mobile-order') - 1 : $that.index();
1708						tabletArr.splice( tabletOrder, 0, value);
1709						tabletSmArr.splice( tabletSmOrder, 0, value);
1710						mobileArr.splice( mobileOrder, 0, value);
1711					}
1712				});
1713
1714				$.each( tabletArr, function(i,n){
1715					$( this ).addClass('eut-tablet-order-' + (i + 1));
1716				});
1717
1718				$.each( tabletSmArr, function(i,n){
1719					$( this ).addClass('eut-tablet-sm-order-' + (i + 1));
1720				});
1721
1722				$.each( mobileArr, function(i,n){
1723					$( this ).addClass('eut-mobile-order-' + (i + 1));
1724				});
1725			});
1726
1727		},
1728		stickyHeader : function(){
1729			var $header = $('#eut-header'),
1730				$innerHeader = $('#eut-main-header'),
1731				stickyType = $header.data('sticky');
1732
1733			if( stickyType === 'none' || !$header.length ) return;
1734
1735			var headerHeight = $header.height(),
1736				headerTop = $innerHeader.hasClass('eut-header-logo-top') ? $('#eut-bottom-header').offset().top : $header.offset().top,
1737				threshold = headerTop,
1738				stickyHeader = '#eut-main-header',
1739				thresholdBackground = $header.hasClass('eut-overlapping') || stickyType == 'scrollup' ? 0 : headerHeight,
1740				thresholdHeadIn = 0,
1741				thresholdHeadOut = headerTop + 500,
1742				onScrollUp = null,
1743				onScrollDown = null,
1744				stickyTop = 0,
1745				tolerance = {
1746					up : 0,
1747					down : 0
1748				};
1749
1750			if( isMobile.any() ) {
1751				tolerance = { up : 20, down : 20 };
1752			}
1753
1754			if( stickyType == 'scrollup' ){
1755				threshold = $header.outerHeight() + headerTop;
1756				thresholdHeadIn = headerTop + headerHeight;
1757				onScrollUp = scrollUpCallback;
1758				onScrollDown = scrollDownCallback;
1759			}
1760
1761			if( $('body').hasClass('eut-framed') ){
1762				stickyTop = $('#eut-frames').data('frame-size');
1763			}
1764
1765			if( $innerHeader.hasClass('eut-header-logo-top') ) {
1766				stickyHeader = '#eut-bottom-header';
1767			}
1768
1769			$header.StickyHeader({
1770				stickyHeader : stickyHeader,
1771				thresholdSticky : threshold,
1772				thresholdBackground : thresholdBackground,
1773				thresholdHeadIn : thresholdHeadIn,
1774				thresholdHeadOut : thresholdHeadOut,
1775				stickyTop : stickyTop,
1776				tolerance : tolerance,
1777				onScrollUp : onScrollUp,
1778				onScrollDown : onScrollDown
1779			});
1780
1781			function scrollUpCallback(){
1782				if( $('#eut-page-anchor').length ) {
1783					var position = $header.data('sticky-height');
1784					$('#eut-page-anchor').addClass('eut-go-down').removeClass('eut-go-up');
1785					EUTHEM.anchorMenu.moveAnchor( '#eut-page-anchor', position );
1786				}
1787			}
1788
1789			function scrollDownCallback(){
1790				if( $('#eut-page-anchor').length ) {
1791					$('#eut-page-anchor').addClass('eut-go-up').removeClass('eut-go-down');
1792					EUTHEM.anchorMenu.moveAnchor( '#eut-page-anchor', 0 );
1793				}
1794			}
1795		},
1796		responsiveStickyHeader : function(){
1797			var $header = $('#eut-header'),
1798				$responsiveHeader = $('#eut-responsive-header'),
1799				$innerHeader = $('#eut-main-header'),
1800				sticky = $header.data('devices-sticky');
1801
1802			if( sticky === 'no' || !$responsiveHeader.length ) return;
1803
1804			var headerHeight = $header.height(),
1805				headerTop = $responsiveHeader.offset().top,
1806				threshold = headerTop,
1807				thresholdHeadIn = 0;
1808
1809			$responsiveHeader.StickyHeader({
1810				thresholdSticky : threshold,
1811				thresholdHeadIn : thresholdHeadIn
1812			});
1813		},
1814		stickyElements: function(){
1815			if( $window.width() + scrollBarWidth  > tabletPortrait ) {
1816				EUTHEM.pageSettings.initStickyElement();
1817			} else {
1818				$stickyEl.trigger("sticky_kit:detach");
1819			}
1820		},
1821
1822		initStickyElement: function(){
1823			$stickyEl.each(function(){
1824				var $that = $(this),
1825					paddingT = $that.css('padding-top'),
1826					paddingL = $that.css('padding-left'),
1827					paddingB = $that.css('padding-bottom'),
1828					paddingR = $that.css('padding-right'),
1829					elPadding = paddingT + ' ' + paddingR + ' ' + paddingB + ' ' + paddingL,
1830					offset = $that.data('sticky-offset') !== undefined ? $that.data('sticky-offset') : 0,
1831					headerHeight = $('#eut-header').data('sticky') != 'none' && $('#eut-header').data('sticky') != 'scrollup' ? $('#eut-header').data('sticky-height') : 0,
1832					anchorBarHeight  = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0,
1833					topOffset = offset + headerHeight + anchorBarHeight + wpBarHeight,
1834					$parent = $that.parents('.eut-row').length ? $that.parents('.eut-row') : $that.parent();
1835
1836				$that.stick_in_parent({
1837					parent: $parent,
1838					bottoming: true,
1839					inner_scrolling: false,
1840					offset_top: topOffset
1841				}).on("sticky_kit:stick", function(e) {
1842					$(this).css({
1843						'padding-top' : paddingT,
1844						'z-index' : 9999
1845					});
1846					this.style.setProperty('padding', elPadding, 'important');
1847				}).on("sticky_kit:unstick", function(e) {
1848					this.style.setProperty('padding', '');
1849				});
1850			});
1851		},
1852		addVideoBg: function(){
1853			$('.eut-yt-bg-video').each(function() {
1854				var $element = $(this);
1855				var url = $element.data("video-bg-url");
1856				var videoID = url.match( /[\\?&]v=([^&#]*)/ )[ 1 ];
1857				if( '' !== videoID ) {
1858					insertYouTubeVideo($element, videoID );
1859				}
1860			});
1861			$('.eut-html5-bg-video').each(function() {
1862				var $element = $(this);
1863				EUTHEM.pageSettings.resizeVideoBgElement( $element );
1864			});
1865			$('.eut-vimeo-bg-video').each(function() {
1866				var $element = $(this);
1867				if ("undefined" != typeof Vimeo ) {
1868					var videoPlayer = new Vimeo.Player( $element.attr('id') );
1869					videoPlayer.on('loaded', function() {
1870						EUTHEM.pageSettings.resizeVideoBgElement( $element );
1871					});
1872				}
1873			});
1874			function insertYouTubeVideo($element, youtubeId, counter) {
1875				if ("undefined" == typeof YT || "undefined" === typeof YT.Player) {
1876					counter = "undefined" === typeof counter ? 0 : counter;
1877					if (100 < counter) {
1878						console.warn("Too many attempts to load YouTube api");
1879						return;
1880					}
1881					setTimeout(function() {
1882						insertYouTubeVideo($element, youtubeId, counter++);
1883					}, 100);
1884					return;
1885				}
1886				var startSeconds = $element.data('video-start') !== undefined ? parseInt( $element.data('video-start') ) : 0;
1887				var endSeconds = $element.data('video-end') !== undefined ? parseInt( $element.data('video-end') ) : 0;
1888				var $container = $element.prepend('<div class="eut-bg-youtube-video"><div class="inner"></div></div>').find(".inner");
1889				var ytPlayer = new YT.Player($container[0], {
1890					width: "100%",
1891					height: "100%",
1892					videoId: youtubeId,
1893					playerVars: {
1894						playlist: youtubeId,
1895						iv_load_policy: 3,
1896						enablejsapi: 1,
1897						disablekb: 1,
1898						autoplay: 1,
1899						controls: 0,
1900						showinfo: 0,
1901						rel: 0,
1902						loop: 1,
1903						start: startSeconds,
1904						end: endSeconds,
1905						wmode: "transparent"
1906					},
1907					events: {
1908						'onReady': onPlayerReady,
1909						'onStateChange': onPlayerStateChange
1910					}
1911				});
1912				function onPlayerReady(event) {
1913					event.target.mute().setLoop(true);
1914				}
1915				function onPlayerStateChange(event) {
1916					if ( 0 !== startSeconds || 0 !== endSeconds ) {
1917						if (event.data === YT.PlayerState.ENDED) {
1918							ytPlayer.loadVideoById({
1919								videoId: youtubeId,
1920								startSeconds: startSeconds,
1921								endSeconds: endSeconds
1922							});
1923						}
1924					}
1925				}
1926				// Resize Video
1927				EUTHEM.pageSettings.resizeVideoBgElement( $element );
1928			}
1929		},
1930		resizeVideoBg: function(){
1931			$videoBg.each(function(){
1932				EUTHEM.pageSettings.resizeVideoBgElement( $(this) );
1933			});
1934		},
1935		resizeVideoBgElement: function( $element ){
1936			var videoEl,
1937				videoW,
1938				videoH,
1939				marginLeft,
1940				marginTop,
1941				containerW = $element.innerWidth(),
1942				containerH = $element.innerHeight(),
1943				ratio1 = 16,
1944				ratio2 = 9;
1945
1946			if (containerW / containerH < ratio1 / ratio2) {
1947				videoW = containerH * (ratio1 / ratio2);
1948				videoH = containerH;
1949				videoW += 'px';
1950				videoH += 'px';
1951			} else {
1952				videoW = containerW;
1953				videoH = containerW * (ratio2 / ratio1);
1954				videoW += 'px';
1955				videoH += 'px';
1956			}
1957			if( $element.hasClass('eut-yt-bg-video') || $element.hasClass('eut-vimeo-bg-video') || $element.hasClass('eut-iframe-bg-video') ) {
1958				videoEl = 'iframe';
1959			} else {
1960				videoEl = 'video';
1961			}
1962
1963			$element.find( videoEl ).css({
1964				maxWidth: '1000%',
1965				width: videoEl == 'iframe' ? videoW : '',
1966				height: videoH
1967			});
1968		},
1969		removeVideoBg: function(){
1970			$('.eut-background-wrapper').each(function () {
1971				var $wrapper = $(this),
1972					$bgImage = $wrapper.find('.eut-bg-image'),
1973					$bgVideo = $wrapper.find('.eut-bg-video'),
1974					$bgHtml5Video = $wrapper.find('.eut-html5-bg-video'),
1975					$bgYtVideo = $wrapper.find('.eut-yt-bg-video'),
1976					$bgVimeoVideo = $wrapper.find('.eut-vimeo-bg-video'),
1977					$bgIFrameVideo = $wrapper.find('.eut-iframe-bg-video'),
1978					$bgVideoButton = $wrapper.find('.eut-bg-video-button-device');
1979
1980				var bgVideoDevice = $bgVideo.data('videoDevice') !== undefined ? $bgVideo.data('videoDevice') : 'no';
1981				if( isMobile.any() && 'no' === bgVideoDevice) {
1982					$bgVideo.remove();
1983				} else {
1984
1985					if ( $bgHtml5Video.length ) {
1986						var $videoElement = $wrapper.find('.eut-bg-video video');
1987						var canPlayVideo = false;
1988						$wrapper.find('.eut-bg-video source').each(function(){
1989							if ( $videoElement.get(0).canPlayType( $(this).attr('type') ) ) {
1990								canPlayVideo = true;
1991							}
1992						});
1993						if(canPlayVideo) {
1994							$bgImage.remove();
1995						} else {
1996							$bgVideo.remove();
1997						}
1998					}
1999					if ( $bgYtVideo.length || $bgVimeoVideo.length || $bgIFrameVideo.length ) {
2000						$bgImage.remove();
2001					}
2002					if ( $bgVideoButton.length ) {
2003						$bgVideoButton.remove();
2004					}
2005				}
2006			});
2007		},
2008		linkGoToTop: function( element, delay, space ){
2009			var $this = element,
2010				elementTop       = $this.offset().top,
2011				header           = $('#eut-header').length && $('#eut-main-header').is(":visible") ? true : false,
2012				responsiveHeader = $('#eut-responsive-header').length && $('#eut-responsive-header').is(":visible") ? true : false,
2013				headerHeight     = header && $('#eut-header').data('sticky') != 'none' ? $('#eut-main-header').outerHeight() : 0,
2014				respHeaderH      = responsiveHeader && $('#eut-header').data('devices-sticky') == 'yes' ? $('#eut-responsive-header').outerHeight() : 0,
2015				topBarHeight     = $('#eut-top-bar').length ? $('#eut-top-bar').height() : 0,
2016				anchorBarHeight  = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0,
2017				delayAnim        = delay !== undefined ? delay : 300,
2018				topSpace         = space !== undefined ? space : 0,
2019				offset           = topBarHeight + wpBarHeight + headerHeight + respHeaderH + anchorBarHeight + topSpace;
2020			if( elementTop > 0 ){
2021				$('html, body').delay(delayAnim).animate({
2022					scrollTop: elementTop - offset
2023				}, 900, 'easeInOutCubic');
2024				$("html, body").on("scroll mousedown DOMMouseScroll mousewheel keyup", function(){
2025					$('html, body').stop();
2026				});
2027				return false;
2028			}
2029		},
2030		mainMenu: function(){
2031			var $mainMenu = $('#eut-header .eut-horizontal-menu ul.eut-menu');
2032
2033			$('.eut-main-menu').find( 'a[href="#"]').on('click',function(e){
2034				e.preventDefault();
2035			});
2036
2037			$mainMenu.superfish({
2038				popUpSelector: '.sub-menu',
2039				delay: 300,
2040				speed: 'fast',
2041				cssArrows: false,
2042				onBeforeShow: function(){
2043
2044					var $subMenu = $(this);
2045					if( !$subMenu.length ) return;
2046					var $li = $subMenu.parent(),
2047						windowW = $(window).width(),
2048						subMenuW = $subMenu.width(),
2049						liOffsetL = $li.offset().left;
2050
2051					if( $li.hasClass('megamenu')){
2052						setTimeout(function(){
2053							setEqualMenuColumns( $li );
2054						},50);
2055					}
2056
2057					if( $li.hasClass('megamenu') && $li.css('position') == 'relative' ){
2058						if(subMenuW + liOffsetL > windowW) {
2059							var left = windowW - (subMenuW + liOffsetL);
2060							$subMenu.css({'left' : left});
2061						}
2062					}
2063					if( $('#eut-header .eut-first-level').length > 0 ){
2064						if( !$li.hasClass('eut-first-level') && !$li.hasClass('megamenu') ){
2065							var subMenuLength = $li.find('.sub-menu').length + 1,
2066								subMenuOffsetL = $li.parents('.eut-first-level').offset().left;
2067							if( (subMenuW * subMenuLength) + subMenuOffsetL > windowW) {
2068								$li.addClass('eut-invert');
2069							}
2070						} else if( $li.hasClass('eut-first-level') && !$li.hasClass('megamenu') && $('#eut-header').hasClass('eut-fullwidth') ){
2071							var menuOffsetL = $li.offset().left;
2072							if( subMenuW + menuOffsetL > windowW) {
2073								$li.addClass('eut-invert');
2074							}
2075						}
2076					}
2077
2078					if( $('body').hasClass('eut-boxed') && ( $li.hasClass('megamenu column-3') || $li.hasClass('megamenu column-2') ) ){
2079						var containerW = $('#eut-theme-wrapper').width(),
2080							containerL = $('#eut-theme-wrapper').offset().left,
2081							positionL = 0;
2082
2083						if( subMenuW + liOffsetL > containerW + containerL ){
2084							positionL = (containerW + containerL) - (subMenuW + liOffsetL);
2085						}
2086
2087						$subMenu.css({
2088							'left' : positionL
2089						});
2090					}
2091				},
2092				onHide: function(){
2093					var $subMenu = $(this),
2094						$li = $subMenu.parent();
2095					$li.removeClass('eut-invert');
2096
2097					if( $li.hasClass('megamenu')){
2098						removeEqualMenuColumns( $li );
2099					}
2100				}
2101			});
2102
2103			function setEqualMenuColumns( $li ) {
2104				var $subMenu = $li.children('ul'),
2105					$column = $subMenu.children('li'),
2106					maxHeight = 0;
2107				$column.each(function(){
2108					var columnH = $(this).outerHeight();
2109					if( columnH >= maxHeight ) {
2110						maxHeight = columnH;
2111					}
2112				});
2113				$column.css({ 'height' : maxHeight });
2114			}
2115
2116			function removeEqualMenuColumns( $li ) {
2117				var $subMenu = $li.children('ul'),
2118					$column = $subMenu.children('li');
2119				$column.css({ 'height' : '' });
2120			}
2121
2122		},
2123		columnEffect: function(){
2124			var $parallaxColumn = $('.eut-parallax-effect'),
2125				$section = $parallaxColumn.parents('.eut-section');
2126
2127			$parallaxColumn.each(function(){
2128				var $that = $(this),
2129					parallaxEffect = $that.data('parallax-effect'),
2130					tabletL = $that.data('tablet-landscape-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false,
2131					tabletP = $that.data('tablet-portrait-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false,
2132					mobileL = $that.data('mobile-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false,
2133					$section = $that.parents('.eut-section');
2134
2135				imagesLoaded( $section, function() {
2136					$that.paraller({
2137						tabletL : [tabletLandscape, tabletL],
2138						tabletP : [tabletPortrait, tabletP],
2139						mobileL : [mobileScreen, mobileL]
2140					});
2141				});
2142			});
2143		},
2144		eutModal: function(){
2145
2146			var $button       = $('.eut-toggle-modal'),
2147				$overlay      = $('<div id="eut-modal-overlay" class="eut-body-overlay"></div>'),
2148				$closeBtn     = $('<div class="eut-close-modal"><i class="eut-icon-close"></i></div>'),
2149				$themeWrapper = $('#eut-theme-wrapper'),
2150				content;
2151
2152			$button.on('click',function(e){
2153				content = $(this).attr('href');
2154				if( content.indexOf("#") === 0 && $(content).length > 0 ) {
2155					e.preventDefault();
2156
2157					// Append Overlay on body
2158					$overlay.appendTo( $themeWrapper );
2159					$closeBtn.appendTo( $(content) );
2160
2161					$(content).addClass('prepare-anim');
2162
2163					openModal();
2164
2165					$closeBtn.on('click',function(e){
2166						e.preventDefault();
2167						closeModal();
2168					});
2169
2170					$(content).on('click',function(e){
2171						if ( !$('.eut-modal-item').is(e.target) && $('.eut-modal-item').has(e.target).length === 0 ) {
2172							e.preventDefault();
2173							closeModal();
2174						}
2175					});
2176				}
2177			});
2178
2179			// Open Modal
2180			function openModal() {
2181				$overlay.fadeIn(function(){
2182					$(content).addClass('animate');
2183
2184					// Search Modal
2185					if( $(content).is('#eut-search-modal') ){
2186						var $searchContent = $('#eut-search-modal'),
2187							$searchInput = $searchContent.find('.eut-search-textfield');
2188
2189						$searchInput.val('');
2190						setTimeout(function(){
2191							$searchInput.focus();
2192						},600);
2193					}
2194				});
2195			}
2196
2197			// Close Modal
2198			function closeModal() {
2199				$(content).removeClass('animate mobile');
2200				setTimeout(function(){
2201					$overlay.fadeOut(function(){
2202						$(content).removeClass('prepare-anim');
2203						$overlay.remove();
2204						$closeBtn.remove();
2205					});
2206				},600);
2207			}
2208
2209			$(document).on('keyup',function(evt) {
2210				if (evt.keyCode == 27 && $(content).hasClass('animate') ) {
2211					closeModal();
2212				}
2213			});
2214
2215		},
2216		gotoFirstSection: function(){
2217			var $selector    = $('#eut-feature-section .eut-goto-section'),
2218				$nextSection = $('#eut-content');
2219
2220			$selector.on('click',function(){
2221				$('html,body').animate({
2222					scrollTop: $nextSection.offset().top
2223				}, 1000);
2224				return false;
2225			});
2226		},
2227		bgLoader: function() {
2228
2229			var $selector = $('#eut-header .eut-bg-image, #eut-content .eut-bg-image, #eut-footer .eut-bg-image, .eut-navigation-bar .eut-bg-image, #eut-sidearea .eut-bg-image');
2230			$selector.each(function () {
2231				var $selector = $(this);
2232				if( $selector.data('loader') == 'yes' ){
2233					EUTHEM.pageSettings.addSpinner( $selector );
2234				}
2235				function imageUrl(input) {
2236					return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
2237				}
2238				var image = new Image(),
2239					$that = $(this);
2240				image.src = imageUrl($that.css('background-image'));
2241				image.onload = function () {
2242					if( $selector.data('loader') == 'yes' ){
2243						EUTHEM.pageSettings.removeSpinner( $selector );
2244					} else {
2245						$that.addClass('show');
2246					}
2247				};
2248			});
2249		},
2250		addSpinner: function( $selector ){
2251			var $section = $selector;
2252			$(spinner).appendTo( $section.parent() );
2253		},
2254		removeSpinner: function( $selector ){
2255
2256			var $section   = $selector.parent(),
2257				$spinner   = $section.find('.eut-spinner');
2258
2259			$spinner.fadeOut(600,function(){
2260				$selector.addClass('show');
2261				$spinner.remove();
2262			});
2263		},
2264		fitVid: function(){
2265			$('.eut-video, .eut-media').fitVids();
2266			$('iframe[src*="youtube"]').parent(":not(.eut-bg-youtube-video)").fitVids();
2267			$('iframe[src*="vimeo"]').parent().fitVids();
2268		},
2269		hiddenArea: function( section, btn ){
2270			var $btn          = $('.eut-toggle-hiddenarea'),
2271				$themeWrapper = $('#eut-theme-wrapper'),
2272				$closeBtn     = $('.eut-hidden-area').find('.eut-close-btn'),
2273				startTimer = false,
2274				count = -1,
2275				itemLength = 0,
2276				counter,
2277				areaWidth     = 0,
2278				content,
2279				$overlay;
2280
2281			$btn.on('click',function(e){
2282				content = $(this).attr('href');
2283				if( content.indexOf("#") === 0 && $(content).length > 0 ) {
2284					e.preventDefault();
2285					var overlayId = content.replace('#','');
2286
2287					$(content).addClass('prepare-anim');
2288					$overlay = $('<div id="' + overlayId + '-overlay" class="eut-body-overlay"></div>');
2289
2290					// Append Overlay on body
2291					$overlay.appendTo( $themeWrapper );
2292
2293					// Calculate Width
2294					areaWidth = hiddenAreaWidth( content );
2295					$(window).smartresize(function(){
2296						areaWidth = hiddenAreaWidth( content );
2297					});
2298
2299					if( $(content).hasClass('open') ) {
2300						closeHiddenArea();
2301					} else {
2302						openHiddenArea();
2303					}
2304
2305					// For One Page
2306					var $link = $(content).find('a[href*="#"]:not( [href="#"] )');
2307					$link.on('click',function(){
2308						var target = $(this.hash),
2309							targetHash = this.hash,
2310							dataValue = this.hash.replace('#','');
2311						if ( target.length && ( target.hasClass('eut-section') || target.hasClass('eut-bookmark') || target.hasClass('eut-tab-content') || target.hasClass('eut-accordion-content') ) ) {
2312							closeHiddenArea();
2313						}
2314						// For Fullpage Scrolling
2315						if( $('[data-anchor="' + dataValue + '"]').length ){
2316							closeHiddenArea();
2317						}
2318					});
2319
2320				}
2321			});
2322
2323			$closeBtn.on('click',function(){
2324				closeHiddenArea();
2325			});
2326
2327			// Open Hidden Area
2328			function openHiddenArea() {
2329				$overlay.fadeIn(function(){
2330					$('body').scrollTop( 0 );
2331					$(content).addClass('open');
2332					$(this).on('click',function(){
2333						closeHiddenArea();
2334					});
2335				});
2336			}
2337			// Close Hidden Area
2338			function closeHiddenArea() {
2339				$themeWrapper.css({ 'height' : 'auto' });
2340				$(content).removeClass('open');
2341				$overlay.fadeOut(function(){
2342					$overlay.remove();
2343					$(content).removeClass('prepare-anim');
2344				});
2345			}
2346
2347				// Calculate Area Width
2348			function hiddenAreaWidth( area ){
2349				var $area = $(area),
2350					windowWidth  = $(window).width();
2351
2352				if( $(window).width() + scrollBarWidth <= mobileScreen ) {
2353					$(area).css({ 'width' : windowWidth + 30 });
2354				} else {
2355					if( $area.hasClass('eut-large-width') ) {
2356						$(area).css({ 'width' : Math.max(550, (windowWidth / 2)) });
2357					} else if( $area.hasClass('eut-medium-width') ) {
2358						$(area).css({ 'width' : Math.max(550, (windowWidth / 3)) });
2359					} else {
2360						$(area).css({ 'width' : Math.max(550, (windowWidth / 4)) });
2361					}
2362				}
2363
2364				return areaWidth;
2365			}
2366
2367		},
2368		hiddenAreaHeight: function( area ){
2369			if( $(area).length === 0 ) return;
2370
2371			var windowWidth      = $(window).width(),
2372				windowHeight     = $(window).height(),
2373				hiddenAreaHeight = $(area).find('.eut-hiddenarea-content').outerHeight() + 200,
2374				$themeWrapper    = $('#eut-theme-wrapper'),
2375				$scroller        = $(area).find('.eut-scroller'),
2376				$buttonWrapper   = $(area).find('.eut-buttons-wrapper'),
2377				btnWrapperHeight = $buttonWrapper.length ? $buttonWrapper.height() : 0,
2378				sideHeight       = 0;
2379
2380			if( hiddenAreaHeight > windowHeight ){
2381				sideHeight = hiddenAreaHeight;
2382			} else {
2383				sideHeight = windowHeight;
2384			}
2385
2386			if( $(window).width() + scrollBarWidth <= mobileScreen ) {
2387				$scroller.css({ 'height' : 'auto' });
2388				$(area).css({ 'position' : 'absolute','height' : sideHeight });
2389				$themeWrapper.css({ 'height' : sideHeight, 'overflow' : 'hidden' });
2390			} else {
2391				$scroller.css({ 'height' : windowHeight - btnWrapperHeight - 150 });
2392				$themeWrapper.css({ 'height' : '', 'overflow' : '' });
2393			}
2394		},
2395		sideArea: function(){
2396			var $btn          = $('.eut-toggle-sidearea'),
2397				$themeWrapper = $('#eut-theme-wrapper'),
2398				content;
2399
2400			$btn.on('click',function(e){
2401				content = $(this).attr('href');
2402				if( content.indexOf("#") === 0 && $(content).length > 0 ) {
2403					e.preventDefault();
2404
2405					$(content).addClass('eut-active-sidearea');
2406					if( !$themeWrapper.hasClass('eut-side-area-open') ) {
2407						EUTHEM.pageSettings.openSideArea();
2408					} else {
2409						EUTHEM.pageSettings.closeSideArea();
2410					}
2411				}
2412			});
2413
2414			$(document).on('keyup',function(evt) {
2415				if (evt.keyCode == 27) {
2416					EUTHEM.pageSettings.closeSideArea();
2417				}
2418			});
2419
2420			$('.eut-sidearea-close-btn').on('click',function(e){
2421				e.preventDefault();
2422				EUTHEM.pageSettings.closeSideArea();
2423			});
2424		},
2425		openSideArea: function(){
2426
2427			if ( !$('body').hasClass('eut-side-area-open') ) {
2428				$('body').addClass('eut-side-area-open');
2429				var $themeWrapper = $('#eut-theme-wrapper'),
2430					wrapperH      = $(window).height(),
2431					topP          = $(window).scrollTop(),
2432					$btn          = $('.eut-toggle-sidearea'),
2433					$closeBtn     = $('.eut-sidearea-close-btn'),
2434					$sideArea     = $('.eut-active-sidearea');
2435
2436				$btn.addClass('eut-hide');
2437				setTimeout(function(){
2438					$closeBtn.removeClass('eut-hide');
2439				},800);
2440
2441				if ( $.fn.StickyHeader && 'none' != $('#eut-header').data('sticky') ) {
2442					$('#eut-header').data('eut_StickyHeader').unbindEvents();
2443				}
2444
2445				$sideArea.addClass('eut-show').css({
2446					'padding-top' : (wrapperH * 20)/100
2447				});
2448				$('.eut-wrapper-inner').css({
2449					'top' : -topP,
2450					'position' : 'relative'
2451				});
2452				$themeWrapper.addClass('eut-with-side-area').css({
2453					'height' : wrapperH
2454				}
2454).addClass('eut-side-area-open eut-side-area-shadow');
2455			}
2456		},
2457		closeSideArea: function(){
2458
2459			if ( $('body').hasClass('eut-side-area-open') ) {
2460				var $themeWrapper = $('#eut-theme-wrapper'),
2461					topP          = Math.abs( parseInt( $('.eut-wrapper-inner').css('top') ) ),
2462					$btn          = $('.eut-toggle-sidearea'),
2463					$closeBtn     = $('.eut-sidearea-close-btn'),
2464					$sideArea     = $('.eut-active-sidearea');
2465
2466				$themeWrapper.removeClass('eut-side-area-open');
2467
2468				$closeBtn.addClass('eut-hide');
2469
2470				setTimeout(function(){
2471					$themeWrapper.css({
2472						'height' : ''
2473					}).removeClass('eut-with-side-area eut-side-area-shadow');
2474					$('.eut-wrapper-inner').css({
2475						'top' : '',
2476						'position' : ''
2477					});
2478					$('html, body').scrollTop( topP );
2479					if ( $.fn.StickyHeader && 'none' != $('#eut-header').data('sticky') ) {
2480						$('#eut-header').data('eut_StickyHeader').bindEvents();
2481					}
2482					$('body').removeClass('eut-side-area-open');
2483					$btn.removeClass('eut-hide');
2484					$sideArea.removeClass('eut-show');
2485				},800);
2486			}
2487		},
2488		backtoTop: function() {
2489			var selectors  = {
2490				topBtn     : '.eut-back-top',
2491				dividerBtn : '.eut-divider-backtotop',
2492				topLink    : 'a[href="#eut-goto-header"]'
2493				},
2494				footerBarHeight = $('.eut-footer-bar.eut-fullwidth').length ? $('.eut-footer-bar.eut-fullwidth').outerHeight() : 0;
2495
2496				if( $( selectors.topBtn ).length ) {
2497
2498					$(window).on('scroll', function() {
2499						var scroll = $(this).scrollTop(),
2500							$topBtn = $( selectors.topBtn );
2501
2502						if (scroll > 600) {
2503							$topBtn.addClass('show');
2504						} else {
2505							$topBtn.removeClass('show');
2506						}
2507
2508						if ( scroll > 600 && !$('body').hasClass('eut-side-area-open') ) {
2509							$('.eut-sidearea-btn').addClass('eut-push-up');
2510						} else if( scroll < 600 && !$('body').hasClass('eut-side-area-open') ) {
2511							$('.eut-sidearea-btn').removeClass('eut-push-up');
2512						}
2513					});
2514				}
2515
2516			$.each(selectors, function(key, value){
2517				$(value).on('click', function(e){
2518					e.preventDefault();
2519					var scrollTop = Math.abs($(window).scrollTop()) / 2,
2520						speed = scrollTop < 1000 ? 1000 : scrollTop;
2521
2522					if( $(this).data('speed') != undefined && $(this).data('speed') != 'height-based' ) {
2523						speed = $(this).data('speed');
2524					}
2525
2526					// Remove Scroll Up Classes
2527					if ( $.fn.StickyHeader && $('#eut-header').data('sticky') === 'scrollup' ) {
2528						$('#eut-header').data('eut_StickyHeader').destroyScrollUp();
2529					}
2530					$('html, body').animate({scrollTop: 0}, speed, 'easeInOutCubic');
2531					$("html, body").on("scroll mousedown DOMMouseScroll mousewheel keyup", function(){
2532						$('html, body').stop();
2533					});
2534				});
2535			});
2536
2537		},
2538		animatedBg: function(){
2539			var $section = $('.eut-section');
2540
2541			$section.each(function(){
2542				var $this = $(this);
2543
2544				if( $this.hasClass('eut-bg-animated') ) {
2545					zoomBg( $this );
2546				} else if( $this.hasClass('eut-bg-horizontal') ) {
2547					horizontalBg( $this );
2548				}
2549			});
2550
2551			function zoomBg( $this ){
2552				$this.mouseenter(function() {
2553					$this.addClass('zoom');
2554				});
2555				$this.mouseleave(function() {
2556					$this.removeClass('zoom');
2557				});
2558			}
2559
2560			function horizontalBg( $this ){
2561				var bgPosition = 0;
2562				setInterval(function(){
2563					bgPosition++;
2564					$this.find('.eut-bg-image').css({ 'background-position' : bgPosition+'px center', 'background-repeat' : 'repeat' });
2565				},75);
2566			}
2567		},
2568		onePageSettings: function(){
2569
2570			// On Scroll Event
2571			$(window).on('scroll.eut_onepage', function(){
2572				EUTHEM.pageSettings.onePageMenu();
2573			});
2574
2575			$('a[href*="#"]:not( [href="#"] )').on('click', function(e) {
2576				var headerHeight    = $('#eut-header').length && ( $('#eut-header').data('sticky') != 'none' && $('#eut-header').data('sticky') != 'scrollup' ) ? $('#eut-header').data('sticky-height') : 0,
2577					anchorBarHeight = $('.eut-anchor-menu').length && !$('.eut-anchor-menu').hasClass('eut-anchor-responsive') ? $('.eut-anchor-menu').outerHeight() : 0,
2578					target          = $(this.hash),
2579					targetHash      = this.hash;
2580
2581				// Remove Scroll Up Classes
2582				if ( $.fn.StickyHeader && $('#eut-header').data('sticky') === 'scrollup' ) {
2583					$('#eut-header').data('eut_StickyHeader').destroyScrollUp();
2584				}
2585
2586				if ( target.length && ( target.hasClass('eut-section') || target.hasClass('eut-inner-section') || target.hasClass('eut-bookmark') ) ) {
2587					$('html,body').animate({
2588						scrollTop: target.offset().top - headerHeight - anchorBarHeight + 1
2589					}, 1000);
2590					return false;
2591				}
2592				if ( target.length && ( target.hasClass('eut-tab-content') || target.hasClass('eut-accordion-content') ) ) {
2593					var tabLink =  $('.eut-tab-link[data-rel="' + targetHash + '"]:visible');
2594					if ( tabLink.length ) {
2595						tabLink.click();
2596						setTimeout(function() {
2597							EUTHEM.pageSettings.linkGoToTop( tabLink );
2598						}, 500);
2599					}
2600					return false;
2601				}
2602			});
2603		},
2604		onePageMenu: function(){
2605			var $section = $('#eut-main-content .eut-section[id], #eut-main-content .eut-inner-section[id]');
2606			if ( $section.length === 0 ) return;
2607
2608			var sideHeader     = $('#eut-main-header').hasClass('eut-header-side') ? true : false,
2609				headerHeight   = $('#eut-header').attr('data-sticky-header') != 'none' && !sideHeader ? $('#eut-main-header').outerHeight() : 0,
2610				anchorBarHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0,
2611				offsetTop      = headerHeight + anchorBarHeight + wpBarHeight,
2612				scroll         = $(window).scrollTop();
2613
2614			$section.each(function(){
2615				var $that         = $(this),
2616					currentId     = $that.attr('id'),
2617					sectionOffset = $that.offset().top - offsetTop;
2618
2619				if (sectionOffset <= scroll && sectionOffset + $that.outerHeight() > scroll ) {
2620					$('a[href*="#' + currentId + '"]').parent().addClass('active');
2621				}
2622				else{
2623					$('a[href*="#' + currentId + '"]').parent().removeClass("active");
2624				}
2625
2626			});
2627		},
2628		showList: function(){
2629			var $list = $('.eut-show-list');
2630			$list.ShowListItems();
2631			// if ( isMobile.any() ) {
2632			// 	$list.data('eut_ShowListItems').destroy();
2633			// };
2634		},
2635		fixedFooter: function(){
2636			var $footer      = $('#eut-footer'),
2637				sticky       = $footer.data('sticky-footer'),
2638				prevSection  = $footer.prev(),
2639				prevMargin = parseInt( prevSection.css('margin-bottom') ),
2640				delay;
2641
2642			if( !$footer.length || sticky != 'yes' || isMobile.any() ) return;
2643
2644			// On window events
2645			$( window ).on( 'scroll', function(){
2646				update();
2647			});
2648			$(window).on('resize',resizer);
2649
2650			function resizer(){
2651				window.clearTimeout(delay);
2652				delay = window.setTimeout(function() {
2653					$footer.prev().css( 'margin-bottom','' );
2654					prevMargin = parseInt( prevSection.css('margin-bottom') );
2655					update();
2656				}, 900);
2657			}
2658
2659			update();
2660
2661			function update(){
2662				var windowWidth = $(window).width(),
2663					windowHeight = $(window).height(),
2664					footerHeight = $footer.outerHeight(),
2665					margin       = footerHeight + prevMargin;
2666
2667				if( ( windowWidth + scrollBarWidth <= tabletLandscape ) || ( footerHeight > windowHeight ) ) {
2668					$footer.removeClass('eut-fixed-footer').prev().css( 'margin-bottom','' );
2669				} else {
2670					$footer.addClass('eut-fixed-footer').prev().css( 'margin-bottom',margin );
2671				}
2672			}
2673
2674		},
2675		productImageParallax: function(){
2676			$('#eut-product-feature-image .eut-product-parallax-image img').paraller({
2677				wrapper : '.eut-product-area-wrapper',
2678				effect : 'mouse-move-x',
2679				sensitive : 'normal',
2680				invert : true
2681			});
2682		},
2683		lightGallery: function(){
2684			var thumbnail = false;
2685			if( 1 == crocal_eutf_main_data.woo_popup_thumbs ) {
2686				thumbnail = true;
2687			}
2688			$('.eut-woo-light-gallery-popup').lightGallery({
2689				selector: '.eut-popup-link',
2690				thumbnail: thumbnail,
2691				hash: false,
2692			});
2693 			$('.eut-gallery-popup').lightGallery({
2694				selector: '.eut-item-url',
2695				thumbnail: false,
2696				hash: false,
2697			});
2698			$('.eut-post-gallery-popup').lightGallery({
2699				selector: 'a',
2700				thumbnail: false,
2701				hash: false,
2702			});
2703			$('.eut-light-gallery').lightGallery({
2704				selector: '.eut-item-url',
2705				thumbnail: false,
2706				hash: false,
2707			});
2708			$('.eut-image-popup').lightGallery({
2709				selector: 'this',
2710				thumbnail: false,
2711				hash: false,
2712			});
2713
2714			if ( $('.eut-body').hasClass( 'eut-privacy-video-embeds-disabled' ) ) {
2715				$('.eut-video-popup').each(function() {
2716					$(this).attr({"target" : "_blank"});
2717				});
2718			} else {
2719				$('.eut-video-popup').lightGallery({
2720					selector: 'this',
2721					thumbnail: false,
2722					hash: false,
2723				});
2724			}
2725
2726			if( 1 == crocal_eutf_main_data.wp_gallery_popup ) {
2727				$('.gallery').lightGallery({
2728					selector: '.gallery-item a',
2729					getCaptionFromTitleOrAlt: false,
2730					thumbnail: false,
2731					hash: false,
2732				});
2733				$('.wp-block-gallery').lightGallery({
2734					selector: '.blocks-gallery-item a',
2735					getCaptionFromTitleOrAlt: false,
2736					thumbnail: false,
2737					hash: false,
2738				});
2739			}
2740		},
2741		lightBox: function(){
2742			//Inline Modal Popup
2743			$('.eut-modal-popup').each(function() {
2744				$(this).magnificPopup({
2745					disableOn: 0,
2746					type: 'inline',
2747					preloader: false,
2748					prependTo: '#eut-theme-wrapper',
2749					fixedBgPos: true,
2750					fixedContentPos: true,
2751					removalDelay: 200,
2752					closeMarkup: '<div class="mfp-close eut-close-modal"></div>',
2753					closeOnBgClick: true,
2754					callbacks: {
2755						beforeOpen: function() {
2756							var mfpWrap = this.wrap;
2757							this.bgOverlay.fadeIn(200);
2758							addSpinner( mfpWrap );
2759							this.container.css({'opacity':0});
2760						},
2761						open: function() {
2762							var $spinner = this.wrap.find('.eut-spinner'),
2763								$content = this.container;
2764							removeSpinner( $spinner, $content );
2765							if( $content.find('.eut-isotope').length ) {
2766								setTimeout(function(){
2767									EUTHEM.isotope.relayout();
2768								},100);
2769							}
2770							if( $content.find('.owl-carousel').length ) {
2771								setTimeout(function(){
2772									$content.find('.owl-carousel').each(function(){
2773										var owl = $(this).data('owlCarousel');
2774										owl.onResize();
2775									});
2776								},300);
2777							}
2778							if( $content.find('.eut-map').length ) {
2779								$('.eut-map').trigger( "eut_redraw_map" );
2780							}
2781						},
2782						beforeClose: function() {
2783							this.wrap.fadeOut(100);
2784							this.container.css({'opacity' : 0});
2785							this.bgOverlay.fadeOut(100);
2786						},
2787					}
2788				});
2789			});
2790			//VIDEOS
2791			$('.eut-page-popup').each(function() {
2792				$(this).magnificPopup({
2793					disableOn: 0,
2794					type: 'iframe',
2795					preloader: false,
2796					fixedBgPos: true,
2797					fixedContentPos: true,
2798					removalDelay: 200,
2799					closeMarkup: '<div class="mfp-close eut-close-modal"></div>',
2800					closeOnBgClick: true,
2801					callbacks: {
2802						beforeOpen: function() {
2803							var mfpWrap = this.wrap;
2804							this.bgOverlay.fadeIn(200);
2805							addSpinner( mfpWrap );
2806						},
2807						open: function() {
2808							var $spinner = this.wrap.find('.eut-spinner'),
2809								$content = this.container;
2810							removeSpinner( $spinner, $content );
2811						},
2812						beforeClose: function() {
2813							this.wrap.fadeOut(100);
2814							this.container.css({'opacity' : 0});
2815							this.bgOverlay.fadeOut(100);
2816						},
2817					}
2818				});
2819			});
2820
2821			$('.eut-html5-video-popup').each(function() {
2822				$(this).magnificPopup({
2823					disableOn: 0,
2824					type: 'inline',
2825					preloader: false,
2826					prependTo: '#eut-theme-wrapper',
2827					fixedBgPos: true,
2828					fixedContentPos: true,
2829					removalDelay: 200,
2830					closeMarkup: '<div class="mfp-close eut-close-modal"></div>',
2831					closeOnBgClick: true,
2832					callbacks: {
2833						beforeOpen: function() {
2834							var mfpWrap = this.wrap;
2835							this.bgOverlay.fadeIn(200);
2836							addSpinner( mfpWrap );
2837						},
2838						open: function() {
2839							var $spinner = this.wrap.find('.eut-spinner'),
2840								$content = this.container;
2841							removeSpinner( $spinner, $content );
2842							if ( $content.find('video').length ) {
2843								setTimeout(function(){
2844									$content.find('video')[0].play();
2845								},500);
2846							}
2847						},
2848						beforeClose: function() {
2849							if ( this.wrap.find('video').length ) {
2850								this.wrap.find('video')[0].load();
2851							}
2852							this.wrap.fadeOut(100);
2853							this.container.css({'opacity' : 0});
2854							this.bgOverlay.fadeOut(100);
2855						},
2856					}
2857				});
2858			});
2859
2860			function addSpinner( mfpWrap ){
2861				$(spinner).appendTo( mfpWrap );
2862			}
2863
2864			function removeSpinner( spinner, content ){
2865				setTimeout(function(){
2866					spinner.fadeOut(1000, function(){
2867						content.animate({'opacity':1},600);
2868						$('.eut-modal-popup').trigger( 'eut_open_modal' );
2869						$(spinner).remove();
2870					});
2871				}, 700);
2872			}
2873		},
2874		socialShareLinks: function(){
2875			$(document).on('click','.eut-social-share-facebook',function(e){
2876				e.preventDefault();
2877				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2878				window.open( 'https://www.facebook.com/sharer/sharer.php?u=' + shareUrl, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" );
2879				return false;
2880			});
2881			$(document).on('click','.eut-social-share-twitter',function(e){
2882				e.preventDefault();
2883				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2884				window.open( 'http://twitter.com/intent/tweet?text=' + encodeURIComponent( $(this).attr('title') ) + ' ' + shareUrl, "twitterWindow", "height=450,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" );
2885				return false;
2886			});
2887			$(document).on('click','.eut-social-share-linkedin',function(e){
2888				e.preventDefault();
2889				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2890				window.open( 'http://www.linkedin.com/shareArticle?mini=true&url=' + shareUrl + '&title=' + encodeURIComponent( $(this).attr('title') ), "linkedinWindow", "height=500,width=820,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" );
2891				return false;
2892			});
2893			$(document).on('click','.eut-social-share-pinterest',function(e){
2894				e.preventDefault();
2895				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2896				window.open( 'http://pinterest.com/pin/create/button/?url=' + shareUrl + '&media=' + $(this).data('pin-img') + '&description=' + encodeURIComponent( $(this).attr('title') ), "pinterestWindow", "height=600,width=600,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" );
2897				return false;
2898			});
2899			$(document).on('click','.eut-social-share-reddit',function(e){
2900				e.preventDefault();
2901				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2902				window.open( '//www.reddit.com/submit?url=' + shareUrl, "redditWindow", "height=600,width=820,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=1" );
2903				return false;
2904			});
2905			$(document).on('click','.eut-social-share-tumblr',function(e){
2906				e.preventDefault();
2907				var shareUrl = $(this).attr('data-share-url') ? $(this).attr('data-share-url') : $(this).attr('href');
2908				window.open( '//www.tumblr.com/share/link?url=' + shareUrl + '&name=' + encodeURIComponent( $(this).attr('title') ) , "tumblrWindow", "height=600,width=600,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=1" );
2909				return false;
2910			});
2911			$(document).on('click','.eut-like-counter-link',function(e){
2912				e.preventDefault();
2913				var link = $(this);
2914				var id = link.data('post-id'),
2915					counter = link.parent().find('.eut-like-counter'),
2916					icon = link.find('i');
2917
2918				var dataParams = {
2919					action:'crocal_eutf_likes_callback',
2920					eut_likes_id: id,
2921					_eutf_nonce: crocal_eutf_main_data.nonce_likes
2922				};
2923
2924				$.post( crocal_eutf_main_data.ajaxurl, dataParams , function( response ) {
2925					if ( '-1' != response ) {
2926						if( 'active' == response.status ){
2927							link.addClass('active');
2928							icon.addClass('eut-heading-color');
2929						} else {
2930							link.removeClass('active');
2931							icon.removeClass('eut-heading-color');
2932						}
2933						counter.html(response.likes);
2934					}
2935				}).fail(function(xhr, status, error) {
2936				});
2937
2938				return false;
2939			});
2940		}
2941	};
2942
2943	// # Basic Elements
2944	// ============================================================================= //
2945	EUTHEM.basicElements = {
2946		init: function(){
2947			this.pieChart();
2948			this.progressBars();
2949			this.counter();
2950			this.slider();
2951			this.testimonial();
2952			this.flexibleCarousel();
2953			this.carousel();
2954			this.advancedCarousel();
2955			this.advancedPromo();
2956			this.doubleImageText();
2957			this.portfolioParallax();
2958			this.teamParallax();
2959			this.testimonialParallax();
2960			this.messageBox();
2961			this.wooProduct();
2962			this.animAppear();
2963			this.htmlVideoPlayWhenAppear();
2964			this.accordionToggle();
2965			this.tabs();
2966			this.productSocials();
2967			this.countdown();
2968			this.hovers();
2969		},
2970		pieChart: function(){
2971
2972			$('.eut-chart-number').each(function() {
2973				var $element  = $(this),
2974					delay     = $element.parent().data('delay') !== '' ? parseInt( $element.parent().data('delay') ) : 0,
2975					size      = $element.data('pie-size'),
2976					chartSize = '130';
2977				if( size == 'small' ){
2978					chartSize = '100';
2979				}
2980				if( size == 'large' ){
2981					chartSize = '160';
2982				}
2983
2984				$element.css({ 'width' : chartSize, 'height' : chartSize, 'line-height' : chartSize + 'px' });
2985
2986				if( $element.parents('.eut-modal-element').length ){
2987					$('.eut-modal-popup').on( 'eut_open_modal', function(){
2988						EUTHEM.basicElements.pieChartInit( $element, chartSize );
2989					});
2990				} else {
2991					$element.appear(function() {
2992						setTimeout(function () {
2993							EUTHEM.basicElements.pieChartInit( $element, chartSize );
2994						}, delay);
2995					});
2996				}
2997			});
2998
2999		},
3000		pieChartInit: function( $element, size ){
3001
3002			var activeColor = $element.data('pie-active-color') !== '' ? $element.data('pie-active-color') : 'rgba(0,0,0,1)',
3003				pieColor    = $element.data('pie-color') !== '' ? $element.data('pie-color') : 'rgba(0,0,0,0.1)',
3004				pieLineCap  = $element.data('pie-line-cap') !== '' ? $element.data('pie-line-cap') : 'round',
3005				lineSize    = $element.data('pie-line-size') !== '' ? $element.data('pie-line-size') : '6',
3006				chartSize   = size;
3007
3008
3009			$element.easyPieChart({
3010				barColor: activeColor,
3011				trackColor: pieColor,
3012				scaleColor: false,
3013				lineCap: pieLineCap,
3014				lineWidth: lineSize,
3015				animate: 1500,
3016				size: chartSize
3017			});
3018		},
3019		progressBars: function(){
3020			$('.eut-progress-bar').each(function() {
3021
3022				var $element  = $(this);
3023				if( $element.parents('.eut-modal-element').length ){
3024					$('.eut-modal-popup').on( 'eut_open_modal', function(){
3025						EUTHEM.basicElements.progressBarsInit( $element );
3026					});
3027				} else {
3028					$element.appear(function() {
3029						EUTHEM.basicElements.progressBarsInit( $element );
3030					});
3031				}
3032			});
3033		},
3034		progressBarsInit: function( $element ){
3035			var val = $element.attr('data-value'),
3036				percentage = $('<span class="eut-percentage">'+ val + '%'+'</span>');
3037
3038			$element.find('.eut-bar-line').animate({ width: val + '%' }, 1600);
3039			if( $element.parent().hasClass('eut-style-1') ) {
3040				percentage.appendTo($element.find('.eut-bar')).animate({ left: val + '%' }, 1600);
3041			} else {
3042				percentage.appendTo($element.find('.eut-bar-title'));
3043			}
3044		},
3045		counter: function(){
3046			if( bodyLoader === true ){
3047				return;
3048			}
3049			var selector = '.eut-counter-item span';
3050			$(selector).each(function(i){
3051				var elements = $(selector)[i],
3052					thousandsSeparator = $(this).attr('data-thousands-separator') !== '' ? $(this).attr('data-thousands-separator') : ',';
3053				$(elements).attr('id','eut-counter-' + i );
3054				var delay = $(this).parents('.eut-counter').attr('data-delay') !== '' ? parseInt( $(this).parents('.eut-counter').attr('data-delay') ) : 200,
3055					options = {
3056						useEasing    : true,
3057						useGrouping  : true,
3058						separator    : $(this).attr('data-thousands-separator-vis') !== 'yes' ? thousandsSeparator : '',
3059						decimal      : $(this).attr('data-decimal-separator') !== '' ? $(this).attr('data-decimal-separator') : '.',
3060						prefix       : $(this).attr('data-prefix') !== '' ? $(this).attr('data-prefix') : '',
3061						suffix       : $(this).attr('data-suffix') !== '' ? $(this).attr('data-suffix') : ''
3062					},
3063					counter = new CountUp( $(this).attr('id') , $(this).attr('data-start-val'), $(this).attr('data-end-val'), $(this).attr('data-decimal-points'), 2.5, options);
3064				$(this).appear(function() {
3065					setTimeout(function () {
3066						counter.start();
3067					}, delay);
3068				});
3069			});
3070		},
3071		slider: function(){
3072
3073			var $element = $('#eut-main-content .eut-slider-element, #eut-single-media .eut-slider-element');
3074
3075			$element.each(function(){
3076				var $slider = $(this),
3077					$nextNav = $slider.parents('.eut-slider').find('.eut-carousel-next'),
3078					$prevNav = $slider.parents('.eut-slider').find('.eut-carousel-prev'),
3079					sliderSpeed = ( parseInt( $slider.attr('data-slider-speed') ) ) ? parseInt( $slider.attr('data-slider-speed') ) : 3000,
3080					transition = $slider.attr('data-slider-transition'),
3081					loop = $slider.attr('data-slider-loop') != 'no' ? true : false,
3082					autoPlay = $slider.attr('data-slider-autoplay') != 'no' ? true : false,
3083					autoHeight = $slider.attr('data-slider-autoheight') == 'yes' ? true : false,
3084					paginColor = $slider.attr('data-pagination-color') !== undefined ? 'eut-carousel-pagination eut-dots-' + $slider.attr('data-pagination-color') : 'eut-carousel-pagination',
3085					pagination = $slider.attr('data-pagination') != 'no' ? true : false,
3086					animateOut = false,
3087					animateIn = false;
3088
3089				// Slider Trantition
3090				if( $slider.parents('.eut-slider').hasClass('eut-layout-2') || 'fade' == transition ){
3091					animateOut = 'carousel-fade-out';
3092					animateIn = 'carousel-fade-in';
3093				}
3094
3095				if ( $slider.find('.eut-slider-item').length == 1 ) {
3096					loop = false;
3097				}
3098
3099				// Slider Init
3100				$slider.owlCarousel({
3101					items : 1,
3102					loop : loop,
3103					autoplay : autoPlay,
3104					autoplayTimeout : sliderSpeed,
3105					autoplayHoverPause : false,
3106					smartSpeed : 500,
3107					dots : pagination,
3108					animateOut : animateOut,
3109					animateIn : animateIn,
3110					autoHeight : autoHeight,
3111					dotsClass : paginColor,
3112					itemClass : 'eut-slider-item-wrapper'
3113				});
3114
3115				$slider.parents('.eut-slider').css('visibility','visible');
3116
3117				// Go to the next item
3118				$nextNav.on( 'click', function() {
3119					$slider.trigger('next.owl.carousel');
3120				});
3121				// Go to the previous item
3122				$prevNav.on( 'click', function() {
3123					$slider.trigger('prev.owl.carousel');
3124				});
3125
3126			});
3127
3128		},
3129		testimonial: function(){
3130
3131			var $element = $('.eut-testimonial.eut-carousel-element');
3132
3133			$element.each(function(){
3134				var $testimonial = $(this),
3135					sliderSpeed = ( parseInt( $testimonial.attr('data-slider-speed') ) ) ? parseInt( $testimonial.attr('data-slider-speed') ) : 3000,
3136					pagination = $testimonial.attr('data-pagination') != 'no' ? true : false,
3137					paginationSpeed = ( parseInt( $testimonial.attr('data-pagination-speed') ) ) ? parseInt( $testimonial.attr('data-pagination-speed') ) : 400,
3138					transition = $testimonial.attr('data-slider-transition'),
3139					autoHeight = $testimonial.attr('data-slider-autoheight') == 'yes' ? true : false,
3140					autoPlay = $testimonial.attr('data-slider-autoplay') != 'no' ? true : false,
3141					sliderPause = $testimonial.attr('data-slider-pause') == 'yes' ? true : false,
3142					loop = true,
3143					animateOut = false,
3144					animateIn = false;
3145
3146				// Testimonial Trantition
3147				if( $testimonial.hasClass('eut-layout-2') || 'fade' == transition ){
3148					animateOut = 'carousel-fade-out';
3149					animateIn = 'carousel-fade-in';
3150				}
3151				if ( $testimonial.find('.eut-testimonial-element').length == 1 ) {
3152					loop = false;
3153				}
3154
3155				// Testimonial Init
3156				$testimonial.owlCarousel({
3157					items : 1,
3158					loop : loop,
3159					autoplay : autoPlay,
3160					autoplayTimeout : sliderSpeed,
3161					autoplayHoverPause : sliderPause,
3162					smartSpeed : 500,
3163					dots : pagination,
3164					dotsClass : 'eut-carousel-pagination',
3165					animateOut : animateOut,
3166					animateIn : animateIn,
3167					autoHeight : autoHeight,
3168					itemClass : 'eut-testimonial-item-wrapper'
3169				});
3170
3171				$testimonial.css('visibility','visible');
3172
3173			});
3174		},
3175		flexibleCarousel: function(){
3176
3177			var $element = $('.eut-flexible-carousel-element');
3178
3179			$element.each(function(){
3180
3181				var $carousel = $(this),
3182					$nextNav = $carousel.parents('.eut-flexible-carousel').find('.eut-carousel-next'),
3183					$prevNav = $carousel.parents('.eut-flexible-carousel').find('.eut-carousel-prev'),
3184					sliderSpeed = ( parseInt( $carousel.attr('data-slider-speed') ) ) ? parseInt( $carousel.attr('data-slider-speed') ) : 3000,
3185					pagination = $carousel.attr('data-pagination') != 'no' ? true : false,
3186					paginationSpeed = ( parseInt( $carousel.attr('data-pagination-speed') ) ) ? parseInt( $carousel.attr('data-pagination-speed') ) : 400,
3187					autoHeight = $carousel.attr('data-slider-autoheight') == 'yes' ? true : false,
3188					autoPlay = $carousel.attr('data-slider-autoplay') != 'no' ? true : false,
3189					sliderPause = $carousel.attr('data-slider-pause') == 'yes' ? true : false,
3190					loop = true,
3191					itemNum = parseInt( $carousel.attr('data-items')),
3192					tabletLandscapeNum = $carousel.attr('data-items-tablet-landscape') ? parseInt( $carousel.attr('data-items-tablet-landscape')) : 4,
3193					tabletPortraitNum = $carousel.attr('data-items-tablet-portrait') ? parseInt( $carousel.attr('data-items-tablet-portrait')) : 2,
3194					mobileNum = $carousel.attr('data-items-mobile') ? parseInt( $carousel.attr('data-items-mobile')) : 1,
3195					gap = $carousel.parents('.eut-flexible-carousel').hasClass('eut-with-gap') ? 30 : 0,
3196					padding = $carousel.parents('.eut-flexible-carousel').hasClass('eut-with-gap') && $carousel.parents('.eut-section').hasClass('eut-fullwidth') ? 30 : 0;
3197
3198				if ( $carousel.find('.eut-flexible-carousel-element').length == 1 ) {
3199					loop = false;
3200				}
3201				// Carousel Init
3202				$carousel.owlCarousel({
3203					items : 1,
3204					loop : loop,
3205					autoplay : autoPlay,
3206					autoplayTimeout : sliderSpeed,
3207					autoplayHoverPause : sliderPause,
3208					smartSpeed : 500,
3209					dots : pagination,
3210					dotsClass : 'eut-carousel-pagination',
3211					responsive : {
3212						0 : {
3213							items : mobileNum
3214						},
3215						768 : {
3216							items : tabletPortraitNum
3217						},
3218						1024 : {
3219							items : tabletLandscapeNum
3220						},
3221						1200 : {
3222							items : itemNum
3223						}
3224					},
3225					margin : gap,
3226					stagePadding : padding,
3227					autoHeight : autoHeight,
3228					itemClass : 'eut-carousel-item-wrapper'
3229				});
3230
3231				$carousel.css('visibility','visible');
3232
3233				// Go to the next item
3234				$nextNav.on( 'click', function() {
3235					$carousel.trigger('next.owl.carousel');
3236				});
3237				// Go to the previous item
3238				$prevNav.on( 'click', function() {
3239					$carousel.trigger('prev.owl.carousel');
3240				});
3241
3242			});
3243		},
3244		carousel: function(){
3245
3246			var $element = $('.eut-carousel-element');
3247
3248			$element.each(function(){
3249				var $carousel = $(this),
3250					$nextNav = $carousel.parents('.eut-carousel').find('.eut-carousel-next'),
3251					$prevNav = $carousel.parents('.eut-carousel').find('.eut-carousel-prev'),
3252					sliderSpeed = ( parseInt( $carousel.attr('data-slider-speed') ) ) ? parseInt( $carousel.attr('data-slider-speed') ) : 3000,
3253					pagination = $carousel.attr('data-pagination') != 'no' ? true : false,
3254					paginationSpeed = ( parseInt( $carousel.attr('data-pagination-speed') ) ) ? parseInt( $carousel.attr('data-pagination-speed') ) : 400,
3255					autoHeight = $carousel.attr('data-slider-autoheight') == 'yes' ? true : false,
3256					autoPlay = $carousel.attr('data-slider-autoplay') != 'no' ? true : false,
3257					sliderPause = $carousel.attr('data-slider-pause') == 'yes' ? true : false,
3258					loop = $carousel.attr('data-slider-loop') != 'no' ? true : false,
3259					itemNum = parseInt( $carousel.attr('data-items')),
3260					tabletLandscapeNum = $carousel.attr('data-items-tablet-landscape') ? parseInt( $carousel.attr('data-items-tablet-landscape')) : 3,
3261					tabletPortraitNum = $carousel.attr('data-items-tablet-portrait') ? parseInt( $carousel.attr('data-items-tablet-portrait')) : 3,
3262					mobileNum = $carousel.attr('data-items-mobile') ? parseInt( $carousel.attr('data-items-mobile')) : 1,
3263					gap = $carousel.parents('.eut-carousel').hasClass('eut-with-gap') && !isNaN( $carousel.data('gutter-size') ) ? Math.abs( $carousel.data('gutter-size') ) 
3263: 0,
3264					padding = $carousel.parents('.eut-carousel').hasClass('eut-with-gap') && $carousel.parents('.eut-section').hasClass('eut-fullwidth') && !isNaN( $carousel.data('gutter-size') ) ? Math.abs( $carousel.data('gutter-size') ) : 0;
3265
3266				if ( $carousel.find('.eut-carousel-item').length == 1 ) {
3267					loop = false;
3268				}
3269
3270				// Carousel Init
3271				$carousel.owlCarousel({
3272					loop : loop,
3273					autoplay : autoPlay,
3274					autoplayTimeout : sliderSpeed,
3275					autoplayHoverPause : sliderPause,
3276					smartSpeed : 500,
3277					dots : pagination,
3278					dotsClass : 'eut-carousel-pagination',
3279					responsive : {
3280						0 : {
3281							items : mobileNum
3282						},
3283						768 : {
3284							items : tabletPortraitNum
3285						},
3286						1024 : {
3287							items : tabletLandscapeNum
3288						},
3289						1200 : {
3290							items : itemNum
3291						}
3292					},
3293					margin : gap,
3294					stagePadding : padding,
3295					itemClass : 'eut-carousel-item-wrapper'
3296				});
3297
3298				$carousel.css('visibility','visible');
3299
3300				// Go to the next item
3301				$nextNav.on( 'click', function() {
3302					$carousel.trigger('next.owl.carousel');
3303				});
3304				// Go to the previous item
3305				$prevNav.on( 'click', function() {
3306					$carousel.trigger('prev.owl.carousel');
3307				});
3308
3309			});
3310		},
3311		advancedCarousel: function(){
3312
3313			var $element = $('.eut-advanced-carousel');
3314
3315			$element.each(function(){
3316				var $carousel = $(this),
3317					sliderSpeed = ( parseInt( $carousel.attr('data-slider-speed') ) ) ? parseInt( $carousel.attr('data-slider-speed') ) : 3000,
3318					pagination = $carousel.attr('data-pagination') != 'no' ? true : false,
3319					paginationSpeed = ( parseInt( $carousel.attr('data-pagination-speed') ) ) ? parseInt( $carousel.attr('data-pagination-speed') ) : 400,
3320					autoHeight = $carousel.attr('data-slider-autoheight') == 'yes' ? true : false,
3321					autoPlay = $carousel.attr('data-slider-autoplay') != 'no' ? true : false,
3322					sliderPause = $carousel.attr('data-slider-pause') == 'yes' ? true : false,
3323					loop = $carousel.attr('data-slider-loop') != 'no' ? true : false,
3324					gap = $carousel.parents('.eut-carousel').hasClass('eut-with-gap') && !isNaN( $carousel.data('gutter-size') ) ? Math.abs( $carousel.data('gutter-size') ) : 0,
3325					largeScreenStagePadding = !isNaN( $carousel.data('stage-padding-large-screen') ) ? Math.abs( $carousel.data('stage-padding-large-screen') ) : 0,
3326					stagePadding = !isNaN( $carousel.data('stage-padding') ) ? Math.abs( $carousel.data('stage-padding') ) 
3326: 0,
3327					tabletLandscapeStagePadding = !isNaN( $carousel.data('stage-padding-tablet-landscape') ) ? Math.abs( $carousel.data('stage-padding-tablet-landscape') ) : 0,
3328					tabletPortraitStagePadding = !isNaN( $carousel.data('stage-padding-tablet-portrait') ) ? Math.abs( $carousel.data('stage-padding-tablet-portrait') ) : 0,
3329					mobileStagePadding = !isNaN( $carousel.data('stage-padding-mobile') ) ? Math.abs( $carousel.data('stage-padding-mobile') ) : 0;
3330
3331				if ( $carousel.find('.eut-carousel-item').length == 1 ) {
3332					loop = false;
3333				}
3334
3335				// Carousel Init
3336				$carousel.owlCarousel({
3337					loop : loop,
3338					autoplay : autoPlay,
3339					autoplayTimeout : sliderSpeed,
3340					autoplayHoverPause : sliderPause,
3341					smartSpeed : 500,
3342					dots : pagination,
3343					dotsClass : 'eut-carousel-pagination',
3344					items : 1,
3345					margin : gap,
3346					responsive:{
3347						0:{
3348							items:1,
3349							stagePadding: mobileStagePadding
3350						},
3351						768:{
3352							items:1,
3353							stagePadding: tabletPortraitStagePadding
3354						},
3355						1024:{
3356							items:1,
3357							stagePadding: tabletLandscapeStagePadding
3358						},
3359						1200:{
3360							items:1,
3361							stagePadding: stagePadding
3362						},
3363						2000:{
3364							items:1,
3365							stagePadding: largeScreenStagePadding
3366						}
3367					},
3368					itemClass : 'eut-carousel-item-wrapper'
3369				});
3370
3371				$carousel.css('visibility','visible');
3372
3373			});
3374		},
3375		advancedPromo: function(){
3376			var $item = $('.eut-expandable-info');
3377			$item.each(function(){
3378				var $that         = $(this),
3379					$wrapper      = $that.parents('.eut-section'),
3380					$content      = $that.find('.eut-expandable-info-content'),
3381					paddingTop    = parseInt( $wrapper.css('padding-top') ),
3382					paddingBottom = parseInt( $wrapper.css('padding-bottom') );
3383
3384				$wrapper.addClass('eut-pointer-cursor');
3385				$wrapper.on('click',function(){
3386
3387					var headerHeight   = $('#eut-header').data('sticky') != 'none' ? $('#eut-main-header').outerHeight() : 0,
3388						fieldBarHeight = $('.eut-fields-bar').length ? $('.eut-fields-bar').outerHeight() : 0,
3389						offset         = $(this).offset().top,
3390						distance       = offset - ( headerHeight + fieldBarHeight );
3391
3392					if( $content.is(":visible") ){
3393						$content.slideUp( 600, function(){
3394							$content.removeClass('show');
3395						});
3396					} else {
3397
3398						$('html,body').animate({
3399							scrollTop: distance
3400						}, 600,function(){
3401							$content.slideDown( function(){
3402								$content.addClass('show');
3403								return;
3404							});
3405						});
3406					}
3407				});
3408				$wrapper.mouseenter(function() {
3409					$(this).css({ 'padding-top' : paddingTop + 40, 'padding-bottom' : paddingBottom + 40 });
3410				});
3411				$wrapper.mouseleave(function() {
3412					$(this).css({ 'padding-top' : paddingTop, 'padding-bottom' : paddingBottom });
3413				});
3414			});
3415		},
3416		doubleImageText: function(){
3417			var $el = $('.eut-double-image-text'),
3418				$paraller = $el.find('.eut-paraller');
3419
3420			imagesLoaded( $el, function() {
3421				$paraller.paraller({
3422					wrapper : '.eut-paraller-wrapper',
3423					invert : false,
3424					tabletL : [1200, true],
3425					tabletP : [1023, true],
3426					mobileL : [767, false]
3427				});
3428			});
3429		},
3430		portfolioParallax: function(){
3431			var $el = $('.eut-portfolio-crocal-style'),
3432				$paraller = $el.find('.eut-paraller');
3433
3434			imagesLoaded( $el, function() {
3435				$paraller.paraller({
3436					wrapper : '.eut-paraller-wrapper',
3437					invert : false,
3438					tabletL : [1200, true],
3439					tabletP : [1023, true],
3440					mobileL : [767, false]
3441				});
3442			});
3443		},
3444		teamParallax: function(){
3445			var $el = $('.eut-team.eut-layout-2'),
3446				$paraller = $el.find('.eut-paraller');
3447
3448			imagesLoaded( $el, function() {
3449				$paraller.paraller({
3450					wrapper : '.eut-paraller-wrapper',
3451					invert : false,
3452					tabletL : [1200, true],
3453					tabletP : [1023, true],
3454					mobileL : [767, false]
3455				});
3456			});
3457		},
3458		testimonialParallax: function(){
3459			var $el = $('.eut-testimonial.eut-layout-2'),
3460				$paraller = $el.find('.eut-paraller');
3461
3462			imagesLoaded( $el, function() {
3463				$paraller.paraller({
3464					wrapper : '.eut-paraller-wrapper',
3465					invert : false,
3466					tabletL : [1200, true],
3467					tabletP : [1023, true],
3468					mobileL : [767, false]
3469				});
3470			});
3471		},
3472		iconBox: function(){
3473			var $iconBox = $('.eut-box-icon.eut-advanced-hover');
3474			if( isMobile.any() ) {
3475				$iconBox.css({'visibility' : 'visible'});
3476				return false;
3477			}
3478			$iconBox.each(function(){
3479				var $that = $(this),
3480					$text = $that.find('p'),
3481					$column = $that.parents('.eut-column'),
3482					space = 0,
3483					resize = false;
3484
3485				setup();
3486				$(window).smartresize(setup);
3487
3488				function updateParams(){
3489					space = $text.outerHeight();
3490				}
3491
3492				function resetIcon(){
3493					$that.css({ 'top' : '' });
3494					$text.css({ 'opacity' : 1, 'bottom' : '' });
3495				}
3496
3497				function setup(){
3498					if(!resize){
3499						resize = true;
3500
3501						resetIcon();
3502						updateParams();
3503
3504						$column.css({ 'overflow' : 'hidden' });
3505						$that.css({ 'top' : space, 'visibility' : 'visible' });
3506						$text.css({ 'opacity' : 0, 'position' : 'relative', 'bottom' : '-120%' });
3507
3508						resize = true;
3509					}
3510				}
3511
3512				$column.hover(function(){
3513					$that.stop( true, true ).animate({
3514						'top' : 0
3515					},400, 'easeOutBack');
3516					$text.stop( true, true ).delay( 100 ).animate({
3517						'opacity' : 1,
3518						'bottom' : 0
3519					},600, 'easeOutBack');
3520				},function(){
3521					$that.stop( true, true ).animate({
3522						'top' : space
3523					},500, 'easeOutBack');
3524					$text.stop( true, true ).animate({
3525						'opacity' : 0,
3526						'bottom' : '-120%'
3527					},400, 'easeOutBack');
3528				});
3529
3530			});
3531
3532		},
3533		messageBox: function(){
3534			var infoMessage = $('.eut-message'),
3535			closeBtn = infoMessage.find($('.eut-close'));
3536			closeBtn.on( 'click', function() {
3537				$(this).parent().slideUp(150);
3538			});
3539		},
3540		wooProduct: function(){
3541			var $item   = $('.eut-product-item'),
3542				$addBtn = $item.find('.add_to_cart_button');
3543			$addBtn.on('click',function(){
3544				$(this).parents('.eut-product-item').addClass('eut-product-added');
3545			});
3546		},
3547		animAppear: function(){
3548			if( bodyLoader || $('body').hasClass('page-template-template-full-page') ){
3549				return;
3550			}
3551			if( isMobile.any() && !deviceAnimAppear ) {
3552				$('.eut-animated-item').css('opacity',1);
3553			} else {
3554				$('.eut-animated-item').each(function() {
3555					var $that = $(this),
3556						timeDelay = $that.attr('data-delay');
3557
3558					if( $that.parents('.eut-clipping-animation').length ) return;
3559
3560					$that.appear(function() {
3561						setTimeout(function () {
3562							$that.addClass('eut-animated');
3563						}, timeDelay);
3564					},{accX: 0, accY: -150});
3565				});
3566			}
3567		},
3568		htmlVideoPlayWhenAppear: function(){
3569			var $video = $('.eut-embed-video');
3570			$video.each(function(){
3571				var $that = $(this);
3572				$that[0].pause();
3573				$that.appear(function(){
3574					if( $that[0].autoplay ){
3575						$that[0].play();
3576					}
3577				},{accX: 0, accY: -150});
3578			});
3579		},
3580		accordionToggle: function(){
3581			$('.eut-accordion-wrapper.eut-action-toggle').on('click', '.eut-title-wrapper', function(){
3582				var $that = $(this),
3583				gototop      = $that.parents('.eut-accordion').attr('data-gototop') == 'yes' ? true : false;
3584
3585				$that
3586					.toggleClass('active')
3587					.next().slideToggle(350, function(){
3588						// Go to top
3589						if ( gototop ) {
3590							EUTHEM.pageSettings.linkGoToTop( $that.parent(), 300, 30 );
3591						}
3592					});
3593				if( $(this).parent().find('.eut-isotope').length ) {
3594					setTimeout(function(){
3595						EUTHEM.isotope.relayout();
3596					},100);
3597				}
3598			});
3599			$('.eut-accordion-wrapper.eut-action-accordion').on('click', '.eut-title-wrapper', function(){
3600				var $that = $(this),
3601				gototop      = $that.parents('.eut-accordion').attr('data-gototop') == 'yes' ? true : false;
3602
3603				$that
3604					.toggleClass('active').next().slideToggle(350)
3605					.parent().siblings().find('.eut-title-wrapper').removeClass('active')
3606					.next().slideUp(350,function(){
3607						// Go to top
3608						if ( gototop ) {
3609							EUTHEM.pageSettings.linkGoToTop( $that.parent(), 300, 30 );
3610						}
3611					});
3612				if( $(this).parent().find('.eut-isotope').length ) {
3613					setTimeout(function(){
3614						EUTHEM.isotope.relayout();
3615					},100);
3616				}
3617				// Recalculate Section Height
3618				if( $that.parents('.eut-section').hasClass('eut-percentage-height') || $that.parents('.eut-section').find('.eut-percentage-height').length )  {
3619					var $parent = $that.parents('.eut-section');
3620					setTimeout(function(){
3621						EUTHEM.sectionHeight.resetHeight( $parent[0] );
3622					},400);
3623				}
3624			});
3625		},
3626		tabs: function(){
3627			$('.eut-tab-title').on( 'click', function() {
3628				var $that = $(this),
3629					contentId = $that.data('rel'),
3630					gototop      = $that.parents('.eut-tab').attr('data-gototop') == 'yes' ? true : false;
3631				$that.parents('.eut-tab').find('.eut-tab-title').removeClass('active');
3632				$that.addClass('active');
3633				
3634				if( $that.hasClass('eut-responsive-tab-link') && $that.parents('.eut-tab').find('.eut-tabs-title').hasClass('eut-tabs-collapse') ) {
3635					$that.parents('.eut-tab').find(contentId).toggleClass('active');
3636				} else {
3637					$that.parents('.eut-tab').find('.eut-tab-content').removeClass('active');
3638					$that.parents('.eut-tab').find(contentId).addClass('active');
3639				}
3640				if( $that.parents('.eut-tab').find('.eut-tab-content').find('.eut-isotope').length ) {
3641					setTimeout(function(){
3642						EUTHEM.isotope.relayout();
3643					},100);
3644				}
3645
3646				// Recalculate Section Height
3647				if( $that.parents('.eut-section').hasClass('eut-percentage-height') || $that.parents('.eut-section').find('.eut-percentage-height').length )  {
3648					var $parent = $that.parents('.eut-section');
3649					EUTHEM.sectionHeight.resetHeight( $parent[0] );
3650				}
3651				// Go to top
3652				if ( gototop ) {
3653					EUTHEM.pageSettings.linkGoToTop( $that.parent(), 300, 30 );
3654				}
3655			});
3656		},
3657		productSocials: function(){
3658			var $socials = $('.eut-product-social'),
3659				$item    = $socials.find('li');
3660			if( !$socials.length ) return;
3661
3662			$socials.appear(function() {
3663				$item.each(function(i,n){
3664					var $this = $(this);
3665					setTimeout(function(){
3666						$this.addClass('eut-animated');
3667					},150 * i);
3668				});
3669			},{accX: 0, accY: -50});
3670		},
3671		countdown: function(){
3672			$('.eut-countdown').each(function() {
3673				var $this        = $(this),
3674					finalDate    = $this.data('countdown'),
3675					numbersSize  = $this.data('numbers-size'),
3676					textSize     = $this.data('text-size'),
3677					numbersColor = $this.data('numbers-color'),
3678					textColor    = $this.data('text-color'),
3679					countdownItems = '',
3680					text = '',
3681					countdownFormat = $this.data('countdown-format').split('|');
3682
3683				$.each( countdownFormat, function( index, value ) {
3684					switch (value) {
3685						case 'w':
3686							text = crocal_eutf_main_data.string_weeks;
3687							break;
3688						case 'D':
3689						case 'd':
3690						case 'n':
3691							text = crocal_eutf_main_data.string_days;
3692							break;
3693						case 'H':
3694							text = crocal_eutf_main_data.string_hours;
3695							break;
3696						case 'M':
3697							text = crocal_eutf_main_data.string_minutes;
3698							break;
3699						case 'S':
3700							text = crocal_eutf_main_data.string_seconds;
3701							break;
3702						default:
3703							text = '';
3704					}
3705					countdownItems += '<div class="eut-countdown-item">';
3706					countdownItems += '<div class="eut-number eut-' + numbersSize + ' eut-text-' + numbersColor + '">%' + value + '</div>';
3707					countdownItems += '<span class="eut-' + textSize + ' eut-text-' + textColor + '">
3707' + text + '</span>';
3708					countdownItems += '</div>';
3709
3710				});
3711
3712				$this.countdown(finalDate, function(event) {
3713					$this = $(this).html(event.strftime( countdownItems ));
3714				});
3715			});
3716		},
3717		hovers: function(){
3718			var hoverItem = '.eut-image-hover';
3719			if( isMobile.any() && '0' === crocal_eutf_main_data.device_hover_single_tap ) {
3720				var touchevent = 'touchend';
3721				if( $(hoverItem).parent().parent().hasClass('eut-carousel-item') ) {
3722					touchevent = 'touchstart';
3723				}
3724				$('body').on(touchevent, hoverItem, function(e) {
3725					var $item = $(this);
3726					if ( !$item.hasClass('hover') ) {
3727						$item.addClass('hover');
3728						$(hoverItem).not(this).removeClass('hover');
3729						e.preventDefault();
3730					}
3731				});
3732				$(document).on('touchstart touchend', function(e) {
3733					if ( !$(hoverItem).is(e.target) && $(hoverItem).has(e.target).length === 0 ) {
3734						$(hoverItem).removeClass('hover');
3735					}
3736				});
3737			} else {
3738				$('body').on('mouseenter mouseleave', hoverItem, function() {
3739					$(this).toggleClass('hover');
3740				});
3741			}
3742		}
3743	};
3744
3745	// # Parallax Section
3746	// ============================================================================= //
3747	EUTHEM.parallaxSection = {
3748		init : function( section ){
3749			var $section = $(section);
3750			$section.bgParallax();
3751		}
3752	};
3753
3754	// # Section Settings
3755	// ============================================================================= //
3756	EUTHEM.sectionSettings = {
3757
3758		init: function(){
3759			EUTHEM.sectionSettings.expandColumnBg();
3760
3761			if( $('#eut-sidebar').length === 0 ) return;
3762
3763			var section      = '#eut-content .eut-section',
3764				windowWidth  = $(window).width(),
3765				themeWidth   = $('#eut-theme-wrapper').width(),
3766				wrapperWidth = $('.eut-content-wrapper').width(),
3767				contentWidth = $('#eut-main-content').width(),
3768				sidebarWidth = $('#eut-sidebar').outerWidth(),
3769				space        = (themeWidth - wrapperWidth)/2,
3770				sidebarSpace = space + wrapperWidth - contentWidth;
3771
3772
3773			$(section).each(function(){
3774				var $section = $(this);
3775				if( $section.hasClass('eut-fullwidth-background') ){
3776					fullBg($section);
3777				}
3778				if( $section.hasClass('eut-fullwidth') ){
3779					fullElement($section);
3780				}
3781
3782			});
3783
3784			function fullBg( section ) {
3785				if( windowWidth + scrollBarWidth >= tabletPortrait ) {
3786					if( $('.eut-right-sidebar').length ) {
3787						section.css({ 'visibility': 'visible', 'padding-left':space, 'padding-right': sidebarSpace, 'margin-left': -space, 'margin-right': -sidebarSpace});
3788					}
3789					else {
3790						section.css({ 'visibility': 'visible', 'padding-left':sidebarSpace, 'padding-right': space, 'margin-left': -sidebarSpace, 'margin-right': -space});
3791					}
3792				} else {
3793					section.css({ 'visibility': 'visible', 'padding-left':'', 'padding-right': '', 'margin-left': '', 'margin-right': ''});
3794				}
3795
3796			}
3797
3798			function fullElement( section ) {
3799				if( windowWidth + scrollBarWidth >= tabletPortrait ) {
3800					if( $('.eut-right-sidebar').length ) {
3801						section.css({ 'visibility': 'visible', 'padding-left':0, 'padding-right': sidebarSpace, 'margin-left': -space, 'margin-right': -sidebarSpace});
3802					}
3803					else {
3804						section.css({ 'visibility': 'visible', 'padding-left':sidebarSpace, 'padding-right': 0, 'margin-left': -sidebarSpace, 'margin-right': -space});
3805					}
3806				} else {
3807					section.css({ 'visibility': 'visible', 'padding-left':'', 'padding-right': '', 'margin-left': -space, 'margin-right': -space});
3808				}
3809			}
3810		},
3811		expandColumnBg: function(){
3812			var $column = $('.eut-expand-bg');
3813			$column.each(function(){
3814				var $that = $(this),
3815					$inner = $that.children(),
3816					direction = 'left';
3817				if( $that.hasClass('eut-expand-bg-right') ) {
3818					direction = 'right';
3819				}
3820
3821				EUTHEM.sectionSettings.expandSettings( $that, $inner, direction );
3822				if( $that.hasClass('eut-clipping-animation') ) {
3823					var $innerWrapper = $that.find('.eut-clipping-content').children();
3824					EUTHEM.sectionSettings.expandSettings( $that, $innerWrapper, direction );
3825				}
3826
3827			});
3828		},
3829		expandSettings: function( $that, $element, direction ){
3830			resetExpandBg();
3831
3832			var positionL = $element.offset().left,
3833				positionR = $(window).width() - (positionL + $element.width()),
3834				windowWidth = $(window).width();
3835
3836			if ( windowWidth > tabletPortrait && windowWidth < tabletLandscape && $that.hasClass('eut-tablet-landscape-reset-expand-bg') ) {
3837				resetExpandBg();
3838			} else if ( windowWidth > mobileScreen && windowWidth < tabletPortrait && $that.hasClass('eut-tablet-portrait-reset-expand-bg') ) {
3839				resetExpandBg();
3840			} else if( windowWidth < mobileScreen && $that.hasClass('eut-mobile-reset-expand-bg') ) {
3841				resetExpandBg();
3842			} else {
3843				expandBg();
3844			}
3845
3846			function expandBg() {
3847				if( 'left' == direction ) {
3848					$element[0].style.cssText += 'padding-left: ' + positionL + 'px !important';
3849					$element[0].style.cssText += 'margin-left: -' + positionL + 'px !important';
3850					$element[0].style.cssText += 'width: auto';
3851				} else {
3852					$element[0].style.cssText += 'padding-right: ' + positionR + 'px !important';
3853					$element[0].style.cssText += 'margin-right: -' + positionR + 'px !important';
3854					$element[0].style.cssText += 'width: auto';
3855				}
3856			}
3857
3858			function resetExpandBg() {
3859				$element.css({
3860					'margin-left' : '',
3861					'margin-right' : '',
3862					'padding-left' : '',
3863					'padding-right' : '',
3864					'width': ''
3865				});
3866			}
3867
3868			$that.css('visibility','visible');
3869		}
3870	};
3871
3872	// # Isotope
3873	// ============================================================================= //
3874	EUTHEM.isotope = {
3875		init: function(){
3876			$('.eut-isotope').each(function(){
3877				var $wrapper     = $(this),
3878					$container   = $wrapper.find('.eut-isotope-container'),
3879					itemsArr     = $.makeArray( $container.find('.eut-isotope-item') ),
3880					layoutMode   = $wrapper.data('layout'),
3881					$pagination  = $wrapper.find('.eut-infinite-pagination'),
3882					displayStyle = $wrapper.data('display-style');
3883
3884				$container.imagesLoaded().always( function( instance ) {
3885
3886					EUTHEM.isotope.updateSettings( $wrapper );
3887
3888					$container.isotope({
3889						itemSelector: '.eut-isotope-item',
3890						layoutMode: layoutMode,
3891						transitionDuration: 0,
3892						masonry: {
3893							columnWidth: EUTHEM.isotope.getColumnWidth( $wrapper )
3894						}
3895					});
3896
3897					// Recalculate Section Height
3898					if( $wrapper.parents('.eut-section').hasClass('eut-percentage-height') || $wrapper.parents('.eut-section').find('.eut-percentage-height').length) {
3899						var $parent = $wrapper.parents('.eut-section');
3900						EUTHEM.sectionHeight.resetHeight( $parent[0] );
3901					}
3902
3903					$container.css('visibility','visible');
3904
3905					// Isotope Items Animation
3906					$wrapper.appear(function() {
3907						EUTHEM.isotope.itemsAnimation( itemsArr );
3908					});
3909				});
3910
3911
3912				// Filters
3913				var filterArr = [],
3914					$filters = $wrapper.find('.eut-filter'),
3915					$filter = $filters.find('li');
3916
3917				$filter.each(function(){
3918					var selector = $(this).data('filter');
3919					if( filterArr.indexOf(selector) === -1 ) {
3920						filterArr.push(selector);
3921					}
3922				});
3923
3924				$filters.on('click', 'li', function(){
3925					var selector     = $(this).data('filter'),
3926						title        = $(this).html(),
3927						$curCategory = $(this).parent().find('.eut-current-category'),
3928						gototop      = $(this).parents('.eut-filter').attr('data-gototop') == 'yes' ? true : false;
3929
3930					if( $curCategory.length > 0 ){
3931						$curCategory.find('span').html( title );
3932					}
3933
3934					$container.isotope({
3935						filter: selector
3936					});
3937
3938					// Go to top
3939					if( 'infinite-scroll' !== displayStyle && 'load-more' !== displayStyle ) {
3940						if ( gototop ) {
3941							EUTHEM.pageSettings.linkGoToTop( $(this).parent(), 300, 30 );
3942						}
3943					}
3944					$(this).addClass('selected').siblings().removeClass('selected');
3945				});
3946
3947				// Infinite Scroll
3948				if( $pagination.length ){
3949					var scrollThresh = true;
3950					if ('load-more' == displayStyle ) {
3951						scrollThresh = false;
3952					}
3953
3954					var isotopeId = '#' + $wrapper.attr('id'),
3955						path   = isotopeId + ' .eut-infinite-pagination .next',
3956						status = isotopeId + ' .eut-infinite-page-load',
3957						btn    = isotopeId + ' .eut-infinite-button';
3958
3959					$container.infiniteScroll({
3960						path: path,
3961						history: false,
3962						status: status,
3963						button: btn,
3964						scrollThreshold: scrollThresh,
3965					});
3966
3967					// append items on load
3968					$container.on( 'load.infiniteScroll', function( event, response, path ) {
3969						var items = $( response ).find( isotopeId +' .eut-isotope-item'),
3970							$filter = $( response ).find( isotopeId + ' .eut-filter ul li'),
3971							$filterList = $wrapper.find('.eut-filter ul'),
3972							activeCategory = $wrapper.find('.eut-filter .selected').data('filter');
3973
3974						if( '*' !== activeCategory ) {
3975							var $filterAll = $wrapper.find('.eut-filter ul li[data-filter="*"]');
3976							$filterAll.trigger('click');
3977						}
3978
3979						// append items after images loaded
3980						items.imagesLoaded( function() {
3981							$container.append( items );
3982							EUTHEM.isotope.itemSize( $wrapper, items );
3983							$container.isotope( 'insert', items );
3984							EUTHEM.isotope.isotopeReinitFunction( $container );
3985							$(window).trigger('eut_isotope_append_items');
3986
3987							EUTHEM.isotope.autoHeadings( $container );
3988
3989							// Equal Columns
3990							EUTHEM.isotope.equalColumns( $wrapper, items );
3991							$container.isotope( 'layout' );
3992
3993							// New Items Animation
3994							EUTHEM.isotope.itemsAnimation( items );
3995
3996							$filter.each(function(){
3997								var $that = $(this),
3998									filterClass = $that.data('filter');
3999								if( -1 === filterArr.indexOf( filterClass ) ) {
4000									filterArr.push( filterClass );
4001									$that.appendTo($filterList);
4002								}
4003							});
4004						});
4005					});
4006				}
4007
4008			});
4009		},
4010		isotopeReinitFunction: function( $container ){
4011			EUTHEM.basicElements.slider();
4012			EUTHEM.pageSettings.fitVid();
4013			EUTHEM.pageSettings.bgLoader();
4014
4015			// Recalculate Section Height
4016			if( $container.parents('.eut-section').hasClass('eut-percentage-height') || $container.parents('.eut-section').find('.eut-percentage-height').length) {
4017				var $parent = $container.parents('.eut-section');
4018				EUTHEM.sectionHeight.resetHeight( $parent[0] );
4019			}
4020		},
4021		updateSettings: function( $wrapper ){
4022			var $container = $wrapper.find('.eut-isotope-container'),
4023				itemsArr   = $.makeArray( $container.find('.eut-isotope-item') ),
4024				layoutMode = $wrapper.data('layout');
4025
4026			EUTHEM.isotope.containerSize( $wrapper );
4027			EUTHEM.isotope.itemSize( $wrapper, itemsArr );
4028			EUTHEM.isotope.autoHeadings( $container );
4029			// Equal Columns
4030			EUTHEM.isotope.equalColumns( $wrapper, itemsArr );
4031		},
4032		autoHeadings: function( $container ){
4033			var $postItem = $container.find('.eut-blog-item.eut-style-2 .eut-blog-item-inner'),
4034				$portfolioItem = $('.eut-portfolio.eut-auto-headings .eut-isotope-item-inner'),
4035				compressor = 10;
4036
4037			$postItem.each(function(){
4038				var $that = $(this),
4039					$title = $that.find('.eut-post-title');
4040				if( $that.parents('.eut-section').hasClass('eut-fullwidth')) {
4041					compressor = 20;
4042				}
4043				EUTHEM.isotope.setAutoHeadings( $that, $title, compressor );
4044			});
4045			$portfolioItem.each(function(){
4046				var $that = $(this),
4047					$title = $that.find('.eut-title');
4048				if( $that.parents('.eut-section').hasClass('eut-fullwidth')) {
4049					compressor = 20;
4050				}
4051				EUTHEM.isotope.setAutoHeadings( $that, $title, compressor );
4052			});
4053		},
4054		setAutoHeadings:function( $item, $title, compressor ){
4055			EUTHEM.isotope.resetAutoHeadings( $title );
4056			var itemW = $item.width(),
4057				initFontSize = parseInt( $title.css('font-size') ),
4058				maxFontSize = 90,
4059				newSize = (Math.max( Math.min( itemW / compressor, parseFloat(maxFontSize) ), parseFloat(initFontSize) )).toFixed(0);
4060			$title.css({
4061				'font-size' : newSize + 'px'
4062			});
4063		},
4064		resetAutoHeadings: function( $title ){
4065			$title.css({
4066				'font-size' : ''
4067			});
4068		},
4069		equalColumns: function( $wrapper, items ){
4070			if( 'fitRows' != $wrapper.data('layout') || !$wrapper.hasClass('eut-blog') || $wrapper.hasClass('eut-blog-small')  ) return;
4071			var $innerItems = $(items).find('.eut-isotope-item-inner'),
4072				maxHeight = 0;
4073			$innerItems.each(function(){
4074				var $that = $(this),
4075					itemH = $that.css('height','auto').height();
4076				if( itemH > maxHeight ) {
4077					maxHeight = itemH;
4078				}
4079			});
4080			$innerItems.css( 'height', maxHeight );
4081		},
4082		relayout: function(){
4083			$('.eut-isotope').each(function(){
4084				var $wrapper   = $(this),
4085					$container = $wrapper.find('.eut-isotope-container');
4086				EUTHEM.isotope.updateSettings( $wrapper );
4087				$container.isotope({
4088					transitionDuration: 0
4089				}).isotope( 'layout' );
4090				// Recalculate Section Height
4091				if( $wrapper.parents('.eut-section').hasClass('eut-percentage-height') || $wrapper.parents('.eut-section').find('.eut-percentage-height').length)  {
4092					var $parent = $wrapper.parents('.eut-section');
4093					EUTHEM.sectionHeight.resetHeight( $parent[0] );
4094				}
4095			});
4096		},
4097		getColumnWidth: function(  $wrapper ){
4098			var gutter     = !isNaN( $wrapper.data('gutter-size') ) ? Math.abs( $wrapper.data('gutter-size') ) 
4098: 0,
4099				columns    = EUTHEM.isotope.getColumns( $wrapper ),
4100				wrapperW   = $wrapper.innerWidth(),
4101				offset     = $wrapper.parents('.eut-section').hasClass('eut-fullwidth') ? - gutter : gutter,
4102				columnW    = (wrapperW + offset) / columns;
4103				columnW    = (columnW % 1 !== 0) ? Math.ceil(columnW) : columnW;
4104			return columnW;
4105		},
4106		itemSize: function( $wrapper, items ){
4107			var gutter = !isNaN( $wrapper.data('gutter-size') ) ? Math.abs( $wrapper.data('gutter-size') ) : 0,
4108				columns = EUTHEM.isotope.getColumns( $wrapper ),
4109				columnW = EUTHEM.isotope.getColumnWidth( $wrapper );
4110
4111			$.each( items, function(index, item){
4112				var $item = $(item),
4113					$thumb = $item.find('.eut-thumbnail');
4114				if( $item.hasClass('eut-image-landscape') ) {
4115					if ( columns != 1 && columns != 2) {
4116						$item.css({'width' : columnW * 2});
4117					} else {
4118						$item.css({'width' : columnW });
4119					}
4120					$thumb.removeAttr('style');
4121					$thumb.css('height',columnW - gutter);
4122				} else if( $item.hasClass('eut-image-portrait') ) {
4123					$item.css({'width' : columnW });
4124					$thumb.removeAttr('style');
4125					$thumb.css('height',columnW*2  - gutter);
4126				} else {
4127					$item.css({'width' : columnW });
4128				}
4129				if( $item.hasClass('eut-style-2') && $item.hasClass('eut-bg-size-double') && columns != 1 && columns != 2 ) {
4130					$item.css({'width' : columnW * 2});
4131				}
4132				$item.css({ 'padding' : gutter/2 });
4133
4134				if( $item.find('.eut-slider-element').length ) {
4135					$item.find('.eut-slider-element').trigger('refresh.owl.carousel');
4136				}
4137			});
4138		},
4139		containerSize: function( $wrapper ){
4140			var $container = $wrapper.find('.eut-isotope-container'),
4141				wrapperW   = $wrapper.innerWidth(),
4142				gutter     = !isNaN( $wrapper.data('gutter-size') ) ? Math.abs( $wrapper.data('gutter-size') ) : 0,
4143				columns    = EUTHEM.isotope.getColumns( $wrapper ),
4144				offset     = $wrapper.parents('.eut-section').hasClass('eut-fullwidth') ? - gutter : gutter,
4145				columnW    = (wrapperW + offset) / columns;
4146			columnW    = (columnW % 1 !== 0) ? Math.ceil(columnW) : columnW;
4147			var containerW = columnW * columns;
4148
4149			if ( $container.parents('.eut-section').hasClass('eut-fullwidth') ) {
4150				$container.css({ 'padding-left' : gutter/2, 'padding-right' : gutter/2, 'width' : containerW + gutter });
4151			} else {
4152				$container.css({ 'margin' : - (gutter/2), 'width' : containerW });
4153			}
4154		},
4155		getColumns: function( $wrapper ){
4156			var windowWidth = $(window).width(),
4157				columns = {
4158					largeS  : $wrapper.data('columns-large-screen'),
4159					desktop : $wrapper.data('columns'),
4160					tabletL : $wrapper.data('columns-tablet-landscape'),
4161					tabletP : $wrapper.data('columns-tablet-portrait'),
4162					mobile : $wrapper.data('columns-mobile')
4163				};
4164
4165			if ( windowWidth > largeScreen ) {
4166				columns = columns.largeS;
4167			} else if ( windowWidth > tabletLandscape && windowWidth <= largeScreen ) {
4168				columns = columns.desktop;
4169			} else if ( windowWidth > tabletPortrait && windowWidth <= tabletLandscape ) {
4170				columns = columns.tabletL;
4171			} else if ( windowWidth > mobileScreen && windowWidth <= tabletPortrait ) {
4172				columns = columns.tabletP;
4173			} else {
4174				columns = columns.mobile;
4175			}
4176
4177			return columns;
4178		},
4179		itemsAnimation: function( items ){
4180			$.each( items, function(index, item){
4181				var delay = 200 * index;
4182				setTimeout(function () {
4183					$(item).find('.eut-isotope-item-inner').addClass('eut-animated');
4184				}, delay);
4185			});
4186		}
4187	};
4188
4189	// # Scroll Direction
4190	// ============================================================================= //
4191	EUTHEM.scrollDir = {
4192		init: function(){
4193			var scroll = $(window).scrollTop();
4194			if (scroll > lastScrollTop){
4195				lastScrollTop = scroll;
4196				return { direction : 'scrollDown'  };
4197			} else {
4198				lastScrollTop = scroll;
4199				return { direction : 'scrollUp'  };
4200			}
4201
4202			lastScrollTop = scroll;
4203		}
4204	};
4205
4206	// # Full Page
4207	// ============================================================================= //
4208	EUTHEM.fullPage = {
4209		init: function(){
4210			var $fPage = $('#eut-fullpage');
4211			if( $fPage.length === 0 ) return;
4212				var $section = $fPage.find('.eut-row-section');
4213				var deviceNavigation = true;
4214				var deviceAutoScrolling = true;
4215				var scrollOverflow = true;
4216				var fitToSection = true;
4217				var speed = $fPage.data('scroll-speed');
4218				var deviceFullPageEnable = $fPage.data('device-scrolling') == 'yes' ? true : false;
4219				var lockAnchors = $fPage.data('lock-anchors') == 'yes' ? true : false;
4220				var loop = $fPage.data('scroll-loop');
4221				var loopTop = false;
4222				var loopBottom = false;
4223				if ( 'both' == loop || 'top' == loop ) {
4224					loopTop = true;
4225				}
4226				if ( 'both' == loop || 'bottom' == loop ) {
4227					loopBottom = true;
4228				}
4229
4230				if( isMobile.any() && !deviceFullPageEnable ) {
4231					deviceNavigation = false;
4232					deviceAutoScrolling = false;
4233					scrollOverflow = false;
4234					fitToSection = false;
4235					$section.find('.eut-animated-item').addClass('eut-animated');
4236				}
4237
4238				var navigationAnchorTooltips = $('[data-anchor-tooltip]').map(function(){
4239					return $(this).data('anchor-tooltip').toString();
4240				}).get();
4241
4242			$fPage.fullpage({
4243				navigation: deviceNavigation,
4244				navigationPosition: 'right',
4245				navigationTooltips: navigationAnchorTooltips,
4246				sectionSelector: $section,
4247				css3: true,
4248				scrollingSpeed: speed,
4249				autoScrolling : deviceAutoScrolling,
4250				fitToSection : fitToSection,
4251				lockAnchors : lockAnchors,
4252				loopTop : loopTop,
4253				loopBottom : loopBottom,
4254				scrollOverflow: scrollOverflow,
4255				afterLoad: function(anchorLink, index){
4256
4257					var sectionHeaderColor = $($section[index-1]).attr('data-header-color');
4258					var color = 'eut-' + sectionHeaderColor;
4259
4260					$section.find('.fp-tableCell').css('visibility','visible');
4261
4262					// Set Header Color
4263					if( !$('#eut-main-header').hasClass('eut-header-side') ) {
4264						$('#eut-main-header').removeClass('eut-light eut-dark').addClass(color);
4265					}
4266					$('#fp-nav').removeClass('eut-light eut-dark').addClass(color);
4267
4268					EUTHEM.scrollingPageAnimations.addAnim( $section, index );
4269				},
4270				afterRender: function(){
4271					var $videoBg = $('.eut-bg-video');
4272
4273					$videoBg.each(function(){
4274						var $that = $(this),
4275							$video = $that.find('video');
4276						if( $video.length ){
4277							$video[0].play();
4278						}
4279						EUTHEM.pageSettings.resizeVideoBgElement( $that );
4280					});
4281
4282				},
4283				onLeave: function(index){
4284					if( !isMobile.any() ) {
4285						EUTHEM.scrollingPageAnimations.removeAnim( $section, index, speed );
4286					}
4287				}
4288			});
4289		}
4290	};
4291
4292	// # Pilling Page
4293	// ============================================================================= //
4294	EUTHEM.pillingPage = {
4295		init: function(){
4296			var $fPage = $('#eut-pilling-page');
4297			if( $fPage.length === 0 ) return;
4298				var $section = $fPage.find('.eut-row-section');
4299				var deviceFullPageEnable = $fPage.data('device-scrolling') == 'yes' ? true : false;
4300				var lockAnchors = $fPage.data('lock-anchors') == 'yes' ? true : false;
4301				var direction = $fPage.data('scroll-direction');
4302				var loop = $fPage.data('scroll-loop');
4303				var speed = $fPage.data('scroll-speed');
4304				var loopTop = false;
4305				var loopBottom = false;
4306				if ( 'both' == loop || 'top' == loop ) {
4307					loopTop = true;
4308				}
4309				if ( 'both' == loop || 'bottom' == loop ) {
4310					loopBottom = true;
4311				}
4312
4313				if( isMobile.any() && !deviceFullPageEnable ) {
4314					$fPage.addClass('eut-disable-on-device');
4315					$section.find('.eut-animated-item').addClass('eut-animated');
4316					$section.children().wrap('<div class="pp-tableCell"></div>');
4317					$('.eut-row-section').each(function(){
4318						if ( $(this).attr('data-anchor').length ) {
4319							$(this).attr('id',  $(this).attr('data-anchor') );
4320						}
4321					});
4322					return;
4323				}
4324
4325				var navigationAnchorTooltips = $('[data-anchor-tooltip]').map(function(){
4326					return $(this).data('anchor-tooltip').toString();
4327				}).get();
4328
4329
4330				var navigationAnchors = [];
4331				if ( !lockAnchors ) {
4332					navigationAnchors  = $('[data-anchor]').map(function(){
4333						return $(this).data('anchor').toString();
4334					}).get();
4335				}
4336
4337				$('html').addClass('fp-enabled');
4338
4339			$fPage.pagepiling({
4340				sectionSelector: $section,
4341				css3: true,
4342				scrollingSpeed: speed,
4343				anchors: navigationAnchors,
4344				direction: direction,
4345				lockAnchors : lockAnchors,
4346				loopTop : loopTop,
4347				loopBottom : loopBottom,
4348				navigation: {
4349					'tooltips': navigationAnchorTooltips
4350				},
4351				afterLoad: function(anchorLink, index){
4352
4353					var sectionHeaderColor = $($section[index-1]).attr('data-header-color');
4354					var color = 'eut-' + sectionHeaderColor;
4355					var $videoBg = $('.eut-bg-video');
4356
4357					$videoBg.each(function(){
4358						var $that = $(this),
4359							$video = $that.find('video');
4360						if( $video.length ){
4361							$video[0].play();
4362						}
4363						EUTHEM.pageSettings.resizeVideoBgElement( $that );
4364					});
4365					// Set Header Color
4366					if( !$('#eut-main-header').hasClass('eut-header-side') ) {
4367						$('#eut-main-header').removeClass('eut-light eut-dark').addClass(color);
4368					}
4369					$('#pp-nav').removeClass('eut-light eut-dark').addClass(color);
4370
4371					EUTHEM.scrollingPageAnimations.addAnim( $section, index );
4372				},
4373				afterRender: function(){
4374					var sectionHeaderColor = $($section[0]).attr('data-header-color');
4375					var color = 'eut-' + sectionHeaderColor;
4376					var $videoBg = $('.eut-bg-video');
4377
4378					$videoBg.each(function(){
4379						var $that = $(this),
4380							$video = $that.find('video');
4381						$video[0].play();
4382					});
4383
4384					// Set Header Color
4385					if( !$('#eut-main-header').hasClass('eut-header-side') ) {
4386						$('#eut-main-header').removeClass('eut-light eut-dark').addClass(color);
4387					}
4388					$('#pp-nav').removeClass('eut-light eut-dark').addClass(color);
4389					EUTHEM.scrollingPageAnimations.addAnim( $section, 1 );
4390				},
4391				onLeave: function(index){
4392					EUTHEM.scrollingPageAnimations.removeAnim( $section, index, speed );
4393				}
4394			});
4395		}
4396	};
4397
4398	// # Scrolling Page Animations
4399	// ============================================================================= //
4400	EUTHEM.scrollingPageAnimations = {
4401		addAnim: function( section, index ){
4402			var $section = $(section[index-1]),
4403				$element = $section.find('.eut-animated-item'),
4404				$column = $section.find('.eut-clipping-animation');
4405
4406			$element.each(function(){
4407				var $that = $(this),
4408					delay = $that.data('delay');
4409				if( $that.parents('.eut-clipping-animation').length ) return;
4410				setTimeout(function(){
4411					$that.addClass('eut-animated');
4412				},delay);
4413			});
4414
4415			$column.each(function(){
4416				var $that = $(this),
4417					$element = $that.find('.eut-animated-item'),
4418					delay = $that.data('delay');
4419				setTimeout(function(){
4420					EUTHEM.pageSettings.clippingAnimated( $that );
4421					setTimeout(function(){
4422						$element.addClass('eut-animated');
4423					},700);
4424				},delay);
4425			});
4426		},
4427
4428
4429		removeAnim: function(section, index, speed){
4430			var $section = $(section[index-1]),
4431				$element = $section.find('.eut-animated-item');
4432			setTimeout(function(){
4433				$element.removeClass('eut-animated');
4434			},speed);
4435		}
4436	};
4437
4438	// # Section Navigation
4439	// ============================================================================= //
4440	EUTHEM.sectionNav = {
4441		init: function(){
4442
4443			var $content = $('#eut-content');
4444
4445			// Check if content has class section-nav
4446			if( !$content.hasClass('eut-section-nav') ) return;
4447
4448			var $themeWrapper = $('#eut-theme-wrapper');
4449			var $section = $('.eut-section[data-anchor]');
4450			var anchor;
4451
4452			// Create Navigation List
4453			createList();
4454
4455			var $navigation = $('#eut-section-nav');
4456			var $navItem = $('#eut-section-nav .eut-nav-item');
4457			var animate = false;
4458
4459			// On Click Navigation Item
4460			$navItem.on('click', function(event){
4461				event.preventDefault();
4462				var $that = $(this);
4463				var link = $that.attr('href');
4464				var scrollTop = Math.abs($(window).scrollTop()) / 2;
4465				var speed = scrollTop < 1000 ? 1000 : scrollTop;
4466				var $target = $('.eut-section[data-anchor=' + link + ']');
4467				var headerHeight = $('#eut-header').data('sticky') != 'none' && $('#eut-header').data('sticky') != 'scrollup' ? $('#eut-header').data('sticky-height') : 0;
4468				var targetTop = $target.offset().top - headerHeight + 1;
4469
4470				$that.addClass('active').siblings().removeClass('active');
4471
4472				// Remove Scroll Up Classes
4473				if ( $.fn.StickyHeader && $('#eut-header').data('sticky') === 'scrollup' ) {
4474					$('#eut-header').data('eut_StickyHeader').destroyScrollUp();
4475				}
4476
4477				smoothScroll( targetTop, speed );
4478
4479			});
4480
4481			updateNav();
4482			$(window).on('scroll', function(){
4483				if( !animate ){
4484					updateNav();
4485				}
4486			});
4487
4488			function createList(){
4489				$('<div id="eut-section-nav"><div class="eut-inner-nav"></div></div>').appendTo($themeWrapper);
4490				$section.each(function(){
4491					var $that = $(this);
4492					var title = $that.data('anchor-tooltip');
4493					anchor = $that.data('anchor');
4494					var $listEl = $('<a class="eut-nav-item eut-small-text" href="' + anchor + '">' + title + '</a>');
4495					if( title ) {
4496						$listEl.prependTo( $('#eut-section-nav .eut-inner-nav') );
4497					}
4498				});
4499			}
4500
4501			function updateNav(){
4502				$section.each(function(){
4503					var $that = $(this);
4504					if ( ( $that.offset().top - $(window).height()/2 < $(window).scrollTop() ) && ( $that.offset().top + $that.outerHeight() - $(window).height()/2 > $(window).scrollTop() ) ) {
4505						$navigation.find('a[href=' + $that.data('anchor') + ']').addClass('active');
4506					} else {
4507						$navigation.find('a[href=' + $that.data('anchor') + ']').removeClass('active');
4508					}
4509				});
4510			}
4511
4512			function smoothScroll(target, speed){
4513				if( !animate ) {
4514					animate = true;
4515					$('html, body').animate({scrollTop: target}, speed, 'easeInOutCubic',function(){
4516						animate = false;
4517					});
4518					$("html, body").on("scroll mousedown DOMMouseScroll mousewheel keyup", function(){
4519						$('html, body').stop();
4520						animate = false;
4521					});
4522				}
4523			}
4524		}
4525	};
4526
4527	// # Global Variables
4528	// ============================================================================= //
4529	var resizeTimeout;
4530	var bodyLoader = false;
4531	var largeScreen = 2048;
4532	var tabletLandscape = 1200;
4533	var tabletPortrait = 1023;
4534	var mobileScreen = 767;
4535	var lastScrollTop = 0;
4536	var wpBarHeight = $('.eut-body').hasClass('admin-bar') ? 32 : 0;
4537	var $videoBg = $('.eut-bg-video');
4538	var isMobile = {
4539		Android: function() {
4540			return navigator.userAgent.match(/Android/i);
4541		},
4542		BlackBerry: function() {
4543			return navigator.userAgent.match(/BlackBerry/i);
4544		},
4545		iOS: function() {
4546			return navigator.userAgent.match(/iPhone|iPad|iPod/i);
4547		},
4548		Opera: function() {
4549			return navigator.userAgent.match(/Opera Mini/i);
4550		},
4551		Windows: function() {
4552			return navigator.userAgent.match(/IEMobile/i);
4553		},
4554		any: function() {
4555			return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
4556		}
4557	};
4558
4559	var deviceAnimAppear =  false;
4560	if( 1 == crocal_eutf_main_data.device_animations ) {
4561		deviceAnimAppear =  true;
4562	}
4563
4564	var spinner = '<div class="eut-spinner"><div></div><div></div><div></div><div></div></div>';
4565
4566	var $document = $(document),
4567		$window = $(window),
4568		$body = $('body'),
4569		$stickyEl = $('.eut-sticky-element');
4570
4571	// Animation support & prefixing
4572	var t = document.body || document.documentElement;
4573	var s = t.style;
4574	var tSupport = s.transition !== undefined || s.WebkitTransition !== undefined || s.MozTransition !== undefined || s.MsTransition !== undefined || s.OTransition !== undefined;
4575	var property = [ 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ];
4576	var prefix;
4577	for( var i in property ){
4578		if( s[ property[ i ] ] !== undefined ){
4579			prefix = '-' + property[ i ].replace( 'Transform', '' ).toLowerCase();
4580		}
4581	}
4582	var transform = prefix + '-transform';
4583
4584	// # Scrollbar Width
4585	// ============================================================================= //
4586	var parent, child, scrollBarWidth;
4587
4588	if( scrollBarWidth === undefined ) {
4589		parent          = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body');
4590		child           = parent.children();
4591		scrollBarWidth  = child.innerWidth()-child.height(99).innerWidth();
4592		parent.remove();
4593	}
4594
4595	$(function() {
4596		EUTHEM.documentReady.init();
4597	});
4598
4599	$(window).on('load',function () {
4600		EUTHEM.documentLoad.init();
4601	});
4602
4603	// Resize
4604	if( !isMobile.any() ) {
4605		$(window).on('resize', resizer);
4606	} else {
4607		$(window).on('orientationchange', resizer);
4608	}
4609	function resizer(){
4610		window.clearTimeout(resizeTimeout);
4611		resizeTimeout = window.setTimeout(function () {
4612			EUTHEM.documentResize.init();
4613		}, 300);
4614	}
4615
4616})(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.