PageSourceSearch

https://www.bloo.it/wp-content/themes/zuperla/js/main.js?ver=2.3.8

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