PageSourceSearch

https://www.takwene.com/Assets/js/theme_Inner.js

js takwene.com collected 2026-09-24 19:20:47 UTC 130,194 bytes, 5,440 lines download raw bytes

1/*
2Name: 			Theme Base
3Written by: 	Okler Themes - (http://www.okler.net)
4Theme Version:	8.0.0
5*/
6
7// Theme
8window.theme = {};
9
10// Theme Common Functions
11window.theme.fn = {
12
13	getOptions: function(opts) {
14
15		if (typeof(opts) == 'object') {
16
17			return opts;
18
19		} else if (typeof(opts) == 'string') {
20
21			try {
22				return JSON.parse(opts.replace(/'/g,'"').replace(';',''));
23			} catch(e) {
24				return {};
25			}
26
27		} else {
28
29			return {};
30
31		}
32
33	}
34
35};
36
37// Animate
38(function(theme, $) {
39
40	theme = theme || {};
41
42	var instanceName = '__animate';
43
44	var PluginAnimate = function($el, opts) {
45		return this.initialize($el, opts);
46	};
47
48	PluginAnimate.defaults = {
49		accX: 0,
50		accY: -80,
51		delay: 100,
52		duration: '750ms',
53		minWindowWidth: 767
54	};
55
56	PluginAnimate.prototype = {
57		initialize: function($el, opts) {
58			if ($el.data(instanceName)) {
59				return this;
60			}
61
62			this.$el = $el;
63
64			this
65				.setData()
66				.setOptions(opts)
67				.build();
68
69			return this;
70		},
71
72		setData: function() {
73			this.$el.data(instanceName, this);
74
75			return this;
76		},
77
78		setOptions: function(opts) {
79			this.options = $.extend(true, {}, PluginAnimate.defaults, opts, {
80				wrapper: this.$el
81			});
82
83			return this;
84		},
85
86		build: function() {
87			var self = this;
88
89			if($('body').hasClass('loading-overlay-showing')) {
90				$(window).on('loading.overlay.ready', function(){
91					self.animate();
92				});
93			} else {
94				self.animate();
95			}
96
97			return this;
98		},
99
100		animate: function() {
101			var self = this,
102				$el = this.options.wrapper,
103				delay = 0,
104				duration = this.options.duration,
105				elTopDistance = $el.offset().top,
106				windowTopDistance = $(window).scrollTop();
107
108			$el.addClass('appear-animation animated');
109
110			if (!$('html').hasClass('no-csstransitions') && $(window).width() > self.options.minWindowWidth && elTopDistance >= windowTopDistance) {
111
112				$el.appear(function() {
113
114					$el.one('animation:show', function(ev) {
115						delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay);
116						duration = ($el.attr('data-appear-animation-duration') ? $el.attr('data-appear-animation-duration') : self.options.duration);
117
118						if (duration != '750ms') {
119							$el.css('animation-duration', duration);
120						}
121
122						$el.css('animation-delay', delay + 'ms');
123
124						$el.addClass($el.attr('data-appear-animation') + ' appear-animation-visible');
125					});
126
127					$el.trigger('animation:show');
128
129				}, {
130					accX: self.options.accX,
131					accY: self.options.accY
132				});
133
134			} else {
135
136				$el.addClass('appear-animation-visible');
137
138			}
139
140			return this;
141		}
142	};
143
144	// expose to scope
145	$.extend(theme, {
146		PluginAnimate: PluginAnimate
147	});
148
149	// jquery plugin
150	$.fn.themePluginAnimate = function(opts) {
151		return this.map(function() {
152			var $this = $(this);
153
154			if ($this.data(instanceName)) {
155				return $this.data(instanceName);
156			} else {
157				return new PluginAnimate($this, opts);
158			}
159
160		});
161	};
162
163}).apply(this, [window.theme, jQuery]);
164
165// Before / After
166(function(theme, $) {
167
168	theme = theme || {};
169
170	var instanceName = '__beforeafter';
171
172	var PluginBeforeAfter = function($el, opts) {
173		return this.initialize($el, opts);
174	};
175
176	PluginBeforeAfter.defaults = {
177		
178	};
179
180	PluginBeforeAfter.prototype = {
181		initialize: function($el, opts) {
182			this.$el = $el;
183
184			this
185				.setData()
186				.setOptions(opts)
187				.build();
188
189			return this;
190		},
191
192		setData: function() {
193			this.$el.data(instanceName, this);
194
195			return this;
196		},
197
198		setOptions: function(opts) {
199			this.options = $.extend(true, {}, PluginBeforeAfter.defaults, opts, {
200				wrapper: this.$el
201			});
202
203			return this;
204		},
205
206		build: function() {
207
208			if (!($.isFunction($.fn.twentytwenty))) {
209				return this;
210			}
211
212			var self = this;
213
214			self.options.wrapper
215				.twentytwenty(self.options);
216
217			return this;
218
219		}
220	};
221
222	// expose to scope
223	$.extend(theme, {
224		PluginBeforeAfter: PluginBeforeAfter
225	});
226
227	// jquery plugin
228	$.fn.themePluginBeforeAfter = function(opts) {
229		return this.map(function() {
230			var $this = $(this);
231
232			if ($this.data(instanceName)) {
233				return $this.data(instanceName);
234			} else {
235				return new PluginBeforeAfter($this, opts);
236			}
237
238		});
239	}
240
241}).apply(this, [window.theme, jQuery]);
242
243// Carousel
244(function(theme, $) {
245
246	theme = theme || {};
247
248	var instanceName = '__carousel';
249
250	var PluginCarousel = function($el, opts) {
251		return this.initialize($el, opts);
252	};
253
254	PluginCarousel.defaults = {
255		loop: true,
256		responsive: {
257			0: {
258				items: 1
259			},
260			479: {
261				items: 1
262			},
263			768: {
264				items: 2
265			},
266			979: {
267				items: 3
268			},
269			1199: {
270				items: 4
271			}
272		},
273		navText: []
274	};
275
276	PluginCarousel.prototype = {
277		initialize: function($el, opts) {
278			if ($el.data(instanceName)) {
279				return this;
280			}
281
282			this.$el = $el;
283
284			this
285				.setData()
286				.setOptions(opts)
287				.build();
288
289			return this;
290		},
291
292		setData: function() {
293			this.$el.data(instanceName, this);
294
295			return this;
296		},
297
298		setOptions: function(opts) {
299			this.options = $.extend(true, {}, PluginCarousel.defaults, opts, {
300				wrapper: this.$el
301			});
302
303			return this;
304		},
305
306		build: function() {
307			if (!($.isFunction($.fn.owlCarousel))) {
308				return this;
309			}
310
311			var self = this,
312				$el = this.options.wrapper;
313
314			// Add Theme Class
315			$el.addClass('owl-theme');
316
317			// Add Loading
318			$el.addClass('owl-loading');
319
320			// Force RTL according to HTML dir attribute
321			if ($('html').attr('dir') == 'rtl') {
322				this.options = $.extend(true, {}, this.options, {
323					rtl: true
324				});
325			}
326
327			if (this.options.items == 1) {
328				this.options.responsive = {}
329			}
330
331			if (this.options.items > 4) {
332				this.options = $.extend(true, {}, this.options, {
333					responsive: {
334						1199: {
335							items: this.options.items
336						}
337					}
338				});
339			}
340
341			// Auto Height Fixes
342			if (this.options.autoHeight) {
343				var itemsHeight = [];
344
345				$el.find('.owl-item').each(function(){
346					if( $(this).hasClass('active') ) {
347						itemsHeight.push( $(this).height() );
348					}
349				});
350
351				$(window).afterResize(function() {
352					$el.find('.owl-stage-outer').height( Math.max.apply(null, itemsHeight) );
353				});
354
355				$(window).on('load', function() {
356					$el.find('.owl-stage-outer').height( Math.max.apply(null, itemsHeight) );
357				});
358			}
359
360			// Initialize OwlCarousel
361			$el.owlCarousel(this.options).addClass('owl-carousel-init');
362
363			// Sync
364			if ($el.attr('data-sync')) {
365				$el.on('change.owl.carousel', function(event) {
366					if (event.namespace && event.property.name === 'position') {
367					    var target = event.relatedTarget.relative(event.property.value, true);
368					    $( $el.data('sync') ).owlCarousel('to', target, 300, true);				        
369				  	}
370				});
371			}
372
373			// Carousel Center Active Item
374			if( $el.hasClass('carousel-center-active-item') ) {
375				var itemsActive    = $el.find('.owl-item.active'),
376					indexCenter    = Math.floor( ($el.find('.owl-item.active').length - 1) / 2 ),
377					itemCenter     = itemsActive.eq(indexCenter);
378
379				itemCenter.addClass('current');
380
381				$el.on('change.owl.carousel', function(event) {
382				  	$el.find('.owl-item').removeClass('current');
383					
384					setTimeout(function(){
385					  	var itemsActive    = $el.find('.owl-item.active'),
386					  		indexCenter    = Math.floor( ($el.find('.owl-item.active').length - 1) / 2 ),
387					  		itemCenter     = itemsActive.eq(indexCenter);
388
389					  	itemCenter.addClass('current');
390					}, 100);
391				});
392
393				// Refresh
394				$el.trigger('refresh.owl.carousel');
395
396			}
397
398			// Remove Loading
399			$el.removeClass('owl-loading');
400
401			// Remove Height
402			$el.css('height', 'auto');
403
404			return this;
405		}
406	};
407
408	// expose to scope
409	$.extend(theme, {
410		PluginCarousel: PluginCarousel
411	});
412
413	// jquery plugin
414	$.fn.themePluginCarousel = function(opts) {
415		return this.map(function() {
416			var $this = $(this);
417
418			if ($this.data(instanceName)) {
419				return $this.data(instanceName);
420			} else {
421				return new PluginCarousel($this, opts);
422			}
423
424		});
425	}
426
427}).apply(this, [window.theme, jQuery]);
428
429// Chart Circular
430(function(theme, $) {
431
432	theme = theme || {};
433
434	var instanceName = '__chartCircular';
435
436	var PluginChartCircular = function($el, opts) {
437		return this.initialize($el, opts);
438	};
439
440	PluginChartCircular.defaults = {
441		accX: 0,
442		accY: -150,
443		delay: 1,
444		barColor: '#0088CC',
445		trackColor: '#f2f2f2',
446		scaleColor: false,
447		scaleLength: 5,
448		lineCap: 'round',
449		lineWidth: 13,
450		size: 175,
451		rotate: 0,
452		animate: ({
453			duration: 2500,
454			enabled: true
455		})
456	};
457
458	PluginChartCircular.prototype = {
459		initialize: function($el, opts) {
460			if ($el.data(instanceName)) {
461				return this;
462			}
463
464			this.$el = $el;
465
466			this
467				.setData()
468				.setOptions(opts)
469				.build();
470
471			return this;
472		},
473
474		setData: function() {
475			this.$el.data(instanceName, this);
476
477			return this;
478		},
479
480		setOptions: function(opts) {
481			this.options = $.extend(true, {}, PluginChartCircular.defaults, opts, {
482				wrapper: this.$el
483			});
484
485			return this;
486		},
487
488		build: function() {
489			if (!($.isFunction($.fn.appear)) || !($.isFunction($.fn.easyPieChart))) {
490				return this;
491			}
492
493			var self = this,
494				$el = this.options.wrapper,
495				value = ($el.attr('data-percent') ? $el.attr('data-percent') : 0),
496				percentEl = $el.find('.percent');
497
498			$.extend(true, self.options, {
499				onStep: function(from, to, currentValue) {
500					percentEl.html(parseInt(currentValue));
501				}
502			});
503
504			$el.attr('data-percent', 0);
505
506			$el.appear(function() {
507
508				$el.easyPieChart(self.options);
509
510				setTimeout(function() {
511
512					$el.data('easyPieChart').update(value);
513					$el.attr('data-percent', value);
514
515				}, self.options.delay);
516
517			}, {
518				accX: self.options.accX,
519				accY: self.options.accY
520			});
521
522			return this;
523		}
524	};
525
526	// expose to scope
527	$.extend(theme, {
528		PluginChartCircular: PluginChartCircular
529	});
530
531	// jquery plugin
532	$.fn.themePluginChartCircular = function(opts) {
533		return this.map(function() {
534			var $this = $(this);
535
536			if ($this.data(instanceName)) {
537				return $this.data(instanceName);
538			} else {
539				return new PluginChartCircular($this, opts);
540			}
541
542		});
543	}
544
545}).apply(this, [window.theme, jQuery]);
546
547// Countdown
548(function(theme, $) {
549
550	theme = theme || {};
551
552	var instanceName = '__countdown';
553
554	var PluginCountdown = function($el, opts) {
555		return this.initialize($el, opts);
556	};
557
558	PluginCountdown.defaults = {
559		date: '2030/06/10 12:00:00',
560		textDay: 'DAY',
561		textHour: 'HRS',
562		textMin: 'MIN',
563		textSec: 'SEC',
564		uppercase: true,
565		numberClass: '',
566		wrapperClass: '',
567		insertHTMLbefore: '',
568		insertHTMLafter: ''
569	};
570
571	PluginCountdown.prototype = {
572		initialize: function($el, opts) {
573			if ($el.data(instanceName)) {
574				return this;
575			}
576
577			this.$el = $el;
578
579			this
580				.setData()
581				.setOptions(opts)
582				.build();
583
584			return this;
585		},
586
587		setData: function() {
588			this.$el.data(instanceName, this);
589
590			return this;
591		},
592
593		setOptions: function(opts) {
594			this.options = $.extend(true, {}, PluginCountdown.defaults, opts, {
595				wrapper: this.$el
596			});
597
598			return this;
599		},
600
601		build: function() {
602			if (!($.isFunction($.fn.countTo))) {
603				return this;
604			}
605
606			var self = this,
607				$el = this.options.wrapper,
608				numberClass = ( self.options.numberClass ) ? ' ' + self.options.numberClass : '',
609				wrapperClass = ( self.options.wrapperClass ) ? ' ' + self.options.wrapperClass : '';
610
611			if( self.options.uppercase ) {
612				$el.countdown(self.options.date).on('update.countdown', function(event) {
613					var $this = $(this).html(event.strftime(self.options.insertHTMLbefore
614						+ '<span class="days'+ wrapperClass +'"><span class="'+ numberClass +'">%D</span> '+ self.options.textDay +'<div class="d-inline text-uppercase">%!d</div></span> '
615						+ '<span class="hours'+ wrapperClass +'"><span class="'+ numberClass +'">%H</span> '+ self.options.textHour +'</span> '
616						+ '<span class="minutes'+ wrapperClass +'"><span class="'+ numberClass +'">%M</span> '+ self.options.textMin +'</span> '
617						+ '<span class="seconds'+ wrapperClass +'"><span class="'+ numberClass +'">%S</span> '+ self.options.textSec +'</span> '
618						+ self.options.insertHTMLafter
619					));
620				});
621			} else {
622				$el.countdown(self.options.date).on('update.countdown', function(event) {
623					var $this = $(this).html(event.strftime(self.options.insertHTMLbefore
624						+ '<span class="days'+ wrapperClass +'"><span class="'+ numberClass +'">%D</span> '+ self.options.textDay +'%!d</span> '
625						+ '<span class="hours'+ wrapperClass +'"><span class="'+ numberClass +'">%H</span> '+ self.options.textHour +'</span> '
626						+ '<span class="minutes'+ wrapperClass +'"><span class="'+ numberClass +'">%M</span> '+ self.options.textMin +'</span> '
627						+ '<span class="seconds'+ wrapperClass +'"><span class="'+ numberClass +'">%S</span> '+ self.options.textSec +'</span> '
628						+ self.options.insertHTMLafter
629					));
630				});
631			}
632
633			return this;
634		}
635	};
636
637	// expose to scope
638	$.extend(theme, {
639		PluginCountdown: PluginCountdown
640	});
641
642	// jquery plugin
643	$.fn.themePluginCountdown = function(opts) {
644		return this.map(function() {
645			var $this = $(this);
646
647			if ($this.data(instanceName)) {
648				return $this.data(instanceName);
649			} else {
650				return new PluginCountdown($this, opts);
651			}
652
653		});
654	}
655
656}).apply(this, [window.theme, jQuery]);
657
658// Counter
659(function(theme, $) {
660
661	theme = theme || {};
662
663	var instanceName = '__counter';
664
665	var PluginCounter = function($el, opts) {
666		return this.initialize($el, opts);
667	};
668
669	PluginCounter.defaults = {
670		accX: 0,
671		accY: 0,
672		speed: 3000,
673		refreshInterval: 100,
674		decimals: 0,
675		onUpdate: null,
676		onComplete: null
677	};
678
679	PluginCounter.prototype = {
680		initialize: function($el, opts) {
681			if ($el.data(instanceName)) {
682				return this;
683			}
684
685			this.$el = $el;
686
687			this
688				.setData()
689				.setOptions(opts)
690				.build();
691
692			return this;
693		},
694
695		setData: function() {
696			this.$el.data(instanceName, this);
697
698			return this;
699		},
700
701		setOptions: function(opts) {
702			this.options = $.extend(true, {}, PluginCounter.defaults, opts, {
703				wrapper: this.$el
704			});
705
706			return this;
707		},
708
709		build: function() {
710			if (!($.isFunction($.fn.countTo))) {
711				return this;
712			}
713
714			var self = this,
715				$el = this.options.wrapper;
716
717			$.extend(self.options, {
718				onComplete: function() {
719					if ($el.data('append')) {
720						$el.html($el.html() + $el.data('append'));
721					}
722
723					if ($el.data('prepend')) {
724						$el.html($el.data('prepend') + $el.html());
725					}
726				}
727			});
728
729			$el.appear(function() {
730
731				$el.countTo(self.options);
732
733			}, {
734				accX: self.options.accX,
735				accY: self.options.accY
736			});
737
738			return this;
739		}
740	};
741
742	// expose to scope
743	$.extend(theme, {
744		PluginCounter: PluginCounter
745	});
746
747	// jquery plugin
748	$.fn.themePluginCounter = function(opts) {
749		return this.map(function() {
750			var $this = $(this);
751
752			if ($this.data(instanceName)) {
753				return $this.data(instanceName);
754			} else {
755				return new PluginCounter($this, opts);
756			}
757
758		});
759	}
760
761}).apply(this, [window.theme, jQuery]);
762
763// Float Element
764(function(theme, $) {
765
766	'use strict';
767
768	theme = theme || {};
769
770	var instanceName = '__floatElement';
771
772	var PluginFloatElement = function($el, opts) {
773		return this.initialize($el, opts);
774	};
775
776	PluginFloatElement.defaults = {
777		startPos: 'top',
778		speed: 3,
779		horizontal: false,
780		transition: false,
781		transitionDelay: 0,
782		transitionDuration: 500
783	};
784
785	PluginFloatElement.prototype = {
786		initialize: function($el, opts) {
787			if ($el.data(instanceName)) {
788				return this;
789			}
790
791			this.$el = $el;
792
793			this
794				.setData()
795				.setOptions(opts)
796				.build();
797
798			return this;
799		},
800
801		setData: function() {
802			this.$el.data(instanceName, this);
803
804			return this;
805		},
806
807		setOptions: function(opts) {
808			this.options = $.extend(true, {}, PluginFloatElement.defaults, opts, {
809				wrapper: this.$el
810			});
811
812			return this;
813		},
814
815		build: function() {
816			var self = this,
817				$el = this.options.wrapper,
818				$window = $(window),
819				minus;
820
821			if( self.options.style ) {
822				$el.attr('style', self.options.style);
823			}
824
825			if( $window.width() > 767 ) {
826
827				// Set Start Position
828				if( self.options.startPos == 'none' ) {
829					minus = '';
830				} else if( self.options.startPos == 'top' ) {
831					$el.css({
832						top: 0
833					});
834					minus = '';
835				} else {
836					$el.css({
837						bottom: 0
838					});
839					minus = '-';
840				}
841
842				// Set Transition
843				if( self.options.transition ) {
844					$el.css({
845						transition: 'ease-out transform '+ self.options.transitionDuration +'ms ' + self.options.transitionDelay + 'ms'
846					});
847				}
848
849				// First Load
850				self.movement(minus);	
851
852				// Scroll
853				$window.on('scroll', function(){
854					self.movement(minus);				   
855				});
856
857			}
858
859			return this;
860		},
861
862		movement: function(minus) {
863			var self = this,
864				$el = this.options.wrapper,
865				$window = $(window),
866				scrollTop = $window.scrollTop(),
867		    	elementOffset = $el.offset().top,
868		     	currentElementOffset = (elementOffset - scrollTop);
869
870		   	var scrollPercent = 100 * currentElementOffset / ($window.height());
871
872		   	if( $el.visible( true ) ) {
873
874		   		if( !self.options.horizontal ) {
875
876		   			$el.css({
877			   			transform: 'translate3d(0, '+ minus + scrollPercent / self.options.speed +'%, 0)'
878			   		});
879
880		   		} else {
881
882		   			$el.css({
883			   			transform: 'translate3d('+ minus + scrollPercent / self.options.speed +'%, '+ minus + scrollPercent / self.options.speed +'%, 0)'
884			   		});
885
886		   		}
887		   		
888		   	}
889		}
890	};
891
892	// expose to scope
893	$.extend(theme, {
894		PluginFloatElement: PluginFloatElement
895	});
896
897	// jquery plugin
898	$.fn.themePluginFloatElement = function(opts) {
899		return this.map(function() {
900			var $this = $(this);
901
902			if ($this.data(instanceName)) {
903				return $this.data(instanceName);
904			} else {
905				return new PluginFloatElement($this, opts);
906			}
907
908		});
909	}
910
911}).apply(this, [window.theme, jQuery]);
912
913// Icon
914(function(theme, $) {
915
916	'use strict';
917
918	theme = theme || {};
919
920	var instanceName = '__icon';
921
922	var PluginIcon = function($el, opts) {
923		return this.initialize($el, opts);
924	};
925
926	PluginIcon.defaults = {
927		color: '#2388ED',
928		animated: false,
929		delay: 300,
930		onlySVG: false
931	};
932
933	PluginIcon.prototype = {
934		initialize: function($el, opts) {
935			if ($el.data(instanceName)) {
936				return this;
937			}
938
939			this.$el = $el;
940
941			this
942				.setData()
943				.setOptions(opts)
944				.build();
945
946			return this;
947		},
948
949		setData: function() {
950			this.$el.data(instanceName, this);
951
952			return this;
953		},
954
955		setOptions: function(opts) {
956			this.options = $.extend(true, {}, PluginIcon.defaults, opts, {
957				wrapper: this.$el
958			});
959
960			return this;
961		},
962
963		build: function() {
964			var self  	 = this,
965				$el   	 = this.options.wrapper,
966				color 	 = self.options.color,
967				elTopDistance = $el.offset().top,
968				windowTopDistance = $(window).scrollTop(),
969				duration = ( self.options.animated && !self.options.strokeBased ) ? 200 : 100;
970
971			// Check origin
972			if( window.location.origin === 'file://' ) {
973				$el.css('opacity', 1);
974				return;
975			}
976
977			// Duration
978			if( self.options.duration ) {
979				duration = self.options.duration;
980			}
981
982			// SVG Content
983			var SVGContent = $.get({
984				url: $el.attr('src'), 
985				success: function(data, status, xhr){
986					var iconWrapper = $('<div class="animated-icon">'+ xhr.responseText +'</div>'),
987						uniqid = 'icon_' + Math.floor(Math.random() * 26) + Date.now();
988
989					iconWrapper.find('svg').attr('id', uniqid);
990
991					if( $el.attr('width') ) {
992						iconWrapper.find('svg')
993							.attr('width', $el.attr('width'))
994							.attr('height', $el.attr('width'));						
995					}
996
997					$el.replaceWith(iconWrapper);
998
999					if( self.options.extraClass ) {
1000						iconWrapper.addClass( self.options.extraClass );
1001					}
1002
1003					if( self.options.onlySVG ) {
1004						return;
1005					}
1006
1007					$el = iconWrapper;
1008
1009					var icon = new Vivus(uniqid, {start: 'manual', type: 'sync', selfDestroy: true, duration: duration, onReady: function(obj){
1010						var styleElement = document.createElementNS("http://www.w3.org/2000/svg", "style"),
1011							animateStyle = '';
1012
1013						// SVG Fill Based
1014						if( self.options.animated && !self.options.strokeBased || !self.options.animated && color && !self.options.strokeBased ) {
1015							animateStyle = 'stroke-width: 0.1px; fill-opacity: 0; transition: ease fill-opacity 300ms;';
1016							
1017							// Set Style on SVG inside object
1018							styleElement.textContent = '#' + uniqid + ' path, #' + uniqid + ' line, #' + uniqid + ' rect, #' + uniqid + ' circle, #' + uniqid + ' polyline { fill: '+ color +'; stroke: '+ color +'; '+ animateStyle + (self.options.svgStyle ? self.options.svgStyle : "") + ' } .finished path { fill-opacity: 1; }';
1019							obj.el.appendChild(styleElement);
1020						}
1021
1022						// SVG Stroke Based
1023						if( self.options.animated && self.options.strokeBased || !self.options.animated && color && self.options.strokeBased ) {
1024
1025							// Set Style on SVG inside object
1026							styleElement.textContent = '#' + uniqid + ' path, #' + uniqid + ' line, #' + uniqid + ' rect, #' + uniqid + ' circle, #' + uniqid + ' polyline { stroke: '+ color +'; ' + (self.options.svgStyle ? self.options.svgStyle : "") + '}';
1027							obj.el.appendChild(styleElement);
1028						}
1029
1030						$.event.trigger('theme.plugin.icon.svg.ready');
1031					}});
1032
1033					// Isn't animated
1034					if( !self.options.animated ) {
1035						setTimeout(function(){
1036							icon.finish();
1037						}, 10);
1038						$el.css({ opacity: 1 });
1039					}
1040
1041					// Animated
1042					if( self.options.animated && $(window).width() > 767 ) {
1043						// First Load
1044						if( $el.visible( true ) ) {
1045							self.startIconAnimation( icon, $el );
1046						} else if( elTopDistance < windowTopDistance ) {
1047							self.startIconAnimation( icon, $el );
1048						}
1049
1050						// On Scroll
1051						$(window).on('scroll', function(){
1052							if( $el.visible( true ) ) {
1053								self.startIconAnimation( icon, $el );
1054							}
1055						});
1056
1057					} else {
1058						
1059						$el.css({ opacity: 1 });
1060						icon.finish();
1061						
1062						$(window).on('theme.plugin.icon.svg.ready', function(){
1063							setTimeout(function(){
1064								icon.el.setAttribute('class', 'finished');
1065								icon.finish();
1066							}, 300);
1067						});
1068						
1069					}
1070
1071				}
1072			});
1073
1074			return this;
1075		},
1076		startIconAnimation: function(icon, $el) {
1077			var self = this;
1078
1079			// Animate for better performance
1080			$({to:0}).animate({to:1}, ((self.options.strokeBased) ? self.options.delay : self.options.delay + 300 ), function() {
1081				$el.css({ opacity: 1 });
1082			});
1083
1084			$({to:0}).animate({to:1}, self.options.delay, function() {
1085				icon.play(1);
1086
1087				setTimeout(function(){
1088					icon.el.setAttribute('class', 'finished');
1089				}, icon.duration * 5 );
1090			});
1091		}
1092	};
1093
1094	// expose to scope
1095	$.extend(theme, {
1096		PluginIcon: PluginIcon
1097	});
1098
1099	// jquery plugin
1100	$.fn.themePluginIcon = function(opts) {
1101		return this.map(function() {
1102			var $this = $(this);
1103
1104			if ($this.data(instanceName)) {
1105				return $this.data(instanceName);
1106			} else {
1107				return new PluginIcon($this, opts);
1108			}
1109
1110		});
1111	};
1112
1113}).apply(this, [window.theme, jQuery]);
1114
1115// Lazy Load
1116(function(theme, $) {
1117
1118	theme = theme || {};
1119
1120	var instanceName = '__lazyload';
1121
1122	var PluginLazyLoad = function($el, opts) {
1123		return this.initialize($el, opts);
1124	};
1125
1126	PluginLazyLoad.defaults = {
1127		effect: 'show',
1128		appearEffect: '',
1129		imgFluid: true,
1130		appear: function(elements_left, settings) {
1131			
1132		},
1133		load: function(elements_left, settings) {
1134			$(this).addClass($.trim('lazy-load-loaded ' + settings.appearEffect)).css({
1135				'animation-duration': '1s'
1136			});
1137		}
1138	};
1139
1140	PluginLazyLoad.prototype = {
1141		initialize: function($el, opts) {
1142			if ($el.data(instanceName)) {
1143				return this;
1144			}
1145
1146			this.$el = $el;
1147
1148			this
1149				.setData()
1150				.setOptions(opts)
1151				.build()
1152				.events();
1153
1154			return this;
1155		},
1156
1157		setData: function() {
1158			this.$el.data(instanceName, this);
1159
1160			return this;
1161		},
1162
1163		setOptions: function(opts) {
1164			this.options = $.extend(true, {}, PluginLazyLoad.defaults, opts, {
1165				wrapper: this.$el
1166			});
1167
1168			return this;
1169		},
1170
1171		build: function() {
1172			if (!($.isFunction($.fn.lazyload))) {
1173				return this;
1174			}
1175
1176			var self = this;
1177
1178			self.options.wrapper.lazyload(this.options);
1179
1180			return this;
1181		},
1182
1183		events: function() {
1184			var self = this;
1185
1186			if( self.options.imgFluid && self.options.wrapper.is('img') ) {
1187				self.options.wrapper.on('appear', function(){
1188					setTimeout(function(){
1189						self.options.wrapper.addClass('img-fluid');
1190					}, 500);
1191				});
1192			}
1193
1194			return this;
1195		}
1196	};
1197
1198	// expose to scope
1199	$.extend(theme, {
1200		PluginLazyLoad: PluginLazyLoad
1201	});
1202
1203	// jquery plugin
1204	$.fn.themePluginLazyLoad = function(opts) {
1205		return this.map(function() {
1206			var $this = $(this);
1207
1208			if ($this.data(instanceName)) {
1209				return $this.data(instanceName);
1210			} else {
1211				return new PluginLazyLoad($this, opts);
1212			}
1213
1214		});
1215	}
1216
1217}).apply(this, [window.theme, jQuery]);
1218
1219// Lightbox
1220(function(theme, $) {
1221
1222	theme = theme || {};
1223
1224	var instanceName = '__lightbox';
1225
1226	var PluginLightbox = function($el, opts) {
1227		return this.initialize($el, opts);
1228	};
1229
1230	PluginLightbox.defaults = {
1231		tClose: 'Close (Esc)', // Alt text on close button
1232		tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys
1233		gallery: {
1234			tPrev: 'Previous (Left arrow key)', // Alt text on left arrow
1235			tNext: 'Next (Right arrow key)', // Alt text on right arrow
1236			tCounter: '%curr% of %total%' // Markup for "1 of 7" counter
1237		},
1238		image: {
1239			tError: '<a href="%url%">The image</a> could not be loaded.' // Error message when image could not be loaded
1240		},
1241		ajax: {
1242			tError: '<a href="%url%">The content</a> could not be loaded.' // Error message when ajax request failed
1243		},
1244		callbacks: {
1245			open: function() {
1246				$('html').addClass('lightbox-opened');
1247			},
1248			close: function() {
1249				$('html').removeClass('lightbox-opened');
1250			}
1251		}
1252	};
1253
1254	PluginLightbox.prototype = {
1255		initialize: function($el, opts) {
1256			if ($el.data(instanceName)) {
1257				return this;
1258			}
1259
1260			this.$el = $el;
1261
1262			this
1263				.setData()
1264				.setOptions(opts)
1265				.build();
1266
1267			return this;
1268		},
1269
1270		setData: function() {
1271			this.$el.data(instanceName, this);
1272
1273			return this;
1274		},
1275
1276		setOptions: function(opts) {
1277			this.options = $.extend(true, {}, PluginLightbox.defaults, opts, {
1278				wrapper: this.$el
1279			});
1280
1281			return this;
1282		},
1283
1284		build: function() {
1285			if (!($.isFunction($.fn.magnificPopup))) {
1286				return this;
1287			}
1288
1289			this.options.wrapper.magnificPopup(this.options);
1290
1291			return this;
1292		}
1293	};
1294
1295	// expose to scope
1296	$.extend(theme, {
1297		PluginLightbox: PluginLightbox
1298	});
1299
1300	// jquery plugin
1301	$.fn.themePluginLightbox = function(opts) {
1302		return this.map(function() {
1303			var $this = $(this);
1304
1305			if ($this.data(instanceName)) {
1306				return $this.data(instanceName);
1307			} else {
1308				return new PluginLightbox($this, opts);
1309			}
1310
1311		});
1312	}
1313
1314}).apply(this, [window.theme, jQuery]);
1315
1316// Loading Overlay
1317(function(theme, $) {
1318
1319	'use strict';
1320
1321	theme = theme || {};
1322
1323	var loadingOverlayTemplate = [
1324		'<div class="loading-overlay">',
1325			'<div class="bounce-loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>',
1326		'</div>'
1327	].join('');
1328
1329	var LoadingOverlay = function( $wrapper, options ) {
1330		return this.initialize( $wrapper, options );
1331	};
1332
1333	LoadingOverlay.prototype = {
1334
1335		options: {
1336			css: {},
1337			hideDelay: 500
1338		},
1339
1340		initialize: function( $wrapper, options ) {
1341			this.$wrapper = $wrapper;
1342
1343			this
1344				.setVars()
1345				.setOptions( options )
1346				.build()
1347				.events();
1348
1349			this.$wrapper.data( 'loadingOverlay', this );
1350		},
1351
1352		setVars: function() {
1353			this.$overlay = this.$wrapper.find('.loading-overlay');
1354
1355			return this;
1356		},
1357
1358		setOptions: function( options ) {
1359			if ( !this.$overlay.get(0) ) {
1360				this.matchProperties();
1361			}
1362			this.options     = $.extend( true, {}, this.options, options, theme.fn.getOptions(this.$wrapper.data('plugin-options')) );
1363
1364			this.loaderClass = this.getLoaderClass( this.options.css.backgroundColor );
1365
1366			return this;
1367		},
1368
1369		build: function() {
1370			if ( !this.$overlay.closest(document.documentElement).get(0) ) {
1371				if ( !this.$cachedOverlay ) {
1372					this.$overlay = $( loadingOverlayTemplate ).clone();
1373
1374					if ( this.options.css ) {
1375						this.$overlay.css( this.options.css );
1376						this.$overlay.find( '.loader' ).addClass( this.loaderClass );
1377					}
1378				} else {
1379					this.$overlay = this.$cachedOverlay.clone();
1380				}
1381
1382				this.$wrapper.append( this.$overlay );
1383			}
1384
1385			if ( !this.$cachedOverlay ) {
1386				this.$cachedOverlay = this.$overlay.clone();
1387			}
1388
1389			return this;
1390		},
1391
1392		events: function() {
1393			var _self = this;
1394
1395			if ( this.options.startShowing ) {
1396				_self.show();
1397			}
1398
1399			if ( this.$wrapper.is('body') || this.options.hideOnWindowLoad ) {
1400				$( window ).on( 'load error', function() {
1401					_self.hide();
1402				});
1403			}
1404
1405			if ( this.options.listenOn ) {
1406				$( this.options.listenOn )
1407					.on( 'loading-overlay:show beforeSend.ic', function( e ) {
1408						e.stopPropagation();
1409						_self.show();
1410					})
1411					.on( 'loading-overlay:hide complete.ic', function( e ) {
1412						e.stopPropagation();
1413						_self.hide();
1414					});
1415			}
1416
1417			this.$wrapper
1418				.on( 'loading-overlay:show beforeSend.ic', function( e ) {
1419					if ( e.target === _self.$wrapper.get(0) ) {
1420						e.stopPropagation();
1421						_self.show();
1422						return true;
1423					}
1424					return false;
1425				})
1426				.on( 'loading-overlay:hide complete.ic', function( e ) {
1427					if ( e.target === _self.$wrapper.get(0) ) {
1428						e.stopPropagation();
1429						_self.hide();
1430						return true;
1431					}
1432					return false;
1433				});
1434
1435			return this;
1436		},
1437
1438		show: function() {
1439			this.build();
1440
1441			this.position = this.$wrapper.css( 'position' ).toLowerCase();
1442			if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) {
1443				this.$wrapper.css({
1444					position: 'relative'
1445				});
1446			}
1447			this.$wrapper.addClass( 'loading-overlay-showing' );
1448		},
1449
1450		hide: function() {
1451			var _self = this;
1452
1453			setTimeout(function() {
1454				_self.$wrapper.removeClass( 'loading-overlay-showing' );
1455				
1456				if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) {
1457					_self.$wrapper.css({ position: '' });
1458				}
1459
1460				$(window).trigger('loading.overlay.ready');
1461			}, _self.options.hideDelay);
1462		},
1463
1464		matchProperties: function() {
1465			var i,
1466				l,
1467				properties;
1468
1469			properties = [
1470				'backgroundColor',
1471				'borderRadius'
1472			];
1473
1474			l = properties.length;
1475
1476			for( i = 0; i < l; i++ ) {
1477				var obj = {};
1478				obj[ properties[ i ] ] = this.$wrapper.css( properties[ i ] );
1479
1480				$.extend( this.options.css, obj );
1481			}
1482		},
1483
1484		getLoaderClass: function( backgroundColor ) {
1485			if ( !backgroundColor || backgroundColor === 'transparent' || backgroundColor === 'inherit' ) {
1486				return 'black';
1487			}
1488
1489			var hexColor,
1490				r,
1491				g,
1492				b,
1493				yiq;
1494
1495			var colorToHex = function( color ){
1496				var hex,
1497					rgb;
1498
1499				if( color.indexOf('#') >- 1 ){
1500					hex = color.replace('#', '');
1501				} else {
1502					rgb = color.match(/\d+/g);
1503					hex = ('0' + parseInt(rgb[0], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2);
1504				}
1505
1506				if ( hex.length === 3 ) {
1507					hex = hex + hex;
1508				}
1509
1510				return hex;
1511			};
1512
1513			hexColor = colorToHex( backgroundColor );
1514
1515			r = parseInt( hexColor.substr( 0, 2), 16 );
1516			g = parseInt( hexColor.substr( 2, 2), 16 );
1517			b = parseInt( hexColor.substr( 4, 2), 16 );
1518			yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
1519
1520			return ( yiq >= 128 ) ? 'black' : 'white';
1521		}
1522
1523	};
1524
1525	// expose to scope
1526	$.extend(theme, {
1527		LoadingOverlay: LoadingOverlay
1528	});
1529
1530	// expose as a jquery plugin
1531	$.fn.loadingOverlay = function( opts ) {
1532		return this.each(function() {
1533			var $this = $( this );
1534
1535			var loadingOverlay = $this.data( 'loadingOverlay' );
1536			if ( loadingOverlay ) {
1537				return loadingOverlay;
1538			} else {
1539				var options = opts || $this.data( 'loading-overlay-options' ) || {};
1540				return new LoadingOverlay( $this, options );
1541			}
1542		});
1543	}
1544
1545	// auto init
1546	$('[data-loading-overlay]').loadingOverlay();
1547
1548}).apply(this, [window.theme, jQuery]);
1549
1550// Masonry
1551(function(theme, $) {
1552
1553	theme = theme || {};
1554
1555	var instanceName = '__masonry';
1556
1557	var PluginMasonry = function($el, opts) {
1558		return this.initialize($el, opts);
1559	};
1560
1561	PluginMasonry.defaults = {
1562
1563	};
1564
1565	PluginMasonry.prototype = {
1566		initialize: function($el, opts) {
1567			if ($el.data(instanceName)) {
1568				return this;
1569			}
1570
1571			this.$el = $el;
1572
1573			this
1574				.setData()
1575				.setOptions(opts)
1576				.build();
1577
1578			return this;
1579		},
1580
1581		setData: function() {
1582			this.$el.data(instanceName, this);
1583
1584			return this;
1585		},
1586
1587		setOptions: function(opts) {
1588			this.options = $.extend(true, {}, PluginMasonry.defaults, opts, {
1589				wrapper: this.$el
1590			});
1591
1592			return this;
1593		},
1594
1595		build: function() {
1596			if (!($.isFunction($.fn.isotope))) {
1597				return this;
1598			}
1599
1600			var self = this,
1601				$window = $(window);
1602
1603			self.$loader = false;
1604
1605			if (self.options.wrapper.parents('.masonry-loader').get(0)) {
1606				self.$loader = self.options.wrapper.parents('.masonry-loader');
1607				self.createLoader();
1608			}
1609
1610			self.options.wrapper.one('layoutComplete', function(event, laidOutItems) {
1611				self.removeLoader();
1612			});
1613
1614			self.options.wrapper.waitForImages(function() {
1615				self.options.wrapper.isotope(self.options);	
1616			});
1617
1618			// IE10/11 fix
1619			if( $('html').hasClass('ie10') || $('html').hasClass('ie11') ) {
1620				var padding = parseInt( self.options.wrapper.children().css('padding-left') ) + parseInt( self.options.wrapper.children().css('padding-right') );
1621			}
1622
1623			$(window).on('resize', function() {
1624				setTimeout(function() {
1625					self.options.wrapper.isotope('layout');
1626				}, 300);
1627			});
1628
1629			setTimeout(function() {
1630				self.removeLoader();
1631			}, 3000);
1632
1633			return this;
1634		},
1635
1636		createLoader: function() {
1637			var self = this;
1638
1639			var loaderTemplate = [
1640				'<div class="bounce-loader">',
1641					'<div class="bounce1"></div>',
1642					'<div class="bounce2"></div>',
1643					'<div class="bounce3"></div>',
1644				'</div>'
1645			].join('');
1646
1647			self.$loader.append(loaderTemplate);
1648
1649			return this;
1650		},
1651
1652		removeLoader: function() {
1653
1654			var self = this;
1655
1656			if (self.$loader) {
1657
1658				self.$loader.removeClass('masonry-loader-showing');
1659
1660				setTimeout(function() {
1661					self.$loader.addClass('masonry-loader-loaded');
1662				}, 300);
1663
1664			}
1665
1666		}
1667	};
1668
1669	// expose to scope
1670	$.extend(theme, {
1671		PluginMasonry: PluginMasonry
1672	});
1673
1674	// jquery plugin
1675	$.fn.themePluginMasonry = function(opts) {
1676		return this.map(function() {
1677			var $this = $(this);
1678
1679			if ($this.data(instanceName)) {
1680				return $this.data(instanceName);
1681			} else {
1682				return new PluginMasonry($this, opts);
1683			}
1684
1685		});
1686	}
1687
1688}).apply(this, [window.theme, jQuery]);
1689
1690// Match Height
1691(function(theme, $) {
1692
1693	theme = theme || {};
1694
1695	var instanceName = '__matchHeight';
1696
1697	var PluginMatchHeight = function($el, opts) {
1698		return this.initialize($el, opts);
1699	};
1700
1701	PluginMatchHeight.defaults = {
1702		byRow: true,
1703		property: 'height',
1704		target: null,
1705		remove: false
1706	};
1707
1708	PluginMatchHeight.prototype = {
1709		initialize: function($el, opts) {
1710			if ($el.data(instanceName)) {
1711				return this;
1712			}
1713
1714			this.$el = $el;
1715
1716			this
1717				.setData()
1718				.setOptions(opts)
1719				.build();
1720
1721			return this;
1722		},
1723
1724		setData: function() {
1725			this.$el.data(instanceName, this);
1726
1727			return this;
1728		},
1729
1730		setOptions: function(opts) {
1731			this.options = $.extend(true, {}, PluginMatchHeight.defaults, opts, {
1732				wrapper: this.$el
1733			});
1734
1735			return this;
1736		},
1737
1738		build: function() {
1739			if (!($.isFunction($.fn.matchHeight))) {
1740				return this;
1741			}
1742
1743			var self = this;
1744
1745			self.options.wrapper.matchHeight(self.options);
1746
1747			return this;
1748		}
1749
1750	};
1751
1752	// expose to scope
1753	$.extend(theme, {
1754		PluginMatchHeight: PluginMatchHeight
1755	});
1756
1757	// jquery plugin
1758	$.fn.themePluginMatchHeight = function(opts) {
1759		return this.map(function() {
1760			var $this = $(this);
1761
1762			if ($this.data(instanceName)) {
1763				return $this.data(instanceName);
1764			} else {
1765				return new PluginMatchHeight($this, opts);
1766			}
1767
1768		});
1769	}
1770
1771}).apply(this, [window.theme, jQuery]);
1772
1773// Parallax
1774(function(theme, $) {
1775
1776	theme = theme || {};
1777
1778	var instanceName = '__parallax';
1779
1780	var PluginParallax = function($el, opts) {
1781		return this.initialize($el, opts);
1782	};
1783
1784	PluginParallax.defaults = {
1785		speed: 1.5,
1786		horizontalPosition: '50%',
1787		offset: 0,
1788		parallaxHeight: '180%'
1789	};
1790
1791	PluginParallax.prototype = {
1792		initialize: function($el, opts) {
1793			if ($el.data(instanceName)) {
1794				return this;
1795			}
1796
1797			this.$el = $el;
1798
1799			this
1800				.setData()
1801				.setOptions(opts)
1802				.build();
1803
1804			return this;
1805		},
1806
1807		setData: function() {
1808			this.$el.data(instanceName, this);
1809
1810			return this;
1811		},
1812
1813		setOptions: function(opts) {
1814			this.options = $.extend(true, {}, PluginParallax.defaults, opts, {
1815				wrapper: this.$el
1816			});
1817
1818			return this;
1819		},
1820
1821		build: function() {
1822			var self = this,
1823				$window = $(window),
1824				offset,
1825				yPos,
1826				bgpos,
1827				background;
1828
1829			// Create Parallax Element
1830			background = $('<div class="parallax-background"></div>');
1831
1832			// Set Style for Parallax Element
1833			background.css({
1834				'background-image' : 'url(' + self.options.wrapper.data('image-src') + ')',
1835				'background-size' : 'cover',
1836				'position' : 'absolute',
1837				'top' : 0,
1838				'left' : 0,
1839				'width' : '100%',
1840				'height' : self.options.parallaxHeight
1841			});
1842
1843			// Add Parallax Element on DOM
1844			self.options.wrapper.prepend(background);
1845
1846			// Set Overlfow Hidden and Position Relative to Parallax Wrapper
1847			self.options.wrapper.css({
1848				'position' : 'relative',
1849				'overflow' : 'hidden'
1850			});
1851
1852			// Parallax Effect on Scroll & Resize
1853			var parallaxEffectOnScrolResize = function() {
1854				$window.on('scroll resize', function() {
1855					offset  = self.options.wrapper.offset();
1856					yPos    = -($window.scrollTop() - (offset.top - 100)) / ((self.options.speed + 2 ));
1857					plxPos  = (yPos < 0) ? Math.abs(yPos) : -Math.abs(yPos);
1858					background.css({
1859						'transform' : 'translate3d(0, '+ ( (plxPos - 50) + (self.options.offset) ) +'px, 0)',
1860						'background-position-x' : self.options.horizontalPosition
1861					});
1862				});
1863
1864				$window.trigger('scroll');
1865			}
1866
1867			if (!$.browser.mobile) {
1868				parallaxEffectOnScrolResize();
1869			} else {
1870				if( self.options.enableOnMobile == true ) {
1871					parallaxEffectOnScrolResize();
1872				} else {
1873					self.options.wrapper.addClass('parallax-disabled');
1874				}
1875			}
1876
1877			return this;
1878		}
1879	};
1880
1881	// expose to scope
1882	$.extend(theme, {
1883		PluginParallax: PluginParallax
1884	});
1885
1886	// jquery plugin
1887	$.fn.themePluginParallax = function(opts) {
1888		return this.map(function() {
1889			var $this = $(this);
1890
1891			if ($this.data(instanceName)) {
1892				return $this.data(instanceName);
1893			} else {
1894				return new PluginParallax($this, opts);
1895			}
1896
1897		});
1898	}
1899
1900}).apply(this, [window.theme, jQuery]);
1901
1902// Progress Bar
1903(function(theme, $) {
1904
1905	theme = theme || {};
1906
1907	var instanceName = '__progressBar';
1908
1909	var PluginProgressBar = function($el, opts) {
1910		return this.initialize($el, opts);
1911	};
1912
1913	PluginProgressBar.defaults = {
1914		accX: 0,
1915		accY: -50,
1916		delay: 1
1917	};
1918
1919	PluginProgressBar.prototype = {
1920		initialize: function($el, opts) {
1921			if ($el.data(instanceName)) {
1922				return this;
1923			}
1924
1925			this.$el = $el;
1926
1927			this
1928				.setData()
1929				.setOptions(opts)
1930				.build();
1931
1932			return this;
1933		},
1934
1935		setData: function() {
1936			this.$el.data(instanceName, this);
1937
1938			return this;
1939		},
1940
1941		setOptions: function(opts) {
1942			this.options = $.extend(true, {}, PluginProgressBar.defaults, opts, {
1943				wrapper: this.$el
1944			});
1945
1946			return this;
1947		},
1948
1949		build: function() {
1950			if (!($.isFunction($.fn.appear))) {
1951				return this;
1952			}
1953
1954			var self = this,
1955				$el = this.options.wrapper,
1956				delay = 1;
1957
1958			$el.appear(function() {
1959
1960				delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay);
1961
1962				$el.addClass($el.attr('data-appear-animation'));
1963
1964				setTimeout(function() {
1965
1966					$el.animate({
1967						width: $el.attr('data-appear-progress-animation')
1968					}, 1500, 'easeOutQuad', function() {
1969						$el.find('.progress-bar-tooltip').animate({
1970							opacity: 1
1971						}, 500, 'easeOutQuad');
1972					});
1973
1974				}, delay);
1975
1976			}, {
1977				accX: self.options.accX,
1978				accY: self.options.accY
1979			});
1980
1981			return this;
1982		}
1983	};
1984
1985	// expose to scope
1986	$.extend(theme, {
1987		PluginProgressBar: PluginProgressBar
1988	});
1989
1990	// jquery plugin
1991	$.fn.themePluginProgressBar = function(opts) {
1992		return this.map(function() {
1993			var $this = $(this);
1994
1995			if ($this.data(instanceName)) {
1996				return $this.data(instanceName);
1997			} else {
1998				return new PluginProgressBar($this, opts);
1999			}
2000
2001		});
2002	}
2003
2004}).apply(this, [window.theme, jQuery]);
2005
2006// Revolution Slider
2007(function(theme, $) {
2008
2009	theme = theme || {};
2010
2011	var instanceName = '__revolution';
2012
2013	var PluginRevolutionSlider = function($el, opts) {
2014		return this.initialize($el, opts);
2015	};
2016
2017	PluginRevolutionSlider.defaults = {
2018		sliderType: 'standard',
2019		sliderLayout: 'fullwidth',
2020		delay: 9000,
2021		gridwidth: 1170,
2022		gridheight: 500,
2023		spinner: 'spinner3',
2024		disableProgressBar: 'on',
2025		parallax: {
2026			type: 'off',
2027			bgparallax: 'off'
2028		},
2029		navigation: {
2030			keyboardNavigation: 'off',
2031			keyboard_direction: 'horizontal',
2032			mouseScrollNavigation: 'off',
2033			onHoverStop: 'off',
2034			touch: {
2035				touchenabled: 'on',
2036				swipe_threshold: 75,
2037				swipe_min_touches: 1,
2038				swipe_direction: 'horizontal',
2039				drag_block_vertical: false
2040			},
2041			arrows: {
2042				enable: true,
2043				hide_onmobile: false,
2044				hide_under: 0,
2045				hide_onleave: true,
2046				hide_delay: 200,
2047				hide_delay_mobile: 1200,
2048				left: {
2049					h_align: 'left',
2050					v_align: 'center',
2051					h_offset: 30,
2052					v_offset: 0
2053				},
2054				right: {
2055					h_align: 'right',
2056					v_align: 'center',
2057					h_offset: 30,
2058					v_offset: 0
2059				}
2060			}
2061		},
2062
2063		/* ADDONS */
2064	    addOnTypewriter: {
2065			enable: false
2066		},
2067		addOnWhiteboard: {
2068			enable: false,
2069
2070		},
2071	    whiteboard: {
2072	        movehand: {
2073	            src: '../vendor/rs-plugin/revolution-addons/whiteboard/assets/images/hand_point_right.png',
2074	            width: 400,
2075	            height: 1000,
2076	            handtype: 'right',
2077	            transform: {
2078	                transformX: 50,
2079	                transformY: 50
2080	            },
2081	            jittering: {
2082	                distance: '80',
2083	                distance_horizontal: '100',
2084	                repeat: '5',
2085	                offset: '10',
2086	                offset_horizontal: '0'
2087	            },
2088	            rotation: {
2089	                angle: '10',
2090	                repeat: '3'
2091	            }
2092	        },
2093	        writehand: {
2094	            src: '../vendor/rs-plugin/revolution-addons/whiteboard/assets/images/write_right_angle.png',
2095	            width: 572,
2096	            height: 691,
2097	            handtype: 'right',
2098	            transform: {
2099	                transformX: 50,
2100	                transformY: 50
2101	            },
2102	            jittering: {
2103	                distance: '80',
2104	                distance_horizontal: '100',
2105	                repeat: '5',
2106	                offset: '10',
2107	                offset_horizontal: '0'
2108	            },
2109	            rotation:{
2110	                angle: '10',
2111	                repeat: '3'
2112	            }
2113	        }
2114	    },
2115	    addOnParticles: {
2116	    	enable: false
2117	    },
2118	    particles: {
2119			startSlide: "first", 
2120			endSlide: "last", 
2121			zIndex: "1",
2122			particles: {
2123				number: {value: 80}, color: {value: "#ffffff"},
2124				shape: {
2125					type: "circle", stroke: {width: 0, color: "#ffffff", opacity: 1},
2126					image: {src: ""}
2127				},
2128				opacity: {value: 0.5, random: true, min: 0.25, anim: {enable: false, speed: 3, opacity_min: 0, sync: false}},
2129				size: {value: 2, random: false, min: 30, anim: {enable: false, speed: 40, size_min: 1, sync: false}},
2130				line_linked: {enable: true, distance: 150, color: "#ffffff", opacity: 0.4, width: 1},
2131				move: {enable: true, speed: 6, direction: "none", random: true, min_speed: 6, straight: false, out_mode: "out"}
2132			},
2133			interactivity: {
2134				events: {onhover: {enable: false, mode: "repulse"}, onclick: {enable: false, mode: "repulse"}},
2135				modes: {grab: {distance: 400, line_linked: {opacity: 0.5}}, bubble: {distance: 400, size: 40, opacity: 0.4}, repulse: {distance: 200}}
2136			}
2137		},
2138		addOnCountdown: {
2139			enable: false,
2140			targetdate: new Date().getTime() + 864000000, // http://www.freeformatter.com/epoch-timestamp-to-date-converter.html
2141			slidechanges: [{days: 0, hours: 0, minutes: 0, seconds: 0, slide: 2}]
2142		},
2143		addOnSlicey: {
2144			enable: false
2145		},
2146		addOnFilmstrip: {
2147			enable: false
2148		},
2149		addOnBeforeAfter : {
2150			enable: false,
2151			options: {
2152				cursor: "move",
2153			    carousel: false,
2154			    arrowStyles: {
2155			        leftIcon: "fa-icon-caret-left",
2156			        rightIcon: "fa-icon-caret-right",
2157			        topIcon: "fa-icon-caret-up",
2158			        bottomIcon: "fa-icon-caret-down",
2159			        size: "35",
2160			        color: "#ffffff",
2161			        spacing: "10",
2162			        bgColor: "transparent",
2163			        padding: "0",
2164			        borderRadius: "0"
2165			    },
2166			    dividerStyles: {
2167			        width: "1",
2168			        color: "rgba(255, 255, 255, 0.5)"
2169			    }
2170			}
2171		},
2172		addOnPanorama: {
2173			enable: false
2174		},
2175		addOnRevealer: {
2176			enable: false,
2177		},
2178		revealer: {
2179			direction: "open_horizontal",
2180			color: "#ffffff",
2181			duration: "1500",
2182			delay: "0",
2183			easing: "Power2.easeInOut",
2184			overlay_enabled: true,
2185			overlay_color: "#000000",
2186			overlay_duration: "1500",
2187			overlay_delay: "0",
2188			overlay_easing: "Power2.easeInOut",
2189			spinner: "1",
2190			spinnerColor: "#006dd2",
2191			spinnerHtml: "<div class='rsaddon-revealer-spinner rsaddon-revealer-spinner-1'><div class='rsaddon-revealer-1'><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><\/div><\/div \/>"
2192		},
2193		addOnDuotone: {
2194			enable: false
2195		},
2196		addOnBubblemorph: {
2197			enable: false
2198		},
2199		addOnDistortion: {
2200			enable: false
2201		}
2202		
2203	};
2204
2205	PluginRevolutionSlider.prototype = {
2206		initialize: function($el, opts) {
2207			if ($el.data(instanceName)) {
2208				return this;
2209			}
2210
2211			this.$el = $el;
2212
2213			this
2214				.setData()
2215				.setOptions(opts)
2216				.build()
2217				.events();
2218
2219			return this;
2220		},
2221
2222		setData: function() {
2223			this.$el.data(instanceName, this);
2224
2225			return this;
2226		},
2227
2228		setOptions: function(opts) {
2229			this.options = $.extend(true, {}, PluginRevolutionSlider.defaults, opts, {
2230				wrapper: this.$el
2231			});
2232
2233			return this;
2234		},
2235
2236		build: function() {
2237			if (!($.isFunction($.fn.revolution))) {
2238				return this;
2239			}
2240
2241			// Single Slider Class
2242			if(this.options.wrapper.find('> ul > li').length == 1) {
2243				this.options.wrapper.addClass('slider-single-slide');
2244
2245				// Remove Bullets
2246				// this.options.navigation.bullets.enable = false;
2247				$.extend(this.options.navigation, {
2248					bullets: {
2249						enable: false
2250					}
2251				});
2252
2253			}
2254
2255			// Full Screen Class
2256			if(this.options.sliderLayout == 'fullscreen') {
2257				this.options.wrapper.closest('.slider-container').addClass('fullscreen-slider');
2258			}
2259			
2260			// Initialize Revolution Slider
2261			this.options.wrapper.revolution(this.options);
2262
2263			// Addon Init - Typewriter
2264			if(this.options.addOnTypewriter.enable) {
2265				RsTypewriterAddOn($, this.options.wrapper);
2266			}
2267
2268			// Addon Init - Whiteboard
2269			if(this.options.addOnWhiteboard.enable) {
2270				this.options.wrapper.rsWhiteBoard();
2271			}
2272
2273			// Addon Init - Particles
2274			if(this.options.addOnParticles.enable) {
2275				RsParticlesAddOn(this.options.wrapper);
2276			}
2277
2278			// Addon Init - Countdown
2279			if(this.options.addOnCountdown.enable) {
2280				tp_countdown(this.options.wrapper, this.options.addOnCountdown.targetdate, this.options.addOnCountdown.slidechanges);
2281			}
2282
2283			// Addon Init - Slicey
2284			if(this.options.addOnSlicey.enable) {
2285				this.options.wrapper.revSliderSlicey();
2286			}
2287
2288			// Addon Init - Filmstrip
2289			if(this.options.addOnFilmstrip.enable) {
2290				RsFilmstripAddOn($, this.options.wrapper, '../vendor/rs-plugin/revolution-addons/filmstrip/', false);
2291			}
2292
2293			// Addon Init - Before After
2294			if(this.options.addOnBeforeAfter.enable) {
2295				RevSliderBeforeAfter($, this.options.wrapper, this.options.addOnBeforeAfter.options);
2296			}
2297
2298			// Addon Init - Panorama
2299			if(this.options.addOnPanorama.enable) {
2300				RsAddonPanorama($, this.options.wrapper);
2301			}
2302
2303			// Addon Init - Revealer
2304			if(this.options.addOnRevealer.enable) {
2305				RsRevealerAddOn($, this.options.wrapper, this.options.revealer.spinnerHtml);
2306			}
2307
2308			// Addon Init - Duotone
2309			if(this.options.addOnDuotone.enable) {
2310				RsAddonDuotone($, this.options.wrapper, true, "cubic-bezier(0.645, 0.045, 0.355, 1.000)", "1000");
2311			}
2312
2313			// Addon Init - Bubblemorph
2314			if(this.options.addOnBubblemorph.enable) {
2315				BubbleMorphAddOn($, this.options.wrapper, false);
2316			}
2317
2318			// Addon Init - Distortion
2319			if(this.options.addOnDistortion.enable) {
2320				RsLiquideffectAddOn($, this.options.wrapper);
2321			}
2322
2323			return this;
2324		},
2325
2326		events: function() {
2327
2328			return this;
2329		}
2330	};
2331
2332	// expose to scope
2333	$.extend(theme, {
2334		PluginRevolutionSlider: PluginRevolutionSlider
2335	});
2336
2337	// jquery plugin
2338	$.fn.themePluginRevolutionSlider = function(opts) {
2339		return this.map(function() {
2340			var $this = $(this);
2341
2342			if ($this.data(instanceName)) {
2343				return $this.data(instanceName);
2344			} else {
2345				return new PluginRevolutionSlider($this, opts);
2346			}
2347
2348		});
2349	}
2350
2351}).apply(this, [window.theme, jQuery]);
2352
2353// Scroll to Top
2354(function(theme, $) {
2355
2356	theme = theme || {};
2357
2358	$.extend(theme, {
2359
2360		PluginScrollToTop: {
2361
2362			defaults: {
2363				wrapper: $('body'),
2364				offset: 150,
2365				buttonClass: 'scroll-to-top',
2366				iconClass: 'fas fa-chevron-up',
2367				delay: 1000,
2368				visibleMobile: false,
2369				label: false,
2370				easing: 'easeOutBack'
2371			},
2372
2373			initialize: function(opts) {
2374				initialized = true;
2375
2376				// Don't initialize if the page has Section Scroll
2377				if( $('body[data-plugin-section-scroll]').get(0) ) {
2378					return;
2379				}
2380
2381				this
2382					.setOptions(opts)
2383					.build()
2384					.events();
2385
2386				return this;
2387			},
2388
2389			setOptions: function(opts) {
2390				this.options = $.extend(true, {}, this.defaults, opts);
2391
2392				return this;
2393			},
2394
2395			build: function() {
2396				var self = this,
2397					$el;
2398
2399				// Base HTML Markup
2400				$el = $('<a />')
2401					.addClass(self.options.buttonClass)
2402					.attr({
2403						'href': '#',
2404					})
2405					.append(
2406						$('<i />')
2407						.addClass(self.options.iconClass)
2408				);
2409
2410				// Visible Mobile
2411				if (!self.options.visibleMobile) {
2412					$el.addClass('hidden-mobile');
2413				}
2414
2415				// Label
2416				if (self.options.label) {
2417					$el.append(
2418						$('<span />').html(self.options.label)
2419					);
2420				}
2421
2422				this.options.wrapper.append($el);
2423
2424				this.$el = $el;
2425
2426				return this;
2427			},
2428
2429			events: function() {
2430				var self = this,
2431					_isScrolling = false;
2432
2433				// Click Element Action
2434				self.$el.on('click', function(e) {
2435					e.preventDefault();
2436					$('body, html').animate({
2437						scrollTop: 0
2438					}, self.options.delay, self.options.easing);
2439					return false;
2440				});
2441
2442				// Show/Hide Button on Window Scroll event.
2443				$(window).scroll(function() {
2444
2445					if (!_isScrolling) {
2446
2447						_isScrolling = true;
2448
2449						if ($(window).scrollTop() > self.options.offset) {
2450
2451							self.$el.stop(true, true).addClass('visible');
2452							_isScrolling = false;
2453
2454						} else {
2455
2456							self.$el.stop(true, true).removeClass('visible');
2457							_isScrolling = false;
2458
2459						}
2460
2461					}
2462
2463				});
2464
2465				return this;
2466			}
2467
2468		}
2469
2470	});
2471
2472}).apply(this, [window.theme, jQuery]);
2473
2474// Scrollable
2475(function(theme, $) {
2476
2477	theme = theme || {};
2478
2479	var instanceName = '__scrollable';
2480
2481	var PluginScrollable = function($el, opts) {
2482		return this.initialize($el, opts);
2483	};
2484
2485	PluginScrollable.updateModals = function() {
2486		PluginScrollable.updateBootstrapModal();
2487	};
2488
2489	PluginScrollable.updateBootstrapModal = function() {
2490		var updateBoostrapModal;
2491
2492		updateBoostrapModal = typeof $.fn.modal !== 'undefined';
2493		updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor !== 'undefined';
2494		updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor.prototype !== 'undefined';
2495		updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor.prototype.enforceFocus !== 'undefined';
2496
2497		if ( !updateBoostrapModal ) {
2498			return false;
2499		}
2500
2501		var originalFocus = $.fn.modal.Constructor.prototype.enforceFocus;
2502		$.fn.modal.Constructor.prototype.enforceFocus = function() {
2503			originalFocus.apply( this );
2504
2505			var $scrollable = this.$element.find('.scrollable');
2506			if ( $scrollable ) {
2507				if ( $.isFunction($.fn['themePluginScrollable'])  ) {
2508					$scrollable.themePluginScrollable();
2509				}
2510
2511				if ( $.isFunction($.fn['nanoScroller']) ) {
2512					$scrollable.nanoScroller();
2513				}
2514			}
2515		};
2516	};
2517
2518	PluginScrollable.defaults = {
2519		contentClass: 'scrollable-content',
2520		paneClass: 'scrollable-pane',
2521		sliderClass: 'scrollable-slider',
2522		alwaysVisible: true,
2523		preventPageScrolling: true
2524	};
2525
2526	PluginScrollable.prototype = {
2527		initialize: function($el, opts) {
2528			if ( $el.data( instanceName ) ) {
2529				return this;
2530			}
2531
2532			this.$el = $el;
2533
2534			this
2535				.setData()
2536				.setOptions(opts)
2537				.build();
2538
2539			return this;
2540		},
2541
2542		setData: function() {
2543			this.$el.data(instanceName, this);
2544
2545			return this;
2546		},
2547
2548		setOptions: function(opts) {
2549			this.options = $.extend(true, {}, PluginScrollable.defaults, opts, {
2550				wrapper: this.$el
2551			});
2552
2553			return this;
2554		},
2555
2556		build: function() {
2557			this.options.wrapper.nanoScroller(this.options);
2558
2559			return this;
2560		}
2561	};
2562
2563	// expose to scope
2564	$.extend(theme, {
2565		PluginScrollable: PluginScrollable
2566	});
2567
2568	// jquery plugin
2569	$.fn.themePluginScrollable = function(opts) {
2570		return this.each(function() {
2571			var $this = $(this);
2572
2573			if ($this.data(instanceName)) {
2574				return $this.data(instanceName);
2575			} else {
2576				return new PluginScrollable($this, opts);
2577			}
2578
2579		});
2580	};
2581
2582	$(function() {
2583		PluginScrollable.updateModals();
2584	});
2585
2586}).apply(this, [window.theme, jQuery]);
2587
2588// Section Scroll
2589(function(theme, $) {
2590
2591	theme = theme || {};
2592
2593	var instanceName = '__sectionScroll';
2594
2595	var PluginSectionScroll = function($el, opts) {
2596		return this.initialize($el, opts);
2597	};
2598
2599	PluginSectionScroll.defaults = {
2600		targetClass: '.section',
2601		dotsNav: true,
2602		changeHeaderLogo: true,
2603		headerLogoDark: 'img/logo-default-slim.png',
2604		headerLogoLight: 'img/logo-default-slim-dark.png'
2605	};
2606
2607	PluginSectionScroll.prototype = {
2608		initialize: function($el, opts) {
2609			if ($el.data(instanceName)) {
2610				return this;
2611			}
2612
2613			this.$el = $el;
2614
2615			this
2616				.setData()
2617				.setOptions(opts)
2618				.build()
2619				.events();
2620
2621			return this;
2622		},
2623
2624		setData: function() {
2625			this.$el.data(instanceName, this);
2626
2627			return this;
2628		},
2629
2630		setOptions: function(opts) {
2631			this.options = $.extend(true, {}, PluginSectionScroll.defaults, opts, {
2632				wrapper: this.$el
2633			});
2634
2635			return this;
2636		},
2637
2638		build: function() {
2639			var self = this,
2640				$el = this.options.wrapper;
2641
2642			// Check type of header and change the target for header (by change header color purpose)
2643			if( $('html').hasClass('side-header-overlay-full-screen') ) {
2644				self.$header = $('.sticky-wrapper');
2645			} else {
2646				self.$header = $('#header');
2647			}
2648
2649			// Turn the section full height or not depeding on the content size
2650			self.updateSectionsHeight();
2651
2652			// Wrap all sections in a section wrapper
2653			$( this.options.targetClass ).wrap('<div class="section-wrapper"></div>');
2654
2655			// Set the section wrapper height
2656	  		$('.section-wrapper').each(function(){
2657	  			$(this).height( $(this).find('.section-scroll').outerHeight() );
2658	  		});
2659
2660	  		// Add active class to the first section on page load
2661	  		$('.section-wrapper').first().addClass('active');
2662			
2663	        var	flag = false,
2664	            scrollableFlag = false,
2665	        	touchDirection = '',
2666	        	touchstartY = 0,
2667	        	touchendY = 0;
2668
2669	        $(window).on('touchstart', function(event) {
2670			    touchstartY = event.changedTouches[0].screenY;
2671			});
2672
2673	        var wheelEvent = 'onwheel' in document ? 'wheel' : document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll';
2674	        if( $(window).width() < 992 && $('html').hasClass('touch') ) {
2675	        	wheelEvent = 'onwheel' in document ? 'wheel touchend' : document.onmousewheel !== undefined ? 'mousewheel touchend' : 'DOMMouseScroll touchend';
2676	        }
2677
2678	        $(window).on(wheelEvent, function(e){
2679	        	if( $(window).width() < 992 && $('html').hasClass('touch') ) {
2680		        	if( $(e.target).closest('.section-scroll-dots-navigation').get(0) || $(e.target).closest('.header-body').get(0) || $(e.target).closest('.owl-carousel').get(0) ) {
2681		        		return;
2682		        	}
2683		        }
2684
2685		        // Side Header Overlay Full Screen
2686		        if( $('html.side-header-overlay-full-screen.side-header-hide').get(0) ) {
2687		        	return;
2688		        }
2689
2690	        	var wheelDirection = e.originalEvent.wheelDelta == undefined ? e.originalEvent.deltaY > 0 : e.originalEvent.wheelDelta < 0;
2691	        	if( $(window).width() < 992 && $('html').hasClass('touch') ) {
2692		        	touchendY = event.changedTouches[0].screenY;
2693	        		
2694				    if( touchendY <= touchstartY ) {
2695				    	touchDirection = 'up';
2696				    }
2697
2698				    if( touchendY >= touchstartY ) {
2699				    	touchDirection = 'down';
2700				    }
2701
2702				    if( touchendY == touchstartY ) {
2703				    	return;
2704				    }
2705	        	}
2706
2707	        	var $currentSection = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll'),
2708            		$nextSection = self.getNextSection(wheelDirection, touchDirection),
2709            		nextSectionOffsetTop;
2710
2711            	// If is the last section, then change the offsetTop value
2712            	if( self.getCurrentIndex() == $('.section-wrapper').length - 1 ) {
2713            		nextSectionOffsetTop = $(document).height();
2714            	} else {
2715            		nextSectionOffsetTop = $nextSection.offset().top;
2716            	}
2717
2718			    if( $(window).width() < 992 && $('html').hasClass('touch') ) {
2719				    setTimeout(function(){
2720					    if( $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').hasClass('section-scroll-scrollable') ) {
2721					    	$('html').removeClass('overflow-hidden');
2722					    } else {
2723					    	$('html').addClass('overflow-hidden');
2724					    }
2725				    }, 1200);
2726				}
2727
2728	        	// For non full height sections
2729	        	if( $currentSection.hasClass('section-scroll-scrollable') ) {
2730	        		if( !flag && !scrollableFlag ) {
2731
2732		        		// Scroll Direction
2733		        		if(wheelDirection || touchDirection == 'up') {
2734		        			if( ( $(window).scrollTop() + $(window).height() ) >= nextSectionOffsetTop ) {
2735		        				flag = true;
2736								setTimeout(function(){
2737									$(window).trigger('section.scroll.change.header.color');
2738
2739					            	setTimeout(function(){
2740										flag = false;
2741									}, 500);
2742								}, 1000);
2743
2744		        				if( self.getCurrentIndex() == ( $('.section-wrapper').length - 1 )  ) {
2745						    		return false;
2746						    	}
2747
2748		        				// Move to the next section
2749		        				self.moveTo( $currentSection.offset().top + $currentSection.outerHeight() );
2750
2751		        				// Change Section Active Class
2752					   			self.changeSectionActiveState( $nextSection );
2753
2754					   			self.$header.css({
2755							    	opacity: 0,
2756							    	transition: 'ease opacity 500ms'
2757							    });
2758					        }
2759
2760			        		if( !$('html').hasClass('touch') ) {
2761				        		for( var i = 1; i < 100; i++ ) {
2762					        		$('body, html').scrollTop( $(window).scrollTop() + 1 );
2763
2764					        		if( ( $(window).scrollTop() + $(window).height() ) >= nextSectionOffsetTop ) {
2765					        			scrollableFlag = true;
2766										setTimeout(function(){
2767											$(window).trigger('section.scroll.change.header.color');
2768							            	scrollableFlag = false;
2769										}, 500);
2770					        			break;
2771					        		}
2772				        		}
2773				        	}
2774					    } else {
2775					    	if( $(window).scrollTop() <= $currentSection.offset().top ) {
2776					    		flag = true;
2777								setTimeout(function(){
2778									$(window).trigger('section.scroll.change.header.color');
2779
2780					            	setTimeout(function(){
2781										flag = false;
2782									}, 500);
2783								}, 1000);
2784
2785					    		if( self.getCurrentIndex() == 0  ) {
2786						    		return false;
2787						    	}
2788
2789					   			// Move to the next section
2790		        				self.moveTo( $currentSection.offset().top - $(window).height() );
2791
2792		        				// Change Section Active Class
2793					   			self.changeSectionActiveState( $nextSection );
2794
2795					   			self.$header.css({
2796							    	opacity: 0,
2797							    	transition: 'ease opacity 500ms'
2798							    });
2799					        }
2800
2801					    	if( !$('html').hasClass('touch') ) {
2802				        		for( var i = 1; i < 100; i++ ) {
2803					        		$('body, html').scrollTop( $(window).scrollTop() - 1 );
2804
2805					        		if( $(window).scrollTop() <= $currentSection.offset().top ) {
2806					        			scrollableFlag = true;
2807										setTimeout(function(){
2808											$(window).trigger('section.scroll.change.header.color');
2809							            	scrollableFlag = false;
2810										}, 500);
2811					        			break;
2812					        		}
2813				        		}
2814				        	}
2815					    }
2816
2817			   			// Change Dots Active Class
2818				        self.changeDotsActiveState();
2819
2820		        		return;
2821
2822		        	}
2823	        	}
2824
2825	        	// For full height sections
2826	        	if( !flag && !scrollableFlag ) {
2827				    if(wheelDirection || touchDirection == 'up') {
2828				    	if( self.getCurrentIndex() == ( $('.section-wrapper').length - 1 )  ) {
2829				    		return false;
2830				    	}
2831
2832				   		// Change Section Active Class
2833			   			self.changeSectionActiveState( $nextSection );
2834
2835				   		setTimeout(function(){
2836				   			// Move to the next section
2837	        				self.moveTo( $nextSection.offset().top );
2838
2839				   		}, 150);
2840				    } else {
2841				    	if( self.getCurrentIndex() == 0  ) {
2842				    		return false;
2843				    	}
2844
2845				   		// Change Section Active Class
2846			   			self.changeSectionActiveState( $nextSection );
2847
2848				   		if( $nextSection.height() > $(window).height() ) {
2849				   			// Move to the next section
2850	        				self.moveTo( $currentSection.offset().top - $(window).height() );
2851				   		} else {
2852					        setTimeout(function(){
2853					   			// Move to the next section
2854		        				self.moveTo( $nextSection.offset().top );
2855
2856					   		}, 150);
2857				   		}
2858				    }
2859
2860				    // Change Dots Active Class
2861			        self.changeDotsActiveState();
2862
2863				    self.$header.css({
2864				    	opacity: 0,
2865				    	transition: 'ease opacity 500ms'
2866				    });
2867
2868				    // Style next section
2869	            	$nextSection.css({
2870	            		position: 'relative',
2871	            		opacity: 1,
2872	            		'z-index': 1,
2873	            		transform: 'translate3d(0,0,0) scale(1)'
2874	            	});
2875
2876	            	// Style previous section
2877	            	$currentSection.css({
2878	            		position: 'fixed',
2879	            		width: '100%',
2880	            		top: 0,
2881	            		left: 0,
2882	            		opacity: 0,
2883	            		'z-index': 0,
2884	            		transform: 'translate3d(0,0,-10px) scale(0.7)',
2885	            		transition: 'ease transform 600ms, ease opacity 600ms',
2886	            	});
2887
2888					setTimeout(function(){
2889						$currentSection.css({
2890		            		position: 'relative',
2891		            		opacity: 1,
2892		            		transform: 'translate3d(0,0,-10px) scale(1)'
2893		            	});
2894
2895						$(window).trigger('section.scroll.change.header.color');
2896
2897		            	setTimeout(function(){
2898							flag = false;
2899						}, 500);
2900					}, 1000);
2901
2902					flag = true;
2903
2904				}
2905
2906				return;
2907	        });
2908
2909	        // Dots Navigation
2910	        if( this.options.dotsNav ) {
2911	        	self.dotsNavigation();
2912	        }
2913
2914	        // First Load
2915	        setTimeout(function(){
2916		        if( $(window.location.hash).get(0) ) {
2917		        	self.moveTo( $(window.location.hash).parent().offset().top );
2918
2919		        	self.changeSectionActiveState( $(window.location.hash) );
2920
2921		        	// Change Dots Active Class
2922			        self.changeDotsActiveState();
2923
2924		        	self.updateHash( true );
2925		        } else {
2926		        	var hash  = window.location.hash,
2927		        		index = hash.replace('#','');
2928
2929		        	if( !hash ) {
2930		        		index = 1;
2931		        	}
2932
2933		        	self.moveTo( $('.section-wrapper').eq( index - 1 ).offset().top );
2934
2935		        	self.changeSectionActiveState( $('.section-wrapper').eq( index - 1 ).find('.section-scroll') );
2936
2937		        	// Change Dots Active Class
2938			        self.changeDotsActiveState();
2939
2940		        	self.updateHash( true );
2941		        }
2942
2943				$(window).trigger('section.scroll.ready');
2944			}, 500);
2945
2946			return this;
2947		},
2948
2949		updateSectionsHeight: function() {
2950			var self = this;
2951
2952			$('.section-scroll').css({ height: '' });
2953
2954			$('.section-scroll').each(function(){
2955				if( $(this).outerHeight() < ( $(window).height() + 3 ) ) {
2956					$(this).css({ height: '100vh' });		
2957				} else {
2958					$(this).addClass('section-scroll-scrollable');
2959				}
2960			});
2961
2962			// Set the section wrapper height
2963	  		$('.section-wrapper').each(function(){
2964	  			$(this).height( $(this).find('.section-scroll').outerHeight() );
2965	  		});
2966
2967			return this;
2968		},
2969
2970		updateHash: function( first_load ){
2971			var self = this;
2972
2973			if( !window.location.hash ) {
2974				window.location.hash = 1;
2975			} else {
2976				if(!first_load) {
2977					var $section = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll'),
2978						section_id = $section.attr('id') ? $section.attr('id') : $section.parent().index() + 1;
2979
2980					window.location.hash = section_id;
2981				}
2982			}
2983
2984			return this;
2985		},
2986
2987		getCurrentIndex: function() {
2988			var self = this,
2989				currentIndex = 0;
2990
2991			currentIndex = $('.section-wrapper.active').index();
2992
2993			return currentIndex;
2994		},
2995
2996		moveTo: function( $scrollTopValue, first_load ) {
2997			var self = this;
2998
2999			$('body, html').animate({
3000   				scrollTop: $scrollTopValue
3001   			}, 1000, 'easeOutQuint');
3002
3003   			setTimeout(function(){
3004	   			self.updateHash();
3005   			}, 500);
3006
3007			return this;
3008		},
3009
3010		getNextSection: function(wheelDirection, touchDirection) {
3011			var self = this,
3012				$nextSection = '';
3013
3014			// Scroll Direction
3015        	if(wheelDirection || touchDirection == 'up') {
3016				$nextSection = $('.section-wrapper').eq( self.getCurrentIndex() + 1 ).find('.section-scroll');
3017        	} else {
3018        		$nextSection = $('.section-wrapper').eq( self.getCurrentIndex() - 1 ).find('.section-scroll');
3019        	}
3020
3021			return $nextSection;
3022		},
3023
3024		changeSectionActiveState: function( $nextSection ) {
3025			var self = this;
3026
3027			$('.section-wrapper').removeClass('active');
3028	   		$nextSection.parent().addClass('active');
3029
3030			return this;
3031		},
3032
3033		changeDotsActiveState: function() {
3034			var self = this;
3035
3036			$('.section-scroll-dots-navigation > ul > li').removeClass('active');
3037			$('.section-scroll-dots-navigation > ul > li').eq( self.getCurrentIndex() ).addClass('active');
3038
3039			return this;
3040		},
3041
3042		dotsNavigation: function() {
3043			var self = this;
3044
3045			var dotsNav = $('<div class="section-scroll-dots-navigation"><ul class="list list-unstyled"></ul></div>'),
3046        		currentSectionIndex = self.getCurrentIndex();
3047
3048        	if( self.options.dotsClass ) {
3049        		dotsNav.addClass( self.options.dotsClass );
3050        	}
3051
3052        	for( var i = 0; i < $('.section-scroll').length; i++ ) {
3053        		var title = $('.section-wrapper').eq( i ).find('.section-scroll').data('section-scroll-title');
3054
3055        		dotsNav.find('> ul').append( '<li'+ ( ( currentSectionIndex == i ) ? ' class="active"' : '' ) +'><a href="#'+ i +'" data-nav-id="'+ i +'"><span>'+ title +'</span></a></li>' );
3056        	}
3057
3058        	$('.body').append( dotsNav );
3059
3060        	dotsNav.find('a[data-nav-id]').on('click touchstart', function(e){
3061        		e.preventDefault();
3062        		var $this = $(this);
3063
3064        		$('.section-scroll').css({
3065        			opacity: 0,
3066        			transition: 'ease opacity 300ms'
3067        		});
3068
3069        		self.$header.css({
3070			    	opacity: 0,
3071			    	transition: 'ease opacity 500ms'
3072			    });
3073
3074        		setTimeout(function(){
3075	        		self.moveTo( $('.section-wrapper').eq( $this.data('nav-id') ).offset().top )
3076
3077		   			$('.section-wrapper').removeClass('active');
3078			   		$('.section-wrapper').eq( $this.data('nav-id') ).addClass('active');
3079
3080	        		$('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').css({
3081	        			opacity: 1
3082	        		});
3083
3084	        		setTimeout(function(){
3085		        		$('.section-scroll').css({ opacity: 1 });
3086
3087		        		$(window).trigger('section.scroll.change.header.color');
3088	        		}, 500);
3089
3090	        		self.changeDotsActiveState();
3091        		}, 500);
3092        	});
3093
3094			return this;
3095		},
3096
3097		events: function() {
3098			var self = this;
3099
3100			$(window).on('section.scroll.ready', function(){
3101				$(window).scrollTop(0);
3102			});
3103
3104			$(window).on('section.scroll.change.header.color', function(){
3105		    	var headerColor = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').data('section-scroll-header-color');
3106		    	
3107		    	$('#header .header-nav').removeClass('header-nav-light-text header-nav-dark-text').addClass('header-nav-' + headerColor + '-text');
3108		    	$('#header .header-nav-features').removeClass('header-nav-features-dark header-nav-features-light').addClass('header-nav-features-' + headerColor);
3109		    	$('#header .header-social-icons').removeClass('social-icons-icon-dark social-icons-icon-light').addClass('social-icons-icon-' + headerColor);
3110
3111		    	// Change Logo
3112		    	if( self.options.changeHeaderLogo && headerColor != undefined ) {
3113			    	if( headerColor == 'light' ) {
3114			    		$('#header .header-logo img').attr('src', self.options.headerLogoLight);
3115			    	} else if( headerColor == 'dark' ) {
3116			    		$('#header .header-logo img').attr('src', self.options.headerLogoDark);
3117			    	}
3118		    	}
3119
3120		    	self.$header.css({
3121		    		opacity: 1
3122		    	});
3123		    });
3124
3125			$(document).ready(function(){
3126			    $(window).afterResize(function(){
3127			    	self.updateSectionsHeight();
3128			    });
3129			});
3130
3131		    return this;
3132		}
3133	};
3134
3135	// expose to scope
3136	$.extend(theme, {
3137		PluginSectionScroll: PluginSectionScroll
3138	});
3139
3140	// jquery plugin
3141	$.fn.themePluginSectionScroll = function(opts) {
3142		return this.map(function() {
3143			var $this = $(this);
3144
3145			if ($this.data(instanceName)) {
3146				return $this.data(instanceName);
3147			} else {
3148				return new PluginSectionScroll($this, opts);
3149			}
3150
3151		});
3152	};
3153
3154}).apply(this, [window.theme, jQuery]);
3155
3156// Sort
3157(function(theme, $) {
3158
3159	theme = theme || {};
3160
3161	var instanceName = '__sort';
3162
3163	var PluginSort = function($el, opts) {
3164		return this.initialize($el, opts);
3165	};
3166
3167	PluginSort.defaults = {
3168		useHash: true,
3169		itemSelector: '.isotope-item',
3170		layoutMode: 'masonry',
3171		filter: '*',
3172		hiddenStyle: {
3173			opacity: 0
3174		},
3175		visibleStyle: {
3176			opacity: 1
3177		},
3178		stagger: 30,
3179		isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true)
3180	};
3181
3182	PluginSort.prototype = {
3183		initialize: function($el, opts) {
3184			if ($el.data(instanceName)) {
3185				return this;
3186			}
3187
3188			this.$el = $el;
3189
3190			this
3191				.setData()
3192				.setOptions(opts)
3193				.build();
3194
3195			return this;
3196		},
3197
3198		setData: function() {
3199			this.$el.data(instanceName, this);
3200
3201			return this;
3202		},
3203
3204		setOptions: function(opts) {
3205			this.options = $.extend(true, {}, PluginSort.defaults, opts, {
3206				wrapper: this.$el
3207			});
3208
3209			return this;
3210		},
3211
3212		build: function() {
3213			if (!($.isFunction($.fn.isotope))) {
3214				return this;
3215			}
3216
3217			var self = this,
3218				$source = this.options.wrapper,
3219				$destination = $('.sort-destination[data-sort-id="' + $source.attr('data-sort-id') + '"]'),
3220				$window = $(window);
3221
3222			if ($destination.get(0)) {
3223
3224				self.$source = $source;
3225				self.$destination = $destination;
3226				self.$loader = false;
3227
3228				self.setParagraphHeight($destination);
3229
3230				if (self.$destination.parents('.sort-destination-loader').get(0)) {
3231					self.$loader = self.$destination.parents('.sort-destination-loader');
3232					self.createLoader();
3233				}
3234
3235				$destination.attr('data-filter', '*');
3236
3237				$destination.one('layoutComplete', function(event, laidOutItems) {
3238					self.removeLoader();
3239				});
3240
3241				// IE10/11 fix
3242				if( $('html').hasClass('ie10') || $('html').hasClass('ie11') ) {
3243					var padding = parseInt( self.options.wrapper.children().css('padding-left') ) + parseInt( self.options.wrapper.children().css('padding-right') );
3244				}
3245
3246				$destination.waitForImages(function() {
3247					$destination.isotope(self.options);
3248					self.events();
3249				});
3250
3251
3252				setTimeout(function() {
3253					self.removeLoader();
3254				}, 3000);
3255
3256			}
3257
3258			return this;
3259		},
3260
3261		events: function() {
3262			var self = this,
3263				filter = null,
3264				$window = $(window);
3265
3266			self.$source.find('a').click(function(e) {
3267				e.preventDefault();
3268
3269				filter = $(this).parent().data('option-value');
3270
3271				self.setFilter(filter);
3272
3273				if (e.originalEvent) {
3274					self.$source.trigger('filtered');
3275				}
3276
3277				return this;
3278			});
3279
3280			self.$destination.trigger('filtered');
3281			self.$source.trigger('filtered');
3282
3283			if (self.options.useHash) {
3284				self.hashEvents();
3285			}
3286
3287			$window.on('resize', function() {
3288				setTimeout(function() {
3289					self.$destination.isotope('layout');
3290				}, 300);
3291			});
3292
3293			setTimeout(function() {
3294				$window.trigger('resize');
3295			}, 300);
3296
3297			return this;
3298		},
3299
3300		setFilter: function(filter) {
3301			var self = this,
3302				page = false,
3303				currentFilter = filter;
3304
3305			self.$source.find('.active').removeClass('active');
3306			self.$source.find('li[data-option-value="' + filter + '"], li[data-option-value="' + filter + '"] > a').addClass('active');
3307
3308			self.options.filter = currentFilter;
3309
3310			if (self.$destination.attr('data-current-page')) {
3311				currentFilter = currentFilter + '[data-page-rel=' + self.$destination.attr('data-current-page') + ']';
3312			}
3313
3314			self.$destination.attr('data-filter', filter).isotope({
3315				filter: currentFilter
3316			}).one('arrangeComplete', function( event, filteredItems ) {
3317				
3318				if (self.options.useHash) {
3319					if (window.location.hash != '' || self.options.filter.replace('.', '') != '*') {
3320						window.location.hash = self.options.filter.replace('.', '');
3321					}
3322				}
3323				
3324				$(window).trigger('scroll');
3325
3326			}).trigger('filtered');
3327
3328			return this;
3329		},
3330
3331		hashEvents: function() {
3332			var self = this,
3333				hash = null,
3334				hashFilter = null,
3335				initHashFilter = '.' + location.hash.replace('#', '');
3336
3337			if (initHashFilter != '.' && initHashFilter != '.*') {
3338				self.setFilter(initHashFilter);
3339			}
3340
3341			$(window).on('hashchange', function(e) {
3342
3343				hashFilter = '.' + location.hash.replace('#', '');
3344				hash = (hashFilter == '.' || hashFilter == '.*' ? '*' : hashFilter);
3345
3346				self.setFilter(hash);
3347
3348			});
3349
3350			return this;
3351		},
3352
3353		setParagraphHeight: function() {
3354			var self = this,
3355				minParagraphHeight = 0,
3356				paragraphs = $('span.thumb-info-caption p', self.$destination);
3357
3358			paragraphs.each(function() {
3359				if ($(this).height() > minParagraphHeight) {
3360					minParagraphHeight = ($(this).height() + 10);
3361				}
3362			});
3363
3364			paragraphs.height(minParagraphHeight);
3365
3366			return this;
3367		},
3368
3369		createLoader: function() {
3370			var self = this;
3371
3372			var loaderTemplate = [
3373				'<div class="bounce-loader">',
3374					'<div class="bounce1"></div>',
3375					'<div class="bounce2"></div>',
3376					'<div class="bounce3"></div>',
3377				'</div>'
3378			].join('');
3379
3380			self.$loader.append(loaderTemplate);
3381
3382			return this;
3383		},
3384
3385		removeLoader: function() {
3386
3387			var self = this;
3388
3389			if (self.$loader) {
3390
3391				self.$loader.removeClass('sort-destination-loader-showing');
3392
3393				setTimeout(function() {
3394					self.$loader.addClass('sort-destination-loader-loaded');
3395				}, 300);
3396
3397			}
3398
3399		}
3400
3401	};
3402
3403	// expose to scope
3404	$.extend(theme, {
3405		PluginSort: PluginSort
3406	});
3407
3408	// jquery plugin
3409	$.fn.themePluginSort = function(opts) {
3410		return this.map(function() {
3411			var $this = $(this);
3412
3413			if ($this.data(instanceName)) {
3414				return $this.data(instanceName);
3415			} else {
3416				return new PluginSort($this, opts);
3417			}
3418
3419		});
3420	}
3421
3422}).apply(this, [window.theme, jQuery]);
3423
3424// Star Rating
3425(function(theme, $) {
3426
3427	theme = theme || {};
3428
3429	var instanceName = '__starrating';
3430
3431	var PluginStarRating = function($el, opts) {
3432		return this.initialize($el, opts);
3433	};
3434
3435	PluginStarRating.defaults = {
3436		theme: 'krajee-fas',
3437		color: 'primary',
3438		showClear: false,
3439		showCaption: false
3440	};
3441
3442	PluginStarRating.prototype = {
3443		initialize: function($el, opts) {
3444			this.$el = $el;
3445
3446			this
3447				.setData()
3448				.setOptions(opts)
3449				.build();
3450
3451			return this;
3452		},
3453
3454		setData: function() {
3455			this.$el.data(instanceName, this);
3456
3457			return this;
3458		},
3459
3460		setOptions: function(opts) {
3461			this.options = $.extend(true, {}, PluginStarRating.defaults, opts, {
3462				wrapper: this.$el
3463			});
3464
3465			return this;
3466		},
3467
3468		build: function() {
3469
3470			if (!($.isFunction($.fn.rating))) {
3471				return this;
3472			}
3473
3474			var self = this;
3475
3476			self.options.wrapper
3477				.rating(self.options);
3478
3479			self.options.wrapper.parents('.rating-container')
3480				.addClass('rating-' + self.options.color);
3481
3482			return this;
3483
3484		}
3485	};
3486
3487	// expose to scope
3488	$.extend(theme, {
3489		PluginStarRating: PluginStarRating
3490	});
3491
3492	// jquery plugin
3493	$.fn.themePluginStarRating = function(opts) {
3494		return this.map(function() {
3495			var $this = $(this);
3496
3497			if ($this.data(instanceName)) {
3498				return $this.data(instanceName);
3499			} else {
3500				return new PluginStarRating($this, opts);
3501			}
3502
3503		});
3504	}
3505
3506}).apply(this, [window.theme, jQuery]);
3507
3508// Sticky
3509(function(theme, $) {
3510	
3511	theme = theme || {};
3512	
3513	var instanceName = '__sticky';
3514
3515	var PluginSticky = function($el, opts) {
3516		return this.initialize($el, opts);
3517	};
3518
3519	PluginSticky.defaults = {
3520		minWidth: 991,
3521		activeClass: 'sticky-active'
3522	};
3523
3524	PluginSticky.prototype = {
3525		initialize: function($el, opts) {
3526			if ( $el.data( instanceName ) ) {
3527				return this;
3528			}
3529
3530			this.$el = $el;
3531
3532			this
3533				.setData()
3534				.setOptions(opts)
3535				.build()
3536				.events();
3537
3538			return this;
3539		},
3540
3541		setData: function() {
3542			this.$el.data(instanceName, this);
3543
3544			return this;
3545		},
3546
3547		setOptions: function(opts) {
3548			this.options = $.extend(true, {}, PluginSticky.defaults, opts, {
3549				wrapper: this.$el
3550			});
3551
3552			return this;
3553		},
3554
3555		build: function() {
3556			if (!($.isFunction($.fn.pin))) {
3557				return this;
3558			}
3559
3560			var self = this,
3561				$window = $(window);
3562			
3563			self.options.wrapper.pin(self.options);
3564
3565			if( self.options.wrapper.hasClass('sticky-wrapper-transparent') ) {
3566				self.options.wrapper.parent().addClass('position-absolute w-100');
3567			}
3568
3569			$window.afterResize(function() {
3570				self.options.wrapper.removeAttr('style').removeData('pin');
3571				self.options.wrapper.pin(self.options);
3572				$window.trigger('scroll');
3573			});
3574
3575			// Change Logo Src
3576			if( self.options.wrapper.find('img').attr('data-change-src') ) {
3577				var $logo      = self.options.wrapper.find('img'),
3578					logoSrc    = $logo.attr('src'),
3579					logoNewSrc = $logo.attr('data-change-src');
3580
3581				self.changeLogoSrc = function(activate) {
3582					if(activate) {
3583						$logo.attr('src', logoNewSrc);
3584					} else {
3585						$logo.attr('src', logoSrc);
3586					}
3587				}
3588			}
3589			
3590			return this;
3591		},
3592
3593		events: function() {
3594			var self = this,
3595				$window = $(window),
3596				$logo = self.options.wrapper.find('img'),
3597				sticky_activate_flag = true,
3598				sticky_deactivate_flag = false,
3599				class_to_check = ( self.options.wrapper.hasClass('sticky-wrapper-effect-1') ) ? 'sticky-effect-active' : 'sticky-active';
3600
3601			$window.on('scroll sticky.effect.active', function(){
3602				if( self.options.wrapper.hasClass( class_to_check ) ) {		
3603					if( sticky_activate_flag ) {			
3604						if( $logo.attr('data-change-src') ) {
3605							self.changeLogoSrc(true);
3606						}
3607
3608						sticky_activate_flag = false;
3609						sticky_deactivate_flag = true;
3610					}
3611				} else {	
3612					if( sticky_deactivate_flag ) {				
3613						if( $logo.attr('data-change-src') ) {
3614							self.changeLogoSrc(false);
3615						}
3616
3617						sticky_deactivate_flag = false;
3618						sticky_activate_flag = true;
3619					}
3620				}
3621			});
3622
3623			var is_backing = false;
3624			if( self.options.stickyStartEffectAt ) {
3625
3626				// First Load
3627				if( self.options.stickyStartEffectAt < $window.scrollTop() ) {
3628					self.options.wrapper.addClass('sticky-effect-active');
3629
3630					$window.trigger('sticky.effect.active');
3631				}
3632
3633				$window.on('scroll', function(){
3634					if( self.options.stickyStartEffectAt < $window.scrollTop() ) {	
3635						self.options.wrapper.addClass('sticky-effect-active');
3636						is_backing = true;
3637
3638						$window.trigger('sticky.effect.active');
3639					} else {	
3640						if( is_backing ) {
3641							self.options.wrapper.find('.sticky-body').addClass('position-fixed');
3642							is_backing = false;
3643						}
3644
3645						if( $window.scrollTop() == 0 ) {
3646							self.options.wrapper.find('.sticky-body').removeClass('position-fixed');
3647						}
3648
3649						self.options.wrapper.removeClass('sticky-effect-active');
3650					}
3651				});
3652			}
3653		}
3654	};
3655
3656	// expose to scope
3657	$.extend(theme, {
3658		PluginSticky: PluginSticky
3659	});
3660
3661	// jquery plugin
3662	$.fn.themePluginSticky = function(opts) {
3663		return this.map(function() {
3664			var $this = $(this);
3665
3666			if ($this.data(instanceName)) {
3667				return $this.data(instanceName);
3668			} else {
3669				return new PluginSticky($this, opts);
3670			}
3671			
3672		});
3673	}
3674
3675}).apply(this, [ window.theme, jQuery ]);
3676
3677// Toggle
3678(function(theme, $) {
3679
3680	theme = theme || {};
3681
3682	var instanceName = '__toggle';
3683
3684	var PluginToggle = function($el, opts) {
3685		return this.initialize($el, opts);
3686	};
3687
3688	PluginToggle.defaults = {
3689		duration: 350,
3690		isAccordion: false
3691	};
3692
3693	PluginToggle.prototype = {
3694		initialize: function($el, opts) {
3695			if ($el.data(instanceName)) {
3696				return this;
3697			}
3698
3699			this.$el = $el;
3700
3701			this
3702				.setData()
3703				.setOptions(opts)
3704				.build();
3705
3706			return this;
3707		},
3708
3709		setData: function() {
3710			this.$el.data(instanceName, this);
3711
3712			return this;
3713		},
3714
3715		setOptions: function(opts) {
3716			this.options = $.extend(true, {}, PluginToggle.defaults, opts, {
3717				wrapper: this.$el
3718			});
3719
3720			return this;
3721		},
3722
3723		build: function() {
3724			var self = this,
3725				$wrapper = this.options.wrapper,
3726				$items = $wrapper.find('> .toggle'),
3727				$el = null;
3728
3729			$items.each(function() {
3730				$el = $(this);
3731
3732				if ($el.hasClass('active')) {
3733					$el.find('> p').addClass('preview-active');
3734					$el.find('> .toggle-content').slideDown(self.options.duration);
3735				}
3736
3737				self.events($el);
3738			});
3739
3740			if (self.options.isAccordion) {
3741				self.options.duration = self.options.duration / 2;
3742			}
3743
3744			return this;
3745		},
3746
3747		events: function($el) {
3748			var self = this,
3749				previewParCurrentHeight = 0,
3750				previewParAnimateHeight = 0,
3751				toggleContent = null;
3752
3753			$el.find('> label, > .toggle-title').click(function(e) {
3754
3755				var $this = $(this),
3756					parentSection = $this.parent(),
3757					parentWrapper = $this.parents('.toggle'),
3758					previewPar = null,
3759					closeElement = null;
3760
3761				if (self.options.isAccordion && typeof(e.originalEvent) != 'undefined') {
3762					closeElement = parentWrapper.find('.toggle.active > label, .toggle.active > .toggle-title');
3763
3764					if (closeElement[0] == $this[0]) {
3765						return;
3766					}
3767				}
3768
3769				parentSection.toggleClass('active');
3770
3771				// Preview Paragraph
3772				if (parentSection.find('> p').get(0)) {
3773
3774					previewPar = parentSection.find('> p');
3775					previewParCurrentHeight = previewPar.css('height');
3776					previewPar.css('height', 'auto');
3777					previewParAnimateHeight = previewPar.css('height');
3778					previewPar.css('height', previewParCurrentHeight);
3779
3780				}
3781
3782				// Content
3783				toggleContent = parentSection.find('> .toggle-content');
3784
3785				if (parentSection.hasClass('active')) {
3786
3787					$(previewPar).animate({
3788						height: previewParAnimateHeight
3789					}, self.options.duration, function() {
3790						$(this).addClass('preview-active');
3791					});
3792
3793					toggleContent.slideDown(self.options.duration, function() {
3794						if (closeElement) {
3795							closeElement.trigger('click');
3796						}
3797					});
3798
3799				} else {
3800
3801					$(previewPar).animate({
3802						height: 0
3803					}, self.options.duration, function() {
3804						$(this).removeClass('preview-active');
3805					});
3806
3807					toggleContent.slideUp(self.options.duration);
3808
3809				}
3810
3811			});
3812		}
3813	};
3814
3815	// expose to scope
3816	$.extend(theme, {
3817		PluginToggle: PluginToggle
3818	});
3819
3820	// jquery plugin
3821	$.fn.themePluginToggle = function(opts) {
3822		return this.map(function() {
3823			var $this = $(this);
3824
3825			if ($this.data(instanceName)) {
3826				return $this.data(instanceName);
3827			} else {
3828				return new PluginToggle($this, opts);
3829			}
3830
3831		});
3832	}
3833
3834}).apply(this, [window.theme, jQuery]);
3835
3836// Tweets
3837(function(theme, $) {
3838
3839	theme = theme || {};
3840
3841	var instanceName = '__tweets';
3842
3843	var PluginTweets = function($el, opts) {
3844		return this.initialize($el, opts);
3845	};
3846
3847	PluginTweets.defaults = {
3848		username: null,
3849		count: 2,
3850		URL: 'php/twitter-feed.php',
3851		iconColor: false
3852	};
3853
3854	PluginTweets.prototype = {
3855		initialize: function($el, opts) {
3856			if ($el.data(instanceName)) {
3857				return this;
3858			}
3859
3860			this.$el = $el;
3861
3862			this
3863				.setData()
3864				.setOptions(opts)
3865				.build();
3866
3867			return this;
3868		},
3869
3870		setData: function() {
3871			this.$el.data(instanceName, this);
3872
3873			return this;
3874		},
3875
3876		setOptions: function(opts) {
3877			this.options = $.extend(true, {}, PluginTweets.defaults, opts, {
3878				wrapper: this.$el
3879			});
3880
3881			return this;
3882		},
3883
3884		build: function() {
3885			if (this.options.username == null || this.options.username == '') {
3886				return this;
3887			}
3888
3889			var self = this,
3890				$wrapper = this.options.wrapper;
3891
3892			$.ajax({
3893				type: 'GET',
3894				data: {
3895					twitter_screen_name: self.options.username,
3896					tweets_to_display: self.options.count,
3897					icon_color: self.options.iconColor
3898				},
3899				url: self.options.URL,
3900			}).done(function(html) {
3901				$wrapper.html(html).find('a').attr('target','_blank');
3902			});
3903
3904			return this;
3905		}
3906	};
3907
3908	// expose to scope
3909	$.extend(theme, {
3910		PluginTweets: PluginTweets
3911	});
3912
3913	// jquery plugin
3914	$.fn.themePluginTweets = function(opts) {
3915		return this.map(function() {
3916			var $this = $(this);
3917
3918			if ($this.data(instanceName)) {
3919				return $this.data(instanceName);
3920			} else {
3921				return new PluginTweets($this, opts);
3922			}
3923
3924		});
3925	}
3926
3927}).apply(this, [window.theme, jQuery]);
3928
3929// Validation
3930(function(theme, $) {
3931
3932	theme = theme || {};
3933
3934	$.extend(theme, {
3935
3936		PluginValidation: {
3937
3938			defaults: {
3939				formClass: 'needs-validation',
3940				validator: {
3941					highlight: function(element) {
3942						$(element)
3943							.addClass('is-invalid')
3944							.removeClass('is-valid')
3945							.parent()
3946							.removeClass('has-success')
3947							.addClass('has-danger');
3948					},
3949					success: function(label, element) {
3950						$(element)
3951							.removeClass('is-invalid')
3952							.addClass('is-valid')
3953							.parent()
3954							.removeClass('has-danger')
3955							.addClass('has-success')
3956							.find('label.error')
3957							.remove();
3958					},
3959					errorPlacement: function(error, element) {
3960						if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') {
3961							error.appendTo(element.parent().parent());
3962						} else {
3963							error.insertAfter(element);
3964						}
3965					}
3966				},
3967				validateCaptchaURL: 'php/contact-form-verify-captcha.php',
3968				refreshCaptchaURL: 'php/contact-form-refresh-captcha.php'
3969			},
3970
3971			initialize: function(opts) {
3972				initialized = true;
3973
3974				this
3975					.setOptions(opts)
3976					.build();
3977
3978				return this;
3979			},
3980
3981			setOptions: function(opts) {
3982				this.options = $.extend(true, {}, this.defaults, opts);
3983
3984				return this;
3985			},
3986
3987			build: function() {
3988				var self = this;
3989
3990				if (!($.isFunction($.validator))) {
3991					return this;
3992				}
3993
3994				self.addMethods();
3995				self.setMessageGroups();
3996
3997				$.validator.setDefaults(self.options.validator);
3998
3999				$('.' + self.options.formClass).validate();
4000
4001				return this;
4002			},
4003
4004			addMethods: function() {
4005				var self = this;
4006
4007				$.validator.addMethod('captcha', function(value, element, params) {
4008					var captchaValid = false;
4009
4010					$.ajax({
4011						url: self.options.validateCaptchaURL,
4012						type: 'POST',
4013						async: false,
4014						dataType: 'json',
4015						data: {
4016							captcha: $.trim(value)
4017						},
4018						success: function(data) {
4019							if (data.response == 'success') {
4020								captchaValid = true;
4021							}
4022						}
4023					});
4024
4025					if (captchaValid) {
4026						return true;
4027					}
4028
4029				}, '');
4030
4031				// Refresh Captcha
4032				$('#refreshCaptcha').on('click', function(e) {
4033					e.preventDefault();
4034					$.get(self.options.refreshCaptchaURL, function(url) {
4035						$('#captcha-image').attr('src', url);
4036					});					
4037				});
4038
4039			},
4040
4041			setMessageGroups: function() {
4042
4043				$('.checkbox-group[data-msg-required], .radio-group[data-msg-required]').each(function() {
4044					var message = $(this).data('msg-required');
4045					$(this).find('input').attr('data-msg-required', message);
4046				});
4047
4048			}
4049
4050		}
4051
4052	});
4053
4054}).apply(this, [window.theme, jQuery]);
4055
4056// Video Background
4057(function(theme, $) {
4058
4059	theme = theme || {};
4060
4061	var instanceName = '__videobackground';
4062
4063	var PluginVideoBackground = function($el, opts) {
4064		return this.initialize($el, opts);
4065	};
4066
4067	PluginVideoBackground.defaults = {
4068		overlay: false,
4069		volume: 1,
4070		playbackRate: 1,
4071		muted: true,
4072		loop: true,
4073		autoplay: true,
4074		position: '50% 50%',
4075		posterType: 'detect'
4076	};
4077
4078	PluginVideoBackground.prototype = {
4079		initialize: function($el, opts) {
4080			this.$el = $el;
4081
4082			this
4083				.setData()
4084				.setOptions(opts)
4085				.build();
4086
4087			return this;
4088		},
4089
4090		setData: function() {
4091			this.$el.data(instanceName, this);
4092
4093			return this;
4094		},
4095
4096		setOptions: function(opts) {
4097			this.options = $.extend(true, {}, PluginVideoBackground.defaults, opts, {
4098				path: this.$el.data('video-path'),
4099				wrapper: this.$el
4100			});
4101
4102			return this;
4103		},
4104
4105		build: function() {
4106
4107			if (!($.isFunction($.fn.vide)) || (!this.options.path)) {
4108				return this;
4109			}
4110
4111			if (this.options.overlay) {
4112
4113				var overlayClass = this.options.overlayClass;
4114
4115				this.options.wrapper.prepend(
4116					$('<div />').addClass(overlayClass)
4117				);
4118			}
4119
4120			this.options.wrapper
4121				.vide(this.options.path, this.options)
4122				.first().css('z-index', 0);
4123
4124			return this;
4125		}
4126	};
4127
4128	// expose to scope
4129	$.extend(theme, {
4130		PluginVideoBackground: PluginVideoBackground
4131	});
4132
4133	// jquery plugin
4134	$.fn.themePluginVideoBackground = function(opts) {
4135		return this.map(function() {
4136			var $this = $(this);
4137
4138			if ($this.data(instanceName)) {
4139				return $this.data(instanceName);
4140			} else {
4141				return new PluginVideoBackground($this, opts);
4142			}
4143
4144		});
4145	}
4146
4147}).apply(this, [window.theme, jQuery]);
4148
4149// Account
4150(function(theme, $) {
4151
4152	theme = theme || {};
4153
4154	var initialized = false;
4155
4156	$.extend(theme, {
4157
4158		Account: {
4159
4160			defaults: {
4161				wrapper: $('#headerAccount')
4162			},
4163
4164			initialize: function($wrapper, opts) {
4165				if (initialized) {
4166					return this;
4167				}
4168
4169				initialized = true;
4170				this.$wrapper = ($wrapper || this.defaults.wrapper);
4171
4172				this
4173					.setOptions(opts)
4174					.events();
4175
4176				return this;
4177			},
4178
4179			setOptions: function(opts) {
4180				this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options')));
4181
4182				return this;
4183			},
4184
4185			events: function() {
4186				var self = this;
4187
4188				$(window).on('load', function(){
4189					$(document).ready(function(){
4190						setTimeout(function(){
4191
4192							self.$wrapper.find('input').on('focus', function() {
4193								self.$wrapper.addClass('open');
4194
4195								$(document).mouseup(function(e) {
4196									if (!self.$wrapper.is(e.target) && self.$wrapper.has(e.target).length === 0) {
4197										self.$wrapper.removeClass('open');
4198									}
4199								});
4200							});
4201
4202						}, 1500);
4203					});
4204				});
4205
4206				$('#headerSignUp').on('click', function(e) {
4207					e.preventDefault();
4208					self.$wrapper.addClass('signup').removeClass('signin').removeClass('recover');
4209					self.$wrapper.find('.signup-form input:first').focus();
4210				});
4211
4212				$('#headerSignIn').on('click', function(e) {
4213					e.preventDefault();
4214					self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover');
4215					self.$wrapper.find('.signin-form input:first').focus();
4216				});
4217
4218				$('#headerRecover').on('click', function(e) {
4219					e.preventDefault();
4220					self.$wrapper.addClass('recover').removeClass('signup').removeClass('signin');
4221					self.$wrapper.find('.recover-form input:first').focus();
4222				});
4223
4224				$('#headerRecoverCancel').on('click', function(e) {
4225					e.preventDefault();
4226					self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover');
4227					self.$wrapper.find('.signin-form input:first').focus();
4228				});
4229			}
4230
4231		}
4232
4233	});
4234
4235}).apply(this, [window.theme, jQuery]);
4236
4237// Nav
4238(function(theme, $) {
4239
4240	theme = theme || {};
4241
4242	var initialized = false;
4243
4244	$.extend(theme, {
4245
4246		Nav: {
4247
4248			defaults: {
4249				wrapper: $('#mainNav'),
4250				scrollDelay: 600,
4251				scrollAnimation: 'easeOutQuad'
4252			},
4253
4254			initialize: function($wrapper, opts) {
4255				if (initialized) {
4256					return this;
4257				}
4258
4259				initialized = true;
4260				this.$wrapper = ($wrapper || this.defaults.wrapper);
4261
4262				this
4263					.setOptions(opts)
4264					.build()
4265					.events();
4266
4267				return this;
4268			},
4269
4270			setOptions: function(opts) {
4271				this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options')));
4272
4273				return this;
4274			},
4275
4276			build: function() {
4277				var self = this,
4278					$html = $('html'),
4279					$header = $('#header'),
4280					$headerNavMain = $('#header .header-nav-main'),
4281					thumbInfoPreview;
4282
4283				// Preview Thumbs
4284				self.$wrapper.find('a[data-thumb-preview]').each(function() {
4285					thumbInfoPreview = $('<span />').addClass('thumb-info thumb-info-preview')
4286											.append($('<span />').addClass('thumb-info-wrapper')
4287												.append($('<span />').addClass('thumb-info-image').css('background-image', 'url(' + $(this).data('thumb-preview') + ')')
4288										   )
4289									   );
4290
4291					$(this).append(thumbInfoPreview);
4292				});
4293
4294				// Side Header / Side Header Hamburguer Sidebar (Reverse Dropdown)
4295				if($html.hasClass('side-header') || $html.hasClass('side-header-hamburguer-sidebar')) {
4296					
4297					// Side Header Right / Side Header Hamburguer Sidebar Right
4298					if($html.hasClass('side-header-right') || $html.hasClass('side-header-hamburguer-sidebar-right')) {
4299						if(!$html.hasClass('side-header-right-no-reverse')) {
4300							$header.find('.dropdown-submenu').addClass('dropdown-reverse');
4301						}
4302					}
4303
4304				} else {
4305					
4306					// Reverse
4307					self.checkReverse = function() {
4308						self.$wrapper.find('.dropdown, .dropdown-submenu').removeClass('dropdown-reverse');
4309
4310						self.$wrapper.find('.dropdown:not(.manual):not(.dropdown-mega), .dropdown-submenu:not(.manual)').each(function() {
4311							if(!$(this).find('.dropdown-menu').visible( false, true, 'horizontal' )  ) {
4312								$(this).addClass('dropdown-reverse');
4313							}
4314						});
4315					}
4316
4317					self.checkReverse();
4318
4319	 				$(window).on('resize', function() {
4320						self.checkReverse();
4321	 				});
4322
4323				}
4324
4325				// Clone Items
4326				if($headerNavMain.hasClass('header-nav-main-clone-items')) {
4327
4328			    	$headerNavMain.find('nav > ul > li > a').each(function(){
4329				    	var parent = $(this).parent(),
4330				    		clone  = $(this).clone(),
4331				    		clone2 = $(this).clone(),
4332				    		wrapper = $('<span class="wrapper-items-cloned"></span>');
4333
4334				    	// Config Classes
4335				    	$(this).addClass('item-original');
4336				    	clone2.addClass('item-two');
4337
4338				    	// Insert on DOM
4339				    	parent.prepend(wrapper);
4340				    	wrapper.append(clone).append(clone2);
4341				    });
4342
4343				}
4344
4345				// Floating
4346				if($('#header.header-floating-icons').get(0) && $(window).width() > 991) {
4347
4348					var menuFloatingAnim = {
4349						$menuFloating: $('#header.header-floating-icons .header-container > .header-row'),
4350
4351						build: function() {
4352							var self = this;
4353
4354							self.init();
4355						},
4356						init: function(){
4357							var self  = this,
4358								divisor = 0;
4359
4360							$(window).scroll(function() {
4361							    var scrollPercent = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()),
4362							    	st = $(this).scrollTop();
4363
4364								divisor = $(document).height() / $(window).height();
4365
4366							    self.$menuFloating.find('.header-column > .header-row').css({
4367							    	transform : 'translateY( calc('+ scrollPercent +'vh - '+ st / divisor +'px) )' 
4368							    });
4369							});
4370						}
4371					}
4372
4373					menuFloatingAnim.build();
4374
4375				}
4376
4377				// Slide
4378				if($('.header-nav-links-vertical-slide').get(0)) {
4379					var slideNavigation = {
4380						$mainNav: $('#mainNav'),
4381						$mainNavItem: $('#mainNav li'),
4382
4383						build: function(){
4384							var self = this;
4385
4386							self.menuNav();
4387						},
4388						menuNav: function(){
4389							var self = this;
4390
4391							self.$mainNavItem.on('click', function(e){
4392								var currentMenuItem 	= $(this),
4393									currentMenu 		= $(this).parent(),
4394									nextMenu        	= $(this).find('ul').first(),
4395									prevMenu        	= $(this).closest('.next-menu'),
4396									isSubMenu       	= currentMenuItem.hasClass('dropdown') || currentMenuItem.hasClass('dropdown-submenu'),
4397									isBack          	= currentMenuItem.hasClass('back-button'),
4398									nextMenuHeightDiff  = ( ( nextMenu.find('> li').length * nextMenu.find('> li').outerHeight() ) - nextMenu.outerHeight() ),
4399									prevMenuHeightDiff  = ( ( prevMenu.find('> li').length * prevMenu.find('> li').outerHeight() ) - prevMenu.outerHeight() );
4400
4401								if( isSubMenu ) {
4402									currentMenu.addClass('next-menu');
4403									nextMenu.addClass('visible');
4404									currentMenu.css({
4405										overflow: 'visible',
4406										'overflow-y': 'visible'
4407									});
4408									
4409									if( nextMenuHeightDiff > 0 ) {
4410										nextMenu.css({
4411											overflow: 'hidden',
4412											'overflow-y': 'scroll'
4413										});
4414									}
4415
4416									for( i = 0; i < nextMenu.find('> li').length; i++ ) {
4417										if( nextMenu.outerHeight() < ($('.header-row-side-header').outerHeight() - 100) ) {
4418											nextMenu.css({
4419												height: nextMenu.outerHeight() + nextMenu.find('> li').outerHeight()
4420											});
4421										}
4422									}
4423
4424									nextMenu.css({
4425										'padding-top': nextMenuHeightDiff + 'px'
4426									});
4427								}
4428
4429								if( isBack ) {
4430									currentMenu.parent().parent().removeClass('next-menu');
4431									currentMenu.removeClass('visible');
4432
4433									if( prevMenuHeightDiff > 0 ) {
4434										prevMenu.css({
4435											overflow: 'hidden',
4436											'overflow-y': 'scroll'
4437										});
4438									}
4439								}
4440
4441								e.stopPropagation();
4442							});
4443						}
4444					}
4445
4446					$(window).trigger('resize');
4447					
4448					if( $(window).width() > 991 ) {
4449						slideNavigation.build();
4450					}
4451
4452					$(document).ready(function(){
4453						$(window).afterResize(function(){
4454							if( $(window).width() > 991 ) {
4455								slideNavigation.build();
4456							}
4457						});
4458					});
4459				}
4460
4461				// Header Nav Main Mobile Dark
4462				if($('.header-nav-main-mobile-dark').get(0)) {
4463					$('#header:not(.header-transparent-dark-bottom-border):not(.header-transparent-light-bottom-border)').addClass('header-no-border-bottom');
4464				}
4465				
4466				return this;
4467			},
4468
4469			events: function() {
4470				var self    = this,
4471					$html   = $('html'),
4472					$header = $('#header'),
4473					$window = $(window),
4474					headerBodyHeight = $('.header-body').outerHeight();
4475
4476				$header.find('a[href="#"]').on('click', function(e) {
4477					e.preventDefault();
4478				});
4479
4480				// Mobile Arrows
4481				$header.find('.dropdown-toggle, .dropdown-submenu > a')
4482					.append('<i class="fas fa-chevron-down"></i>');
4483				
4484				$header.find('.dropdown-toggle[href="#"], .dropdown-submenu a[href="#"], .dropdown-toggle[href!="#"] .fa-chevron-down, .dropdown-submenu a[href!="#"] .fa-chevron-down').on('click', function(e) {
4485					e.preventDefault();
4486					if ($window.width() < 992) {
4487						$(this).closest('li').toggleClass('open');
4488
4489						// Adjust Header Body Height
4490						var height = ( $header.hasClass('header-effect-shrink') && $html.hasClass('sticky-header-active') ) ? theme.StickyHeader.options.stickyHeaderContainerHeight : headerBodyHeight;
4491						$('.header-body').animate({
4492					 		height: ($('.header-nav-main nav').outerHeight(true) + height) + 10
4493					 	}, 0);
4494					}
4495				});
4496
4497				$header.find('li a.active').addClass('current-page-active');
4498
4499				// Add Open Class
4500				$header.find('.header-nav-click-to-open .dropdown-toggle[href="#"], .header-nav-click-to-open .dropdown-submenu a[href="#"], .header-nav-click-to-open .dropdown-toggle > i').on('click', function(e) {
4501					e.preventDefault();
4502					e.stopPropagation();
4503					if ($window.width() > 991) {
4504
4505						$header.find('li a.active').removeClass('active');
4506
4507						if( $(this).prop('tagName') == 'I' ) {
4508							$(this).parent().addClass('active');
4509						} else {
4510							$(this).addClass('active');
4511						}
4512
4513						if (!$(this).closest('li').hasClass('open')) {
4514
4515							var $li = $(this).closest('li'),
4516								isSub = false;
4517
4518							if ( $(this).parent().hasClass('dropdown-submenu') ) {
4519								isSub = true;
4520							}
4521
4522							$(this).closest('.dropdown-menu').find('.dropdown-submenu.open').removeClass('open');
4523							$(this).parent('.dropdown').parent().find('.dropdown.open').removeClass('open');
4524
4525							if (!isSub) {
4526								$(this).parent().find('.dropdown-submenu.open').removeClass('open');
4527							}
4528
4529							$li.addClass('open');
4530
4531							$(document).off('click.nav-click-to-open').on('click.nav-click-to-open', function (e) {
4532								if (!$li.is(e.target) && $li.has(e.target).length === 0) {
4533									$li.removeClass('open');
4534									$li.parents('.open').removeClass('open');
4535									$header.find('li a.active').removeClass('active');
4536									$header.find('li a.current-page-active').addClass('active');
4537								}
4538							});
4539
4540						} else {
4541							$(this).closest('li').removeClass('open');
4542							$header.find('li a.active').removeClass('active');
4543							$header.find('li a.current-page-active').addClass('active');
4544						}
4545
4546						$window.trigger({
4547							type: 'resize',
4548							from: 'header-nav-click-to-open'
4549						});
4550					}
4551				});
4552
4553				// Collapse Nav
4554				$header.find('[data-collapse-nav]').on('click', function(e) {
4555					$(this).parents('.collapse').removeClass('show');
4556				});
4557
4558				// Top Features
4559				$header.find('.header-nav-features-toggle').on('click', function(e) {
4560					e.preventDefault();
4561
4562					var $toggleParent = $(this).parent();
4563
4564					if (!$(this).siblings('.header-nav-features-dropdown').hasClass('show')) {
4565
4566						var $dropdown = $(this).siblings('.header-nav-features-dropdown');
4567
4568						$('.header-nav-features-dropdown.show').removeClass('show');
4569
4570						$dropdown.addClass('show');
4571
4572						$(document).off('click.header-nav-features-toggle').on('click.header-nav-features-toggle', function (e) {
4573							if (!$toggleParent.is(e.target) && $toggleParent.has(e.target).length === 0) {
4574								$('.header-nav-features-dropdown.show').removeClass('show');
4575							}
4576						});
4577
4578						if ($(this).attr('data-focus')) {
4579							$('#' + $(this).attr('data-focus')).focus();
4580						}
4581
4582					} else {
4583						$(this).siblings('.header-nav-features-dropdown').removeClass('show');
4584					}
4585				});
4586
4587				// Hamburguer Menu
4588				var $hamburguerMenuBtn = $('.hamburguer-btn:not(.side-panel-toggle)'),
4589					$hamburguerSideHeader = $('#header.side-header, #header.side-header-overlay-full-screen');
4590				
4591				$hamburguerMenuBtn.on('click', function(){
4592					if($(this).attr('data-set-active') != 'false') {
4593						$(this).toggleClass('active');
4594					}
4595					$hamburguerSideHeader.toggleClass('side-header-hide');
4596					$html.toggleClass('side-header-hide');
4597
4598					$window.trigger('resize');
4599				});
4600
4601				$('.hamburguer-close:not(.side-panel-toggle)').on('click', function(){
4602					$('.hamburguer-btn:not(.hamburguer-btn-side-header-mobile-show)').trigger('click');
4603				});				
4604				
4605				// Set Header Body Height when open mobile menu
4606				$('.header-nav-main nav').on('show.bs.collapse', function () {
4607				 	$(this).removeClass('closed');
4608
4609				 	// Add Mobile Menu Opened Class
4610				 	$('html').addClass('mobile-menu-opened');
4611
4612			 		$('.header-body').animate({
4613				 		height: ($('.header-body').outerHeight() + $('.header-nav-main nav').outerHeight(true)) + 10
4614				 	});
4615
4616				 	// Header Below Slider / Header Bottom Slider - Scroll to menu position
4617				 	if( $('#header').is('.header-bottom-slider, .header-below-slider') && !$('html').hasClass('sticky-header-active') ) {
4618				 		self.scrollToTarget( $('#header'), 0 );
4619				 	}
4620				});
4621
4622				// Set Header Body Height when collapse mobile menu
4623				$('.header-nav-main nav').on('hide.bs.collapse', function () {
4624				 	$(this).addClass('closed');
4625
4626				 	// Remove Mobile Menu Opened Class
4627				 	$('html').removeClass('mobile-menu-opened');
4628
4629			 		$('.header-body').animate({
4630				 		height: ($('.header-body').outerHeight() - $('.header-nav-main nav').outerHeight(true))
4631				 	}, function(){
4632				 		$(this).height('auto');
4633				 	});
4634				});
4635
4636				// Header Effect Shrink - Adjust header body height on mobile
4637				$window.on('stickyHeader.activate', function(){
4638					if( $window.width() < 992 && $header.hasClass('header-effect-shrink') ) {
4639						if( $('.header-btn-collapse-nav').attr('aria-expanded') == 'true' ) {
4640							$('.header-body').animate({
4641						 		height: ( $('.header-nav-main nav').outerHeight(true) + theme.StickyHeader.options.stickyHeaderContainerHeight ) + ( ($('.header-nav-bar').get(0)) ? $('.header-nav-bar').outerHeight() : 0 ) 
4642						 	});
4643						}
4644					}
4645				});
4646
4647				$window.on('stickyHeader.deactivate', function(){
4648					if( $window.width() < 992 && $header.hasClass('header-effect-shrink') ) {
4649						if( $('.header-btn-collapse-nav').attr('aria-expanded') == 'true' ) {
4650							$('.header-body').animate({
4651						 		height: headerBodyHeight + $('.header-nav-main nav').outerHeight(true) + 10
4652						 	});
4653						}
4654					}
4655				});
4656
4657				// Remove Open Class on Resize		
4658				$window.on('resize.removeOpen', function(e) {
4659					if( e.from == 'header-nav-click-to-open' ) {
4660						return;
4661					}
4662					
4663					setTimeout(function() {
4664						if( $window.width() > 991 ) {
4665							$header.find('.dropdown.open').removeClass('open');
4666						}
4667					}, 100);
4668				});
4669
4670				// Side Header - Change value of initial header body height
4671				$(document).ready(function(){
4672					if( $window.width() > 991 ) {
4673						var flag = false;
4674						
4675						$window.on('resize', function(e) {
4676							if( e.from == 'header-nav-click-to-open' ) {
4677								return;
4678							}
4679
4680							$header.find('.dropdown.open').removeClass('open');
4681
4682							if( $window.width() < 992 && flag == false ) {
4683								headerBodyHeight = $('.header-body').outerHeight();
4684								flag = true;
4685
4686								setTimeout(function(){
4687									flag = false;
4688								}, 500);
4689							}
4690						});
4691					}
4692				});
4693
4694				// Side Header - Set header height on mobile
4695				if( $html.hasClass('side-header') ) {
4696					if( $window.width() < 992 ) {
4697						$header.css({
4698							height: $('.header-body .header-container').outerHeight() + (parseInt( $('.header-body').css('border-top-width') ) + parseInt( $('.header-body').css('border-bottom-width') ))
4699						});
4700					}
4701
4702					$(document).ready(function(){
4703						$window.afterResize(function(){
4704							if( $window.width() < 992 ) {
4705								$header.css({
4706									height: $('.header-body .header-container').outerHeight() + (parseInt( $('.header-body').css('border-top-width') ) + parseInt( $('.header-body').css('border-bottom-width') ))
4707								});
4708							} else {
4709								$header.css({
4710									height: ''
4711								});
4712							}
4713						});
4714					});
4715				}
4716
4717				// Anchors Position
4718				$('[data-hash]').each(function() {
4719
4720					var target = $(this).attr('href'),
4721						offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0);
4722
4723					if($(target).get(0)) {
4724						$(this).on('click', function(e) {
4725							e.preventDefault();
4726
4727							if( !$(e.target).is('i') ) {
4728
4729								// Close Collapse if open
4730								$(this).parents('.collapse.show').collapse('hide');
4731
4732								// Close Side Header
4733								$hamburguerSideHeader.addClass('side-header-hide');
4734								$html.addClass('side-header-hide');
4735								
4736								$window.trigger('resize');
4737
4738								self.scrollToTarget(target, offset);
4739								
4740							}
4741
4742							return;
4743						});
4744					}
4745
4746				});
4747
4748				// Floating
4749				if($('#header.header-floating-icons').get(0)) {
4750
4751					$('#header.header-floating-icons [data-hash]').off().each(function() {
4752
4753						var target = $(this).attr('href'),
4754							offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0);
4755
4756						if($(target).get(0)) {
4757							$(this).on('click', function(e) {
4758								e.preventDefault();
4759
4760									$('html, body').animate({
4761										scrollTop: $(target).offset().top - offset
4762									}, 600, 'easeOutQuad', function() {
4763
4764									});
4765
4766								return;
4767							});
4768						}
4769
4770					});
4771
4772				}
4773
4774				// Side Panel Toggle
4775				if( $('.side-panel-toggle').get(0) ) {
4776					var init_html_class = $('html').attr('class');
4777
4778					$('.side-panel-toggle').on('click', function(e){
4779						var extra_class = $(this).data('extra-class'),
4780							delay       = ( extra_class ) ? 100 : 0;
4781
4782						e.preventDefault();
4783
4784						if( $(this).hasClass('active') ) {
4785							$('html').removeClass('side-panel-open');
4786							$('.hamburguer-btn.side-panel-toggle:not(.side-panel-close)').removeClass('active');
4787							return false;
4788						}
4789
4790						if( extra_class ) {
4791							$('.side-panel-wrapper').css('transition','none');
4792							$('html')
4793								.removeClass()
4794								.addClass( init_html_class )
4795								.addClass( extra_class );
4796						}
4797
4798						setTimeout(function(){
4799							$('.side-panel-wrapper').css('transition','');
4800							$('html').toggleClass('side-panel-open');
4801						}, delay);
4802					});
4803
4804					$(document).on('click', function(e){
4805						if( !$(e.target).closest('.side-panel-wrapper').get(0) && !$(e.target).hasClass('side-panel-toggle') ) {
4806							$('.hamburguer-btn.side-panel-toggle:not(.side-panel-close)').removeClass('active');
4807							$('html').removeClass('side-panel-open');
4808						}
4809					});
4810				}
4811
4812				return this;
4813			},
4814
4815			scrollToTarget: function(target, offset) {
4816				var self = this;
4817
4818				$('body').addClass('scrolling');
4819
4820				$('html, body').animate({
4821					scrollTop: $(target).offset().top - offset
4822				}, self.options.scrollDelay, self.options.scrollAnimation, function() {
4823					$('body').removeClass('scrolling');
4824				});
4825
4826				return this;
4827
4828			}
4829
4830		}
4831
4832	});
4833
4834}).apply(this, [window.theme, jQuery]);
4835
4836
4837// Newsletter
4838(function(theme, $) {
4839
4840	theme = theme || {};
4841
4842	var initialized = false;
4843
4844	$.extend(theme, {
4845
4846		Newsletter: {
4847
4848			defaults: {
4849				wrapper: $('#newsletterForm')
4850			},
4851
4852			initialize: function($wrapper, opts) {
4853				if (initialized) {
4854					return this;
4855				}
4856
4857				initialized = true;
4858				this.$wrapper = ($wrapper || this.defaults.wrapper);
4859
4860				this
4861					.setOptions(opts)
4862					.build();
4863
4864				return this;
4865			},
4866
4867			setOptions: function(opts) {
4868				this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options')));
4869
4870				return this;
4871			},
4872
4873			build: function() {
4874				if (!($.isFunction($.fn.validate))) {
4875					return this;
4876				}
4877
4878				var self = this,
4879					$email = self.$wrapper.find('#newsletterEmail'),
4880					$success = $('#newsletterSuccess'),
4881					$error = $('#newsletterError');
4882
4883				self.$wrapper.validate({
4884					submitHandler: function(form) {
4885
4886						$.ajax({
4887							type: 'POST',
4888							url: self.$wrapper.attr('action'),
4889							data: {
4890								'email': $email.val()
4891							},
4892							dataType: 'json',
4893							success: function(data) {
4894								if (data.response == 'success') {
4895
4896									$success.removeClass('d-none');
4897									$error.addClass('d-none');
4898
4899									$email
4900										.val('')
4901										.blur()
4902										.closest('.control-group')
4903										.removeClass('success')
4904										.removeClass('error');
4905
4906								} else {
4907
4908									$error.html(data.message);
4909									$error.removeClass('d-none');
4910									$success.addClass('d-none');
4911
4912									$email
4913										.blur()
4914										.closest('.control-group')
4915										.removeClass('success')
4916										.addClass('error');
4917
4918								}
4919							}
4920						});
4921
4922					},
4923					rules: {
4924						newsletterEmail: {
4925							required: true,
4926							email: true
4927						}
4928					},
4929					errorPlacement: function(error, element) {
4930
4931					}
4932				});
4933
4934				return this;
4935			}
4936
4937		}
4938
4939	});
4940
4941}).apply(this, [window.theme, jQuery]);
4942
4943// Search
4944(function(theme, $) {
4945
4946	theme = theme || {};
4947
4948	var initialized = false;
4949
4950	$.extend(theme, {
4951
4952		Search: {
4953
4954			defaults: {
4955				wrapper: $('#searchForm')
4956			},
4957
4958			initialize: function($wrapper, opts) {
4959				if (initialized) {
4960					return this;
4961				}
4962
4963				initialized = true;
4964				this.$wrapper = ($wrapper || this.defaults.wrapper);
4965
4966				this
4967					.setOptions(opts)
4968					.build();
4969
4970				return this;
4971			},
4972
4973			setOptions: function(opts) {
4974				this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options')));
4975
4976				return this;
4977			},
4978
4979			build: function() {
4980				if (!($.isFunction($.fn.validate))) {
4981					return this;
4982				}
4983
4984				this.$wrapper.validate({
4985					errorPlacement: function(error, element) {}
4986				});
4987
4988				// Search Reveal
4989				$('.header-nav-features-search-reveal').each(function() {
4990
4991					var $el = $(this)
4992						$header = $('#header'),
4993						$html = $('htmnl');
4994
4995					$el.find('.header-nav-features-search-show-icon').on('click', function() {
4996						$el.addClass('show');
4997						$header.addClass('search-show');
4998						$html.addClass('search-show');
4999						$('#headerSearch').focus();
5000					});
5001
5002					$el.find('.header-nav-features-search-hide-icon').on('click', function() {
5003						$el.removeClass('show');
5004						$header.removeClass('search-show');
5005						$html.removeClass('search-show');
5006					});
5007
5008				});
5009
5010				return this;
5011			}
5012
5013		}
5014
5015	});
5016
5017}).apply(this, [window.theme, jQuery]);
5018
5019// Sticky Header
5020(function(theme, $) {
5021
5022	theme = theme || {};
5023
5024	var initialized = false;
5025
5026	$.extend(theme, {
5027
5028		StickyHeader: {
5029
5030			defaults: {
5031				wrapper: $('#header'),
5032				headerBody: $('#header .header-body'),
5033				stickyEnabled: true,
5034				stickyEnableOnBoxed: true,
5035				stickyEnableOnMobile: true,
5036				stickyStartAt: 0,
5037				stickyStartAtElement: false,
5038				stickySetTop: 0,
5039				stickyEffect: '',
5040				stickyHeaderContainerHeight: false,
5041				stickyChangeLogo: false,
5042				stickyChangeLogoWrapper: true
5043			},
5044
5045			initialize: function($wrapper, opts) {
5046				if (initialized) {
5047					return this;
5048				}
5049
5050				initialized = true;
5051				this.$wrapper = ($wrapper || this.defaults.wrapper);
5052
5053				this
5054					.setOptions(opts)
5055					.build()
5056					.events();
5057
5058				return this;
5059			},
5060
5061			setOptions: function(opts) {
5062				this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options')));
5063
5064				return this;
5065			},
5066
5067			build: function() {
5068				if (!this.options.stickyEnableOnBoxed && $('html').hasClass('boxed') || $('html').hasClass('side-header-hamburguer-sidebar') || !this.options.stickyEnabled) {
5069					return this;
5070				}
5071
5072				var self = this,
5073					$html = $('html'),
5074					$window = $(window),
5075					sideHeader = $html.hasClass('side-header'),
5076					initialHeaderTopHeight = self.options.wrapper.find('.header-top').outerHeight(),
5077					initialHeaderContainerHeight = self.options.wrapper.find('.header-container').outerHeight(),
5078					minHeight;
5079
5080				// HTML Classes
5081				$html.addClass('sticky-header-enabled');
5082
5083				if (parseInt(self.options.stickySetTop) < 0) {
5084					$html.addClass('sticky-header-negative');
5085				}
5086
5087				// Set Start At
5088				if(self.options.stickyStartAtElement) {
5089
5090					var $stickyStartAtElement = $(self.options.stickyStartAtElement);
5091
5092					$(window).on('scroll resize', function() {
5093						self.options.stickyStartAt = $stickyStartAtElement.offset().top;
5094					});
5095
5096					$(window).trigger('resize');
5097				}
5098
5099				// Define Min Height value
5100				if( self.options.wrapper.find('.header-top').get(0) ) {
5101					minHeight = ( initialHeaderTopHeight + initialHeaderContainerHeight );
5102				} else {
5103					minHeight = initialHeaderContainerHeight;
5104				}
5105
5106				// Set Wrapper Min-Height
5107				if( !sideHeader ) {
5108					if( !$('.header-logo-sticky-change').get(0) ) {
5109						self.options.wrapper.css('height', self.options.headerBody.outerHeight());
5110					} else {
5111						$window.on('stickyChangeLogo.loaded', function(){
5112							self.options.wrapper.css('height', self.options.headerBody.outerHeight());
5113						});
5114					}
5115
5116					if( self.options.stickyEffect == 'shrink' ) {
5117						
5118						// Prevent wrong visualization of header when reload on middle of page
5119						$(document).ready(function(){
5120							if( $window.scrollTop() >= self.options.stickyStartAt ) {
5121								self.options.wrapper.find('.header-container').on('transitionend webkitTransitionEnd oTransitionEnd', function(){
5122									self.options.headerBody.css('position', 'fixed');
5123								});
5124							} else {
5125								self.options.headerBody.css('position', 'fixed');
5126							}
5127						});
5128
5129						self.options.wrapper.find('.header-container').css('height', initialHeaderContainerHeight);
5130						self.options.wrapper.find('.header-top').css('height', initialHeaderTopHeight);
5131					}
5132				}
5133
5134				// Sticky Header Container Height
5135				if( self.options.stickyHeaderContainerHeight ) {
5136					self.options.wrapper.find('.header-container').css('height', self.options.wrapper.find('.header-container').outerHeight());
5137				}
5138
5139				// Boxed
5140				if($html.hasClass('boxed') && self.options.stickyEffect == 'shrink') {
5141					if( (parseInt(self.options.stickyStartAt) == 0) && $window.width() > 991) {
5142						self.options.stickyStartAt = 30;
5143					}
5144
5145					// Set Header Body Position Absolute
5146					self.options.headerBody.css('position','absolute');
5147
5148					// Set position absolute because top margin from boxed layout
5149					$window.on('scroll', function(){
5150						if( $window.scrollTop() > $('.body').offset().top ) {
5151							self.options.headerBody.css({
5152								'position' : 'fixed',
5153								'top' : 0
5154							});								
5155						} else {
5156							self.options.headerBody.css({
5157								'position' : 'absolute',
5158								'top' : 0
5159							});
5160						}
5161					});
5162				}
5163
5164				// Check Sticky Header / Flags prevent multiple runs at same time
5165				var activate_flag   = true,
5166					deactivate_flag = false;
5167
5168				self.checkStickyHeader = function() {
5169					if( $window.width() > 991 && $html.hasClass('side-header') ) {
5170						$html.removeClass('sticky-header-active');
5171						activate_flag = true;
5172						return;
5173					}
5174
5175					if ($window.scrollTop() >= parseInt(self.options.stickyStartAt)) {
5176						if( activate_flag ) {
5177							self.activateStickyHeader();
5178							activate_flag = false;
5179							deactivate_flag = true;
5180						}
5181					} else {
5182						if( deactivate_flag ) {
5183							self.deactivateStickyHeader();
5184							deactivate_flag = false;
5185							activate_flag = true;
5186						}
5187					}
5188				};
5189				
5190				// Activate Sticky Header
5191				self.activateStickyHeader = function() {
5192
5193					if ($window.width() < 992) {
5194						if (!self.options.stickyEnableOnMobile) {
5195							self.deactivateStickyHeader();
5196							return;
5197						}
5198					} else {
5199						if (sideHeader) {
5200							self.deactivateStickyHeader();
5201							return;
5202						}
5203					}
5204
5205					$html.addClass('sticky-header-active');
5206
5207					// Sticky Effect - Reveal
5208					if( self.options.stickyEffect == 'reveal' ) {
5209
5210						self.options.headerBody.css('top','-' + self.options.stickyStartAt + 'px');
5211
5212						self.options.headerBody.animate({
5213							top: self.options.stickySetTop
5214						}, 400, function() {});
5215
5216					}
5217
5218					// Sticky Effect - Shrink
5219					if( self.options.stickyEffect == 'shrink' ) {
5220
5221						// If Header Top
5222						if( self.options.wrapper.find('.header-top').get(0) ) {
5223							self.options.wrapper.find('.header-top').css({
5224								height: 0,
5225								'min-height': 0,
5226								overflow: 'hidden'
5227							});
5228						}
5229
5230						// Header Container
5231						if( self.options.stickyHeaderContainerHeight ) {
5232							self.options.wrapper.find('.header-container').css({
5233								height: self.options.stickyHeaderContainerHeight,
5234								'min-height': 0
5235							});
5236						} else {
5237							self.options.wrapper.find('.header-container').css({
5238								height: (initialHeaderContainerHeight / 3) * 2, // two third of container height
5239								'min-height': 0
5240							});
5241
5242							var y = initialHeaderContainerHeight - ((initialHeaderContainerHeight / 3) * 2);
5243							$('.main').css({
5244								transform: 'translate3d(0, -'+ y +'px, 0)',
5245								transition: 'ease transform 300ms'
5246							});
5247
5248							if($html.hasClass('boxed')) {
5249								self.options.headerBody.css('position','fixed');
5250							}
5251						}
5252
5253					}
5254
5255					self.options.headerBody.css('top', self.options.stickySetTop);
5256
5257					if (self.options.stickyChangeLogo) {
5258						self.changeLogo(true);
5259					}
5260
5261					// Set Elements Style
5262					$('[data-sticky-header-style]').each(function() {
5263						var $el = $(this),
5264							css = theme.fn.getOptions($el.data('sticky-header-style-active')),
5265							opts = theme.fn.getOptions($el.data('sticky-header-style'));
5266
5267						if( $window.width() > opts.minResolution ) {
5268							$el.css(css);
5269						}
5270					});
5271
5272					$.event.trigger({
5273						type: 'stickyHeader.activate'
5274					});
5275				};
5276
5277				// Deactivate Sticky Header
5278				self.deactivateStickyHeader = function() {
5279
5280					$html.removeClass('sticky-header-active');
5281
5282					// Sticky Effect - Shrink
5283					if( self.options.stickyEffect == 'shrink' ) {
5284
5285						// Boxed Layout
5286						if( $html.hasClass('boxed') ) {
5287
5288							// Set Header Body Position Absolute
5289							self.options.headerBody.css('position','absolute');
5290
5291							if( $window.scrollTop() > $('.body').offset().top ) {
5292								// Set Header Body Position Fixed
5293								self.options.headerBody.css('position','fixed');								
5294							}
5295
5296						} else {
5297							// Set Header Body Position Fixed
5298							self.options.headerBody.css('position','fixed');
5299						}
5300
5301						// If Header Top
5302						if( self.options.wrapper.find('.header-top').get(0) ) {
5303							self.options.wrapper.find('.header-top').css({
5304								height: initialHeaderTopHeight,
5305								overflow: 'visible'
5306							});
5307						}
5308
5309						// Header Container
5310						self.options.wrapper.find('.header-container').css({
5311							height: initialHeaderContainerHeight
5312						});
5313
5314					}
5315
5316					self.options.headerBody.css('top', 0);
5317
5318					if (self.options.stickyChangeLogo) {
5319						self.changeLogo(false);
5320					}
5321
5322					// Set Elements Style
5323					$('[data-sticky-header-style]').each(function() {
5324						var $el = $(this),
5325							css = theme.fn.getOptions($el.data('sticky-header-style-deactive')),
5326							opts = theme.fn.getOptions($el.data('sticky-header-style'));
5327
5328						if( $window.width() > opts.minResolution ) {
5329							$el.css(css);
5330						}
5331					});
5332
5333					$.event.trigger({
5334						type: 'stickyHeader.deactivate'
5335					});
5336				};
5337
5338				// Always Sticky
5339				if (parseInt(self.options.stickyStartAt) <= 0) {
5340					self.activateStickyHeader();
5341				}
5342
5343				// Notice Top Bar
5344				if ($('.notice-top-bar').get(0)) {
5345					self.options.stickyStartAt = $('.notice-top-bar').outerHeight();
5346				}
5347
5348				// Set Logo
5349				if (self.options.stickyChangeLogo) {
5350
5351					var $logoWrapper = self.options.wrapper.find('.header-logo'),
5352						$logo = $logoWrapper.find('img'),
5353						logoWidth = $logo.attr('width'),
5354						logoHeight = $logo.attr('height'),
5355						logoSmallTop = parseInt($logo.attr('data-sticky-top') ? $logo.attr('data-sticky-top') : 0),
5356						logoSmallWidth = parseInt($logo.attr('data-sticky-width') ? $logo.attr('data-sticky-width') : 'auto'),
5357						logoSmallHeight = parseInt($logo.attr('data-sticky-height') ? $logo.attr('data-sticky-height') : 'auto');
5358
5359					if (self.options.stickyChangeLogoWrapper) {
5360						$logoWrapper.css({
5361							'width': $logo.outerWidth(true),
5362							'height': $logo.outerHeight(true)
5363						});
5364					}
5365
5366					self.changeLogo = function(activate) {
5367						if(activate) {
5368							
5369							$logo.css({
5370								'top': logoSmallTop,
5371								'width': logoSmallWidth,
5372								'height': logoSmallHeight
5373							});
5374
5375						} else {
5376							
5377							$logo.css({
5378								'top': 0,
5379								'width': logoWidth,
5380								'height': logoHeight
5381							});
5382
5383						}
5384					}
5385
5386					$.event.trigger({
5387						type: 'stickyChangeLogo.loaded'
5388					});
5389
5390				}
5391
5392				// Side Header
5393				var headerBodyHeight,
5394					flag = false;
5395
5396				self.checkSideHeader = function() {
5397					if($window.width() < 992 && flag == false) {
5398						headerBodyHeight = self.options.headerBody.height();
5399						flag = true;
5400					}
5401
5402					if(self.options.stickyStartAt == 0 && sideHeader) {
5403						self.options.wrapper.css('min-height', 0);
5404					}
5405
5406					if(self.options.stickyStartAt > 0 && sideHeader && $window.width() < 992) {
5407						self.options.wrapper.css('min-height', headerBodyHeight);
5408					}
5409				}
5410
5411				return this;
5412			},
5413
5414			events: function() {
5415				var self = this;
5416
5417				if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || $('html').hasClass('side-header-hamburguer-sidebar') || !this.options.stickyEnabled) {
5418					return this;
5419				}
5420
5421				if (!self.options.alwaysStickyEnabled) {
5422					$(window).on('scroll resize', function() {
5423						self.checkStickyHeader();
5424					});
5425				} else {
5426					self.activateStickyHeader();
5427				}
5428
5429				$(window).on('load resize', function(){
5430					self.checkSideHeader();
5431				});
5432
5433				return this;
5434			}
5435
5436		}
5437
5438	});
5439
5440}).apply(this, [window.theme, 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.