PageSourceSearch

https://shop.unikat-hoengg.ch/assets/javascripts/scripts.js?ts=1765258328

js unikat-hoengg.ch collected 2026-10-08 07:39:31 UTC 140,488 bytes, 4,763 lines download raw bytes

1/** ********************************************** **
2	@Author			Dorin Grigoras
3	@Website		www.stepofweb.com
4	@Last Update	Thursay, February 22, 2018
5
6	NOTE! 	Do not change anything here if you want to
7			be able to update in the future! Please use
8			your custom script (eg. custom.js).
9
10
11	TABLE CONTENTS
12	-------------------------------
13
14
15	INLINE SCRIPTS
16	-------------------------------
17		COUNT TO
18			https://github.com/mhuggins/jquery-countTo
19
20		BROWSER DETECT
21
22		Appear
23			https://github.com/bas2k/jquery.appear/
24			
25		Parallax v1.1.3
26			http://www.ianlunn.co.uk/plugins/jquery-parallax/
27
28		jQuery Easing v1.3
29			http://gsgd.co.uk/sandbox/jquery/easing/
30
31		WOW - v1.0.3
32			http://mynameismatthieu.com/WOW/
33
34		Modernizr 3.3.1
35			http://modernizr.com/download/#-csstransforms3d-csstransitions-video-touch-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
36*************************************************** **/
37	window.width = jQuery(window).width();
38	window.height 	= jQuery(window).height();
39
40	/* Init */
41	jQuery(window).ready(function () {
42		/* jQuery.browserDetect(); ???*/
43
44		// Load Bootstrap JS
45		loadScript(plugin_path + 'bootstrap/js/bootstrap.min.js', function() {
46
47			// Load Material Design Js
48			if(jQuery("body").hasClass('enable-materialdesign')) {
49				loadScript(plugin_path + 'mdl/material.min.js');
50			}
51
52			// Init
53			Init(false);
54
55		});
56
57
58		/* --- */
59		if(jQuery("body").hasClass("smoothscroll") && navigator.platform.indexOf('Mac') < 0) {
60
61			loadScript(plugin_path + 'smoothscroll.js', function() {
62				jQuery.smoothScroll();
63			});
64
65		}
66		/* --- */
67	});
68
69
70/** Init
71	Ajax Reinit:		Init(true);
72 **************************************************************** **/
73	function Init(is_ajax) {
74
75		// First Load Only
76		if(is_ajax != true) {
77		
78			_afterResize();
79			_slider_full();
80			_topNav();
81			_megaNavHorizontal();
82			_sideNav();
83			_stickyFooter();
84			_infiniteScroll();
85
86		}
87
88		// Reinit on Ajax
89		_owl_carousel();
90		_flexslider();
91		_popover();
92		_lightbox();
93		_mixitup();
94		_animate();
95		_onepageNav();
96		_scrollTo(false, 0);
97		_parallax();
98		_video();
99		_youtubeBG();
100		_toggle();
101		_placeholder();
102		_wrotate();
103		_lazyload();
104		_misc();
105		_countDown();
106		_masonryGallery();
107		_toastr(false,false,false,false);
108		_charts();
109		_select2();
110		_form();
111		_pickers();
112		_editors();
113		_pajinate();
114		_zoom();
115		_autosuggest();
116		_stepper();
117		_slimScroll();
118		_modalAutoLoad();
119		_bgimage();
120		_stickyKit();
121		_cookie_alert();
122		_widget_flickr();
123		_widget_twitter();
124		_widget_facebook();
125		_widget_dribbble();
126		_widget_media();
127
128		/** Bootstrap Tooltip **/ 
129		jQuery("a[data-toggle=tooltip], button[data-toggle=tooltip], span[data-toggle=tooltip]").tooltip();
130	}
131
132
133
134/** Preloader
135 **************************************************************** **/
136	if(jQuery('#preloader').length > 0) {
137
138		jQuery(window).on("load", function() {
139			
140			jQuery('#preloader').fadeOut(1000, function() {
141				jQuery('#preloader').remove();
142			});
143
144			// setTimeout(function() {}, 1000); 
145		  
146		});
147
148	}
149
150
151
152/** After Resize
153 **************************************************************** **/
154	function _afterResize() {
155
156		jQuery(window).on("load", function() {
157			"use strict";
158
159			// On Resize
160			jQuery(window).resize(function() {
161
162				if(window.afterResizeApp) {
163					clearTimeout(window.afterResizeApp);
164				}
165
166				window.afterResizeApp = setTimeout(function() {
167
168					/**
169						After Resize Code
170						.................
171					**/
172
173					_slider_full();
174
175					window.width = jQuery(window).width();
176					window.height 	= jQuery(window).height();
177
178					// Resize Flex Slider if exists!
179					if(jQuery('.flexslider').length > 0) {
180						jQuery('.flexslider').resize();
181					}
182
183
184				}, 300);
185
186			});
187
188		});
189
190	}
191
192
193
194/** Load Script
195
196	USAGE
197	var pageInit = function() {}
198	loadScript(plugin_path + "script.js", function);
199
200	Load multiple scripts and call a final function
201	loadScript(plugin_path + "script1.js", function(){
202		loadScript(plugin_path + "script2.js", function(){
203			loadScript(plugin_path + "script3.js", function(){
204				loadScript(plugin_path + "script4.js", function);
205			});
206		});
207	});
208 **************************************************************** **/
209	var _arr 	= {};
210	function loadScript(scriptName, callback) {
211
212		if (!_arr[scriptName]) {
213			_arr[scriptName] = true;
214
215			var body 		= document.getElementsByTagName('body')[0];
216			var script 		= document.createElement('script');
217			script.type 	= 'text/javascript';
218			script.src 		= scriptName;
219
220			// then bind the event to the callback function
221			// there are several events for cross browser compatibility
222			// script.onreadystatechange = callback;
223			script.onload = callback;
224
225			// fire the loading
226			body.appendChild(script);
227
228		} else if (callback) {
229
230			callback();
231
232		}
233
234	};
235
236
237 
238
239
240
241
242/** 00. Slider Full Height
243 **************************************************************** **/
244	function _slider_full() {
245		_headerHeight = 0;
246
247		if(jQuery("#header").hasClass('transparent') || jQuery("#header").hasClass('translucent')) {
248			_headerHeight = 0;
249		} else {
250			_headerHeight = jQuery("#header").outerHeight();
251			
252			if(jQuery("#topBar").length > 0) {
253				_headerHeight = _headerHeight + jQuery("#topBar").outerHeight();
254			}
255		}
256
257		_screenHeight = jQuery(window).height() - _headerHeight;
258
259		if(jQuery("#header").hasClass('static'))
260			_screenHeight = jQuery(window).height();
261
262		if(jQuery("#slider").hasClass('halfheight')) {
263			jQuery("#slider.halfheight").height(_screenHeight / 2);
264		}
265
266		if(jQuery("#slider").hasClass('thirdheight')) {
267			jQuery("#slider.thirdheight").height(_screenHeight / 1.5);
268		}
269
270		if(jQuery("#slider").hasClass('fullheight')) {
271			jQuery("#slider.fullheight").height(_screenHeight);
272			jQuery("#slider.fullheight-min").css({"min-height":_screenHeight + "px"});
273		}
274
275		if(window.width < 960) {
276			jQuery("#slider.mobile-fullheight").height(_screenHeight);
277		}
278	}
279
280
281
282
283
284
285
286
287/** 01. Top Nav
288 **************************************************************** **/
289	function _topNav() {
290		window.scrollTop 	= 0;
291		window._cmScroll 		= 0;
292		var _header_el 		= jQuery("#header");
293
294		jQuery(window).scroll(function() {
295			_toTop();
296		});
297
298		/* Scroll To Top */
299		function _toTop() {
300			_scrollTop = jQuery(document).scrollTop();
301			
302			if(_scrollTop > 100) {
303
304				if(jQuery("#toTop").is(":hidden")) {
305					jQuery("#toTop").show();
306				}
307
308			} else {
309
310				if(jQuery("#toTop").is(":visible")) {
311					jQuery("#toTop").hide();
312				}
313
314			}
315
316		}
317
318
319		// Mobile Submenu
320		var addActiveClass 	= false;
321		jQuery("body").on("click", "#topMain a.dropdown-toggle", function(e) {
322			
323			if(jQuery(this).attr('href') == "#") {
324				e.preventDefault();
325			}
326
327			addActiveClass = jQuery(this).parent().hasClass("resp-active");
328			jQuery("#topMain").find(".resp-active").removeClass("resp-active");
329
330			if(!addActiveClass) {
331				jQuery(this).parents("li").addClass("resp-active");
332			}
333
334			return;
335
336		});
337
338
339		// Srearch
340		jQuery('li.search i.fa').click(function () {
341			if(jQuery('#header .search-box').is(":visible")) {
342				jQuery('#header .search-box').fadeOut(300);
343			} else {
344				jQuery('.search-box').fadeIn(300);
345				jQuery('#header .search-box form input').focus();
346
347				// hide quick cart if visible
348				if (jQuery('#header li.quick-cart div.quick-cart-box').is(":visible")) {
349					jQuery('#header li.quick-cart div.quick-cart-box').fadeOut(300);
350				}
351			}
352		}); 
353
354		// close search box on body click
355		if(jQuery('#header li.search i.fa').size() != 0) {
356			jQuery('#header .search-box, #header li.search i.fa').on('click', function(e){
357				e.stopPropagation();
358			});
359			
360			// 'esc' key
361			jQuery(document).keydown(function(e) {
362				var code = e.keyCode ? e.keyCode : e.which;
363				if(code == 27) {
364					// close search if visible
365					/*
366					if(jQuery('li.search .search-box').is(":visible")) {
367						jQuery('li.search .search-box').fadeOut(300);
368					}
369					*/
370					if(jQuery('#header .search-box').is(":visible")) {
371						jQuery('#header .search-box').fadeOut(300);
372					}
373				}
374			});
375
376			jQuery('body').on('click', function() {
377				/*
378				if(jQuery('#header li.search .search-box').is(":visible")) {
379					jQuery('#header .search-box').fadeOut(300);
380				}
381				*/
382				if(jQuery('#header .search-box').is(":visible")) {
383					jQuery('#header .search-box').fadeOut(300);
384				}
385			});
386		}
387
388		jQuery(document).bind("click", function() {
389			if(jQuery('#header li.search .search-box').is(":visible")) {
390				jQuery('#header .search-box').fadeOut(300);
391			}
392		});
393
394
395		// Close Fullscreen Search
396		jQuery("#closeSearch").bind("click", function(e) {
397			e.preventDefault();
398
399			jQuery('#header .search-box').fadeOut(300);
400		});
401
402
403
404		// Page Menu [mobile]
405		jQuery("button#page-menu-mobile").bind("click", function() {
406			jQuery(this).next('ul').slideToggle(150);
407		});
408
409
410		// Quick Cart
411		jQuery('#topNav').on("click", "li.quick-cart>a", function (e) {
412			e.preventDefault();
413
414			//var _quick_cart_box = jQuery('li.quick-cart div.quick-cart-box');
415			var _quick_cart_box = $(this).siblings('div.quick-cart-box');
416			var _quick_cart_box_all = jQuery('li.quick-cart div.quick-cart-box').not(_quick_cart_box);
417
418			if(_quick_cart_box.is(":visible")) {
419				_quick_cart_box.fadeOut(300);
420			} else {
421				_quick_cart_box_all.fadeOut(300);
422				_quick_cart_box.fadeIn(300);
423
424				// close search if visible
425				if(jQuery('li.search .search-box').is(":visible")) {
426					jQuery('.search-box').fadeOut(300);
427				}
428			}
429		});
430		// close quick cart on body click
431		if(jQuery('li.quick-cart>a').size() != 0) {
432			//jQuery('li.quick-cart').on('click', function(e){ /* this was just wrong */
433			jQuery('#header').on('click', '.quick-cart-box, li.quick-cart i.fa,li.quick-cart span.badge', function(e){
434				e.stopPropagation();
435			});
436			
437			// 'esc' key
438			jQuery(document).keydown(function(e) {
439				var code = e.keyCode ? e.keyCode : e.which;
440				if(code == 27) {
441					// close quick cart if visible
442					if (jQuery('li.quick-cart div.quick-cart-box').is(":visible")) {
443						jQuery('li.quick-cart div.quick-cart-box').fadeOut(300);
444					}
445				}
446			});
447
448			jQuery('body').on('click', function() {
449				if (jQuery('li.quick-cart div.quick-cart-box').is(":visible")) {
450					jQuery('li.quick-cart div.quick-cart-box').fadeOut(300);
451				}
452			});
453		}
454
455
456		// Page Menu [scrollTo]
457		jQuery("#page-menu ul.menu-scrollTo>li").bind("click", function(e) {
458
459			// calculate padding-top for scroll offset
460			var _href 	= jQuery('a', this).attr('href');
461			
462			if(!jQuery('a', this).hasClass('external')) {
463				e.preventDefault();
464
465				jQuery("#page-menu ul.menu-scrollTo>li").removeClass('active');
466				jQuery(this).addClass('active');
467
468				if(jQuery(_href).length > 0) {
469
470					_padding_top = 0;
471
472					if(jQuery("#header").hasClass('sticky')) {
473						_padding_top = jQuery(_href).css('padding-top');
474						_padding_top = _padding_top.replace('px', '');
475					}
476
477					jQuery('html,body').animate({scrollTop: jQuery(_href).offset().top - _padding_top}, 800, 'easeInOutExpo');
478
479				}
480
481			}
482
483		});
484	
485
486
487
488		// MOBILE TOGGLE BUTTON
489		window.currentScroll = 0;
490		jQuery("button.btn-mobile").bind("click", function(e) {
491			e.preventDefault();
492
493			jQuery(this).toggleClass('btn-mobile-active');
494			jQuery('html').removeClass('noscroll');
495			jQuery('#menu-overlay').remove();
496
497			if(jQuery(this).hasClass('btn-mobile-active')) {
498				jQuery('body').append('<div id="menu-overlay"></div>');
499
500				if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */
501					jQuery('html').addClass('noscroll');
502					window.currentScroll = jQuery(window).scrollTop();
503				}
504
505			} else {
506
507				if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */
508					jQuery('html,body').animate({scrollTop: currentScroll}, 300, 'easeInOutExpo');
509				}
510
511			}
512		});
513
514
515
516
517		// BOTTOM NAV
518		if(_header_el.hasClass('bottom')) {
519
520			// Add dropup class
521			_header_el.addClass('dropup');
522			window.homeHeight 	= jQuery(window).outerHeight() - 55;
523		
524
525			// sticky header
526			if(_header_el.hasClass('sticky')) {
527				window.isOnTop 		= true;
528
529
530				// if scroll is > 60%, remove class dropup
531				jQuery(window).scroll(function() {
532					if(jQuery(document).scrollTop() > window.homeHeight / 2) {
533						_header_el.removeClass('dropup');
534					} else {
535						_header_el.addClass('dropup');
536					}
537				});
538
539
540				// Add fixed|not fixed & dropup|no dropup
541				jQuery(window).scroll(function() {
542					if(jQuery(document).scrollTop() > window.homeHeight) {
543						if(window.isOnTop === true) {
544							jQuery('#header').addClass('fixed');
545							_header_el.removeClass('dropup');
546							window.isOnTop = false;
547						}
548					} else {
549						if(window.isOnTop === false) {
550							jQuery('#header').removeClass('fixed');
551							_header_el.addClass('dropup');
552							window.isOnTop = true;
553						}
554					}
555				});
556
557				// get window height on resize
558				jQuery(window).resize(function() {
559					window.homeHeight = jQuery(window).outerHeight();
560				});
561
562			}
563
564		} else
565
566		// STICKY
567		if(_header_el.hasClass('sticky')) {
568
569			_topBar_H 	= jQuery("#topBar").outerHeight() || 0;
570
571			// Force fixed header on mobile to avoid "jump" effect.
572			if(window.width <= 992 && _topBar_H < 1) {
573
574				var _scrollTop 	= jQuery(document).scrollTop();
575					_header_H 	= _header_el.outerHeight() || 0;
576
577					_header_el.addClass('fixed');
578					jQuery('body').css({"padding-top":_header_H+"px"});
579
580			}
581
582
583			// Header Switch - outside of scroll
584			if(_header_el.hasClass('transparent')) {
585				var _el 					= jQuery("#topNav div.nav-main-collapse"),
586					_data_switch_default 	= _el.attr('data-switch-default') 	|| '',
587					_data_switch_scroll 	= _el.attr('data-switch-scroll') 	|| '';
588			}
589
590
591			jQuery(window).scroll(function() {
592
593				if((window.width > 992 && _topBar_H < 1) || _topBar_H > 0) { // 992 to disable on mobile
594
595					var _scrollTop 	= jQuery(document).scrollTop();
596
597					if(_scrollTop > _topBar_H) {
598						_header_el.addClass('fixed');
599
600						_header_H = _header_el.outerHeight() || 0;
601
602						if(!_header_el.hasClass('transparent') && !_header_el.hasClass('translucent')) {
603							jQuery('body').css({"padding-top":_header_H+"px"});
604						}
605
606					} else {
607						if(!_header_el.hasClass('transparent') && !_header_el.hasClass('translucent')) {
608							jQuery('body').css({"padding-top":"0px"});
609						}
610
611						_header_el.removeClass('fixed');
612					}
613
614				}
615
616
617
618				// SWITCH DROPDOWN MENU CLASS ON SCROLL
619				if(_header_el.hasClass('transparent')) {
620
621					if(_data_switch_default != '' || _data_switch_scroll != '') {
622
623						if(_scrollTop > 0) {
624
625							if(window._cmScroll < 1) {
626
627								_el.removeClass(_data_switch_default, _data_switch_scroll).addClass(_data_switch_scroll);
628
629								// set to 1, we want to change classes once, not for each pixel on scroll
630								window._cmScroll = 1;
631
632							}
633
634						} else
635
636						if(_scrollTop < 1) {
637
638							_el.removeClass(_data_switch_default, _data_switch_scroll).addClass(_data_switch_default);
639
640							// Set back to 0
641							window._cmScroll = 0;
642
643						}
644
645					}
646
647
648				}
649
650
651			});
652
653		} else 
654
655
656		// REVEAL ON SCROLL UP
657		if(_header_el.hasClass('scroll')) {
658			jQuery('body').addClass('header-scroll-reveal');
659
660
661			// Hide Header on on scroll down
662			var didScroll;
663			var lastScrollTop 	= 0;
664			var delta 			= 5;
665			var _header_H 		= _header_el.outerHeight() || 0;
666
667
668			jQuery(window).scroll(function(event){
669				didScroll = true;
670			});
671
672			setInterval(function() {
673				if (didScroll) {
674					hasScrolled();
675					didScroll = false;
676				}
677			}, 100);
678
679			function hasScrolled() {
680				var st = $(this).scrollTop();
681
682				// Make sure they scroll more than delta
683				if(Math.abs(lastScrollTop - st) <= delta)
684					return;
685
686				// If they scrolled down and are past the navbar, add class .nav-up.
687				// This is necessary so you never see what is "behind" the navbar.
688				if (st > lastScrollTop && st > _header_H){
689					
690					// Scroll Down
691					_header_el.removeClass('nav-down').addClass('nav-up');
692				
693				} else {
694					
695					// Scroll Up
696					if(st + jQuery(window).height() < jQuery(document).height()) {
697						_header_el.removeClass('nav-up').addClass('nav-down');
698					}
699
700				}
701
702				lastScrollTop = st;
703			}
704
705		} else
706
707
708		// STATIC + TRANSPARENT
709		if(_header_el.hasClass('static') && _header_el.hasClass('transparent')) {
710
711			_topBar_H 	= jQuery("#topBar").outerHeight() || 0;
712
713			// Force fixed header on mobile to avoid "jump" effect.
714			if(window.width <= 992 && _topBar_H < 1) {
715
716				var _scrollTop 	= jQuery(document).scrollTop();
717					_header_H 	= _header_el.outerHeight() || 0;
718
719					_header_el.addClass('fixed');
720
721			}
722
723
724
725			jQuery(window).scroll(function() {
726
727				if((window.width > 992 && _topBar_H < 1) || _topBar_H > 0) { // 992 to disable on mobile
728
729					var _scrollTop 	= jQuery(document).scrollTop();
730
731					if(_scrollTop > _topBar_H) {
732						_header_el.addClass('fixed');
733
734						_header_H = _header_el.outerHeight() || 0;
735
736					} else {
737
738
739						_header_el.removeClass('fixed');
740					}
741
742				}
743
744			});
745
746
747
748		} else
749		
750		if(_header_el.hasClass('static')) {
751			// _header_H = _header_el.outerHeight() + "px";
752			// jQuery('body').css({"padding-top":_header_H});
753		}
754
755
756
757		// Slide Top
758		jQuery("#slidetop a.slidetop-toggle").bind("click", function() {
759			jQuery("#slidetop .container").slideToggle(150, function() {
760
761				if(jQuery("#slidetop .container").is(":hidden")) {
762					jQuery("#slidetop").removeClass('active');
763				} else {
764					jQuery("#slidetop").addClass('active');
765				}
766
767			});
768		});
769		// 'esc' key
770		jQuery(document).keyup(function(e) {
771			if(e.keyCode == 27) {
772				if(jQuery("#slidetop").hasClass("active")) {
773					jQuery("#slidetop .container").slideToggle(150, function() {
774						jQuery("#slidetop").removeClass('active');
775					});
776				}
777			}
778		});
779
780		// Slide Panel
781		jQuery("a#sidepanel_btn").bind("click", function(e) {
782			e.preventDefault();
783
784			_pos = "right";
785			if(jQuery("#sidepanel").hasClass('sidepanel-inverse')) {
786				_pos = "left";
787			}
788
789			if(jQuery("#sidepanel").is(":hidden")) {
790
791				jQuery("body").append('<span id="sidepanel_overlay"></span>');
792
793				if(_pos == "left") {
794					jQuery("#sidepanel").stop().show().animate({"left":"0px"}, 150);
795				} else {
796					jQuery("#sidepanel").stop().show().animate({"right":"0px"}, 150);
797				}
798
799			} else {
800
801				jQuery("#sidepanel_overlay").remove();
802
803				if(_pos == "left") {
804					jQuery("#sidepanel").stop().animate({"left":"-300px"}, 300);
805				} else {
806					jQuery("#sidepanel").stop().animate({"right":"-300px"}, 300);
807				}
808
809				setTimeout(function() {
810					jQuery("#sidepanel").hide();
811				}, 500);
812
813			}
814			
815			_sidepanel_overlay();
816
817		});
818		// button close
819		jQuery("#sidepanel_close").bind("click", function(e) {
820			e.preventDefault();
821			jQuery("a#sidepanel_btn").trigger('click');
822		});
823		// overlay click
824		function _sidepanel_overlay() {
825			jQuery("#sidepanel_overlay").unbind();
826			jQuery("#sidepanel_overlay").bind("click", function() {
827				jQuery("a#sidepanel_btn").trigger('click');
828			});
829		}
830		// 'esc' key
831		jQuery(document).keyup(function(e) {
832			if(e.keyCode == 27) {
833				if(jQuery("#sidepanel").is(":visible")) {
834					jQuery("a#sidepanel_btn").trigger('click');
835				}
836			}
837		});
838
839
840
841		/** OVERLAY MENU
842		 *************************** **/
843		if(jQuery("#menu_overlay_open").length > 0) {
844			var is_ie9 = jQuery('html').hasClass('ie9') ? true : false;
845
846			if(is_ie9 == true) {
847				jQuery("#topMain").hide();
848			}
849
850			// open
851			jQuery("#menu_overlay_open").bind("click", function(e) {
852				e.preventDefault();
853				
854				jQuery('body').addClass('show-menu');
855
856				if(is_ie9 == true) {
857					jQuery("#topMain").show();
858				}
859
860			});
861
862			// close
863			jQuery("#menu_overlay_close").bind("click", function(e) {
864				e.preventDefault();
865
866				if(jQuery('body').hasClass('show-menu')) {
867					jQuery('body').removeClass('show-menu');
868				}
869
870				if(is_ie9 == true) {
871					jQuery("#topMain").hide();
872				}
873
874			});
875
876			// 'esc' key
877			jQuery(document).keyup(function(e) {
878				if(e.keyCode == 27) {
879					if(jQuery('body').hasClass('show-menu')) {
880						jQuery('body').removeClass('show-menu');
881					}
882
883					if(is_ie9 == true) {
884						jQuery("#topMain").hide();
885					}
886				}
887			});
888
889		}
890
891		/** VERTICAL MENU SHOW|HIDE
892		 *************************** **/
893		// RTL supported!
894		if(jQuery("#sidebar_vertical_btn").length > 0) {
895			if(jQuery("body").hasClass('menu-vertical-hide')) {
896
897				// Determine the position (left or right?)
898				_paddingStatusL = jQuery("#mainMenu.sidebar-vertical").css('left');
899				_paddingStatusR = jQuery("#mainMenu.sidebar-vertical").css('right');
900
901				if(parseInt(_paddingStatusL) < 0) {
902					var _pos = "left";
903				} else
904
905				if(parseInt(_paddingStatusR) < 0) {
906					var _pos = "right";
907				}
908
909				else {
910					var _pos = "left";
911				}
912
913				// Show|Hide Vertical Menu
914				jQuery("#sidebar_vertical_btn").bind("click", function(e) {
915
916					_paddingStatus = jQuery("#mainMenu.sidebar-vertical").css(_pos);
917
918					if(parseInt(_paddingStatus) < 0) {
919						if(_pos == "right") {
920							jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"0px"}, 200);
921						} else {
922							jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"0px"}, 200);
923						}
924					} else {
925						if(_pos == "right") {
926							jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"-263px"}, 200);
927						} else {
928							jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"-263px"}, 200);
929						}
930					}
931				});
932
933				// Hide on scroll
934				jQuery(window).scroll(function() {
935
936					_paddingStatus = parseInt(jQuery("#mainMenu.sidebar-vertical").css(_pos));
937
938					if(_paddingStatus >= 0) {
939						if(_pos == "right") {
940							jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"-263px"}, 200);
941						} else {
942							jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"-263px"}, 200);
943						}
944					}
945
946				});
947
948			}
949		}
950
951		// quick cart & search for mobile - top calculate
952		// Quick Cart & top Search Fix (if #topBar exists).
953		if(jQuery("#topBar").length > 0) {
954			jQuery("#topNav ul").addClass('has-topBar');
955		}
956		
957		// Hide Cart & Search on Scroll
958		jQuery(window).scroll(function() {
959			if(window.width < 769) {
960				// hide quick cart if visible
961				if (jQuery('#header li.quick-cart div.quick-cart-box').is(":visible")) {
962					jQuery('#header li.quick-cart div.quick-cart-box').fadeOut(0);
963				}
964				// hide search if visible
965				if(jQuery('#header li.search .search-box').is(":visible")) {
966					jQuery('#header .search-box').fadeOut(0);
967				}
968			}
969		});
970	}
971
972
973
974
975
976
977
978/** Main Navigation
979 **************************************************************** **/
980	function _megaNavHorizontal() {
981
982		// WRAPPER MAIN MENU
983		if(jQuery("#wrapper nav.main-nav").length > 0) {
984
985			var _sliderWidth 	= jQuery("#slider").width(),
986				_sliderHeight 	= jQuery("#wrapper nav.main-nav").height();
987
988			// Submenu widh & height
989			jQuery("#wrapper nav.main-nav>div>ul>li>.main-nav-submenu").css({"min-height":_sliderHeight+"px"});
990			jQuery("#wrapper nav.main-nav>div>ul>li.main-nav-expanded>.main-nav-submenu").css({"width":_sliderWidth+"px"});
991
992			// SUBMENUS
993			jQuery("#wrapper nav.main-nav>div>ul>li").bind("click", function(e) {
994				var _this = jQuery(this);
995
996				if(!jQuery('div', _this).hasClass('main-nav-open')) {
997					jQuery("#wrapper nav.main-nav>div>ul>li>.main-nav-submenu").removeClass('main-nav-open');
998				}
999
1000				jQuery('div', _this).toggleClass('main-nav-open');
1001			});
1002
1003		}
1004
1005
1006
1007
1008
1009
1010		// HEADER MAIN MENU
1011		var _hsliderWidth 	= jQuery("#header>.container").width() - 278,
1012			_hsliderHeight 	= jQuery("#header nav.main-nav").height();
1013
1014		// Submenu widh & height
1015		jQuery("#header nav.main-nav>div>ul>li>.main-nav-submenu").css({"min-height":_hsliderHeight+"px"});
1016		jQuery("#header nav.main-nav>div>ul>li.main-nav-expanded>.main-nav-submenu").css({"width":_hsliderWidth+"px"});
1017
1018
1019		// SUBMENUS
1020		jQuery("#header nav.main-nav>div>ul>li").bind("click", function(e) {
1021			var _this = jQuery(this);
1022
1023			if(!jQuery('div', _this).hasClass('main-nav-open')) {
1024				jQuery("#header nav.main-nav>div>ul>li>.main-nav-submenu").removeClass('main-nav-open');
1025			}
1026
1027			jQuery('div', _this).toggleClass('main-nav-open');
1028		});
1029
1030
1031
1032
1033		// HEADER MAIN MENU
1034		if(window.width > 767) { //  desktop|tablet
1035
1036			jQuery("#header button.nav-toggle").mouseover(function(e) {
1037				e.preventDefault();
1038
1039				_initMainNav();
1040
1041			});
1042
1043
1044		} else { // mobile
1045
1046			jQuery("#header button.nav-toggle").bind("click", function(e) {
1047				e.preventDefault();
1048
1049				_initMainNav();
1050
1051			});
1052
1053		}
1054
1055        jQuery('body').on('click', '#header button.nav-toggle, #header nav.main-nav', function (e) {
1056            e.stopPropagation();
1057        });
1058
1059        jQuery("#header button.nav-toggle, #header nav.main-nav").mouseover(function(e) {
1060        	 e.stopPropagation();
1061        });
1062
1063
1064		jQuery(document).bind("click", function() {
1065
1066			_hideMainNav();
1067
1068		});
1069
1070
1071
1072		function _initMainNav() {
1073
1074			// remove overlay first, no matter what
1075			jQuery("#main-nav-overlay").remove();
1076		
1077			// open menu
1078			jQuery("#header nav.main-nav").addClass('min-nav-active');
1079
1080			// add overlay
1081			jQuery('body').append('<div id="main-nav-overlay"></div>');
1082
1083
1084			// Mobile menu open|close on click
1085			jQuery('#header button.nav-toggle-close').bind("click", function() {
1086				jQuery("#header nav.main-nav").removeClass('min-nav-active');
1087			});
1088
1089			// Close menu on hover
1090	        jQuery("#main-nav-overlay, #header").mouseover(function() {
1091
1092	        	_hideMainNav();
1093
1094	        });
1095
1096		}
1097
1098		function _hideMainNav() {
1099			jQuery("#main-nav-overlay").remove();
1100			jQuery("#header nav.main-nav").removeClass('min-nav-active');
1101		}
1102
1103
1104		// Menu Click
1105		jQuery("nav.main-nav>div>ul>li a").bind("click", function(e) {
1106			var _href = jQuery(this).attr('href');
1107
1108			if(_href == '#') {
1109				e.preventDefault();
1110			}
1111		});
1112	}
1113
1114
1115
1116
1117
1118
1119
1120/** 02. Side Nav
1121 **************************************************************** **/
1122	function _sideNav() {
1123
1124
1125		/* Mobile Button */
1126		jQuery("div.side-nav").each(function() {
1127			//var _t = jQuery('ul', this); //would open all sub-ULs
1128			var _t = jQuery(this).find('ul').first();
1129			jQuery('button', this).bind("click", function() {
1130				_t.slideToggle(300);
1131			});
1132		});
1133
1134
1135		/* Submenus */
1136		jQuery("div.side-nav li>a.dropdown-toggle").bind("click", function(e) {
1137		
1138			if(jQuery(this).attr('href') == '#') {
1139				e.preventDefault();
1140			}
1141
1142			jQuery(this).next('ul').slideToggle(200);
1143			jQuery(this).closest('li').toggleClass('active');
1144		});
1145
1146	}
1147
1148
1149
1150/** 02. Animate
1151
1152	EXAMPLE USAGE
1153	<img class="wow fadeInUp" data-wow-delay="0.1s" src="image.jpg" alt="" />
1154 **************************************************************** **/
1155	function _animate() {
1156
1157		if(jQuery("body").hasClass('enable-animation')) {
1158
1159			var wow = new WOW({
1160				boxClass: 		'wow',
1161				animateClass: 	'animated',
1162				offset: 		90,
1163				mobile: 		false, 
1164				live: 			true 
1165			});   
1166			
1167			wow.init();
1168
1169		}
1170
1171		// Count To
1172        jQuery(".countTo").appear(function(){
1173			var _t 					= jQuery(this),
1174				_from 				= _t.attr('data-from') 				|| 0,
1175				_speed 				= _t.attr('data-speed') 			|| 1300,
1176				_refreshInterval 	= _t.attr('data-refreshInterval') 	|| 60;
1177				
1178
1179            _t.countTo({
1180                from: 				parseInt(_from),
1181                to: 				_t.html(),
1182                speed: 				parseInt(_speed),
1183                refreshInterval: 	parseInt(_refreshInterval),
1184            });
1185            
1186        });
1187	}
1188
1189
1190
1191/** Onepage Nav
1192 **************************************************************** **/
1193	function _onepageNav() {
1194
1195
1196		// Top Navigation
1197		var _container1 = jQuery(".nav-onepage");
1198
1199		if(_container1.length > 0) {
1200
1201			loadScript(plugin_path + 'jquery.nav.min.js', function() {
1202
1203				jQuery(_container1).onePageNav({
1204					currentClass: 		'active',
1205					changeHash: 		false,
1206					scrollSpeed: 		750,
1207					scrollThreshold: 	0.5,
1208					filter: 			':not(.external)',
1209					easing: 			'easeInOutExpo'
1210				});
1211
1212				// Close Nav on menu click
1213				jQuery("#topMain.nav-onepage li>a").bind("click", function() {
1214					if(window.width < 960) {
1215						jQuery("button.btn-mobile").trigger('click');
1216					}
1217				});
1218
1219			});
1220		
1221		}
1222
1223
1224		// Bullet Navigation
1225		var _container2 = jQuery("#nav-bullet");
1226
1227		if(_container2.length > 0) {
1228
1229			loadScript(plugin_path + 'jquery.nav.min.js', function() {
1230
1231				jQuery(_container2).onePageNav({
1232					currentClass: 		'active',
1233					changeHash: 		false,
1234					scrollSpeed: 		750,
1235					scrollThreshold: 	0.5,
1236					filter: 			':not(.external)',
1237					easing: 			'easeInOutExpo'
1238				});
1239
1240			});
1241		
1242		}
1243
1244
1245	}
1246
1247
1248
1249/** 03. OWL Carousel
1250 **************************************************************** **/
1251	function _owl_carousel() {
1252		var _container = jQuery("div.owl-carousel");
1253
1254		if(_container.length > 0) {
1255
1256			loadScript(plugin_path + 'owl-carousel/owl.carousel.min.js', function() {
1257
1258				_container.each(function() {
1259
1260					var slider 		= jQuery(this);
1261					var options 	= slider.attr('data-plugin-options');
1262
1263					// Progress Bar
1264					var $opt = eval('(' + options + ')');  // convert text to json
1265
1266					if($opt.progressBar == 'true') {
1267						var afterInit = progressBar;
1268					} else {
1269						var afterInit = false;
1270					}
1271
1272					var defaults = {
1273						items: 					5,
1274						itemsCustom: 			false,
1275						itemsDesktop: 			[1199,4],
1276						itemsDesktopSmall: 		[980,3],
1277						itemsTablet: 			[768,2],
1278						itemsTabletSmall: 		false,
1279						itemsMobile: 			[479,1],
1280						singleItem: 			true,
1281						itemsScaleUp: 			false,
1282
1283						slideSpeed: 			200,
1284						paginationSpeed: 		800,
1285						rewindSpeed: 			1000,
1286
1287						autoPlay: 				false,
1288						stopOnHover: 			false,
1289
1290						navigation: 			false,
1291						navigationText: [
1292											'<i class="fa fa-angle-left"></i>',
1293											'<i class="fa fa-angle-right"></i>'
1294										],
1295						rewindNav: 				true,
1296						scrollPerPage: 			false,
1297
1298						pagination: 			true,
1299						paginationNumbers: 		false,
1300
1301						responsive: 			true,
1302						responsiveRefreshRate: 	200,
1303						responsiveBaseWidth: 	window,
1304
1305						baseClass: 				"owl-carousel",
1306						theme: 					"owl-theme",
1307
1308						lazyLoad: 				false,
1309						lazyFollow: 			true,
1310						lazyEffect: 			"fade",
1311
1312						autoHeight: 			false,
1313
1314						jsonPath: 				false,
1315						jsonSuccess: 			false,
1316
1317						dragBeforeAnimFinish: 	true,
1318						mouseDrag: 				true,
1319						touchDrag: 				true,
1320
1321						transitionStyle: 		false,
1322
1323						addClassActive: 		false,
1324
1325						beforeUpdate: 			false,
1326						afterUpdate: 			false,
1327						beforeInit: 			false,
1328						afterInit: 				afterInit,
1329						beforeMove: 			false,
1330						afterMove: 				(afterInit == false) ? false : moved,
1331						afterAction: 			false,
1332						startDragging: 			false,
1333						afterLazyLoad: 			false
1334					}
1335
1336					var config = jQuery.extend({}, defaults, options, slider.data("plugin-options"));
1337					slider.owlCarousel(config).addClass("owl-carousel-init");
1338					
1339
1340					// Progress Bar
1341					var elem = jQuery(this);
1342
1343					//Init progressBar where elem is $("#owl-demo")
1344					function progressBar(elem){
1345					  $elem = elem;
1346					  //build progress bar elements
1347					  buildProgressBar();
1348					  //start counting
1349					  start();
1350					}
1351				 
1352					//create div#progressBar and div#bar then prepend to $("#owl-demo")
1353					function buildProgressBar(){
1354					  $progressBar = jQuery("<div>",{
1355						id:"progressBar"
1356					  });
1357					  $bar = jQuery("<div>",{
1358						id:"bar"
1359					  });
1360					  $progressBar.append($bar).prependTo($elem);
1361					}
1362
1363					function start() {
1364					  //reset timer
1365					  percentTime = 0;
1366					  isPause = false;
1367					  //run interval every 0.01 second
1368					  tick = setInterval(interval, 10);
1369					};
1370
1371			 
1372					var time = 7; // time in seconds
1373					function interval() {
1374					  if(isPause === false){
1375						percentTime += 1 / time;
1376						$bar.css({
1377						   width: percentTime+"%"
1378						 });
1379						//if percentTime is equal or greater than 100
1380						if(percentTime >= 100){
1381						  //slide to next item 
1382						  $elem.trigger('owl.next')
1383						}
1384					  }
1385					}
1386				 
1387					//pause while dragging 
1388					function pauseOnDragging(){
1389					  isPause = true;
1390					}
1391				 
1392					//moved callback
1393					function moved(){
1394					  //clear interval
1395					  clearTimeout(tick);
1396					  //start again
1397					  start();
1398					}
1399
1400				});
1401
1402			});
1403
1404		}
1405
1406
1407
1408		// OWL CAROUSEL 2
1409		var _container2 = jQuery("div.owl-carousel-2");
1410
1411		if(_container2.length > 0) {
1412
1413			loadScript(plugin_path + 'owl-carousel-2/owl.carousel.min.js', function() {
1414
1415
1416				_container2.each(function() {
1417					var _this 		= jQuery(this),
1418						_options 	= _this.attr('data-plugin-options');
1419
1420					_defaults = {
1421					    loop: 					true,
1422					    margin: 				10,
1423					    nav: 					true,
1424
1425					    center: 				false,
1426					    mouseDrag: 				true,
1427					    touchDrag: 				true,
1428					    pullDrag: 				true,
1429					    freeDrag: 				false,
1430					    stagePadding: 			0,
1431					    merge: 					false,
1432					    mergeFit: 				true,
1433					    autoWidth: 				false,
1434					    startPosition: 			0,
1435					    URLhashListener: 		false,
1436					    navRewind: 				true,
1437					    navText: 				[
1438													'<i class="fa fa-angle-left"></i>',
1439													'<i class="fa fa-angle-right"></i>'
1440												],
1441						slideBy: 				1,
1442						dots: 					true,
1443						dotsEach: 				false,
1444						dotData: 				false,
1445						lazyLoad: 				false,
1446						lazyContent: 			false,
1447						autoplay: 				false,
1448						autoplayTimeout: 		3000,
1449						autoplayHoverPause: 	false,
1450						smartSpeed: 			250,
1451						//fluidSpeed: 			'Number',
1452						autoplaySpeed: 			false,
1453						navSpeed: 				false,
1454						//dotsSpeed: 			'Number/Boolean',
1455						dragEndSpeed: 			false,
1456						callbacks: 				true,
1457						responsiveRefreshRate: 	200,
1458						responsiveBaseElement: 	'#wrapper',
1459						responsiveClass: 		true,
1460						video: 					false,
1461						videoHeight: 			false,
1462						videoWidth: 			false,
1463						animateOut: 			false,
1464						animateIn: 				false,
1465						fallbackEasing: 		'swing',
1466						info: 					false,
1467						nestedItemSelector: 	false,
1468						itemElement: 			'div',
1469						navContainer: 			false,
1470						dotsContainer: 			false,
1471
1472						animateOut: 			"slideOutDown", 
1473						animateIn: 				"flipInX", 
1474
1475					    responsive:{
1476					        0:{
1477					            items:1
1478					        },
1479					        600:{
1480					            items:2
1481					        },
1482					        1000:{
1483					            items:5
1484					        }
1485					    }
1486					};
1487
1488
1489					var _config = jQuery.extend({}, _defaults, JSON.parse(_options));
1490					_this.owlCarousel(_config).addClass("owl-loaded");
1491
1492
1493				});
1494
1495
1496			});
1497
1498		}
1499
1500
1501	}
1502
1503	
1504/** 04. Flexslider
1505 **************************************************************** **/
1506	function _flexslider() {
1507		var _container = jQuery(".flexslider");
1508		
1509		if(_container.length > 0) {
1510
1511			loadScript(plugin_path + 'slider.flexslider/jquery.flexslider-min.js', function() {
1512
1513				if(jQuery().flexslider) {
1514					var	_controlNav 	= _container.attr('data-controlNav'),
1515						_slideshowSpeed = _container.attr('data-slideshowSpeed') || 7000,
1516						_pauseOnHover	= _container.attr('data-pauseOnHover') || false;
1517
1518					if(_pauseOnHover == "true") {
1519						_pauseOnHover = true;
1520					} else{
1521						_pauseOnHover = false;
1522					}
1523
1524					if(_controlNav == 'thumbnails') {
1525						_controlNav = 'thumbnails';
1526					} else
1527					if(_controlNav == 'true') {
1528						_controlNav = true;
1529					} else
1530					if(_controlNav == 'false') {
1531						_controlNav = false;
1532					} else {
1533						_controlNav = true;
1534					}
1535					
1536					if(_controlNav == 'thumbnails' || _controlNav == false) {
1537						_directionNav = false;
1538					} else {
1539						_directionNav = true;
1540					}
1541
1542					jQuery(_container).flexslider({
1543						animation		: "slide",
1544						controlNav		: _controlNav,
1545						slideshowSpeed	: parseInt(_slideshowSpeed) || 7000,
1546						directionNav 	: _directionNav,
1547						pauseOnHover	: _pauseOnHover,
1548						start: function(slider){
1549							jQuery('.flex-prev').html('<i class="fa fa-angle-left"></i>');
1550							jQuery('.flex-next').html('<i class="fa fa-angle-right"></i>');
1551						}
1552					});
1553
1554					// Resize Flex Slider if exists!
1555					_container.resize();
1556
1557				}
1558
1559			});
1560		}
1561	}
1562	
1563	
1564	
1565
1566
1567/** 04. Popover
1568 **************************************************************** **/
1569	function _popover() {
1570
1571			jQuery("a[data-toggle=popover]").bind("click", function(e) {
1572				jQuery('.popover-title .close').remove();
1573				e.preventDefault();
1574			});
1575
1576			var isVisible 	= false,
1577				clickedAway = false;
1578
1579
1580			jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover({
1581
1582					html: true,
1583					trigger: 'manual'
1584
1585				}).click(function(e) {
1586
1587					jQuery(this).popover('show');
1588					
1589					clickedAway = false;
1590					isVisible = true;
1591					e.preventDefault();
1592
1593				});
1594
1595				jQuery(document).click(function(e) {
1596					if(isVisible & clickedAway) {
1597
1598						jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide');
1599						isVisible = clickedAway = false;
1600
1601					} else {
1602
1603
1604						clickedAway = true;
1605
1606					}
1607
1608				});
1609
1610			jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover({
1611
1612				html: true,
1613				trigger: 'manual'
1614
1615			}).click(function(e) {
1616
1617				$(this).popover('show');
1618				$('.popover-title').append('<button type="button" class="close">&times;</button>');
1619				$('.close').click(function(e){
1620
1621					jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide');
1622
1623				});
1624
1625				e.preventDefault();
1626			});
1627
1628
1629		// jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover();
1630	}
1631
1632
1633
1634/** 05. LightBox
1635 **************************************************************** **/
1636	function _lightbox() {
1637		var _el = jQuery(".lightbox");
1638
1639		if(_el.length > 0) {
1640
1641			loadScript(plugin_path + 'magnific-popup/jquery.magnific-popup.min.js', function() {
1642
1643				if(typeof(jQuery.magnificPopup) == "undefined") {
1644					return false;
1645				}
1646
1647				jQuery.extend(true, jQuery.magnificPopup.defaults, {
1648					tClose: 		'Close',
1649					tLoading: 		'Loading...',
1650
1651					gallery: {
1652						tPrev: 		'Previous',
1653						tNext: 		'Next',
1654						tCounter: 	'%curr% / %total%'
1655					},
1656
1657					image: 	{ 
1658						tError: 	'Image not loaded!' 
1659					},
1660
1661					ajax: 	{ 
1662						tError: 	'Content not loaded!' 
1663					}
1664				});
1665
1666				_el.each(function() {
1667
1668					var _t 			= jQuery(this),
1669						options 	= _t.attr('data-plugin-options'),
1670						config		= {},
1671						defaults 	= {
1672							type: 				'image',
1673							fixedContentPos: 	false,
1674							fixedBgPos: 		false,
1675							mainClass: 			'mfp-no-margins mfp-with-zoom',
1676							closeOnContentClick: true,
1677							closeOnBgClick: 	true,
1678							image: {
1679								verticalFit: 	true
1680							},
1681
1682							zoom: {
1683								enabled: 		false,
1684								duration: 		300
1685							},
1686
1687							gallery: {
1688								enabled: false,
1689								navigateByImgClick: true,
1690								preload: 			[0,1],
1691								arrowMarkup: 		'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1692								tPrev: 				'Previous',
1693								tNext: 				'Next',
1694								tCounter: 			'<span class="mfp-counter">%curr% / %total%</span>'
1695							},
1696						};
1697
1698					if(_t.data("plugin-options")) {
1699						config = jQuery.extend({}, defaults, options, _t.data("plugin-options"));
1700					}
1701
1702					jQuery(this).magnificPopup(config);
1703
1704				});
1705
1706			});
1707
1708		}
1709
1710	}
1711
1712
1713
1714
1715/** 06. ScrollTo
1716 **************************************************************** **/
1717	function _scrollTo(to, offset) {
1718
1719		if(to == false) {
1720
1721			jQuery("a.scrollTo").bind("click", function(e) {
1722				e.preventDefault();
1723
1724				var href 	= jQuery(this).attr('href'),
1725					_offset	= jQuery(this).attr('data-offset') || 0;
1726
1727				if(href != '#' && href != '#top') {
1728					jQuery('html,body').animate({scrollTop: jQuery(href).offset().top - parseInt(_offset)}, 800, 'easeInOutExpo');
1729				}
1730
1731				if(href == '#top') {
1732					jQuery('html,body').animate({scrollTop: 0}, 800, 'easeInOutExpo');
1733				}
1734			});
1735
1736			jQuery("#toTop").bind("click", function(e) {
1737				e.preventDefault();
1738				jQuery('html,body').animate({scrollTop: 0}, 800, 'easeInOutExpo');
1739			});
1740		
1741		} else {
1742
1743			// USAGE: _scrollTo("#footer", 150);
1744			jQuery('html,body').animate({scrollTop: jQuery(to).offset().top - offset}, 800, 'easeInOutExpo');
1745
1746		}
1747	}
1748
1749
1750
1751
1752/** 07. Parallax
1753 **************************************************************** **/
1754	function _parallax() {
1755		/* OLD
1756		if(jQuery().parallax) {
1757
1758			// jQuery(".parallax-1").css("background-attachment", "fixed");
1759			jQuery(".parallax-1").parallax("50%", "0.1");
1760
1761			// jQuery(".parallax-2").css("background-attachment", "fixed");
1762			jQuery(".parallax-2").parallax("50%", "0.2");
1763
1764			// jQuery(".parallax-3").css("background-attachment", "fixed");
1765			jQuery(".parallax-3").parallax("50%", "0.3");
1766
1767			// jQuery(".parallax-4").css("background-attachment", "fixed");
1768			jQuery(".parallax-4").parallax("50%", "0.4");
1769
1770		}
1771		*/
1772		
1773		/* NEW */
1774		if(jQuery().parallax) {
1775
1776			jQuery(".parallax-auto, .parallax-1, .parallax-2, .parallax-3, .parallax-4, section.page-header.page-header-parallax").each(function() {
1777				var _t = jQuery(this);
1778
1779				jQuery(this).parallax("50%","0.2");
1780			});
1781
1782		}
1783		
1784
1785
1786
1787		/** Slider Parallax 
1788			Do not use overlay - will be very slow!
1789		 **************************** **/
1790		var _slider = jQuery('#slider');
1791
1792		if(_slider.length > 0) {
1793			if(_slider.hasClass('parallax-slider')) {
1794
1795				if(window.width < 768 && _slider.hasClass('pallax-slider-mobile-deisable')) {
1796					return false;
1797				}
1798
1799				var block_intro_top = _slider.offset().top;	
1800			
1801				jQuery(window).scroll(function() {
1802
1803					var _currentTop = jQuery(document).scrollTop(),
1804						_offset 	= _slider.attr('data-parallax-offset') || 0;
1805					
1806					if(_currentTop < 768) {
1807						var _sliderH 	= jQuery('#slider').height();
1808
1809						jQuery('#slider>div').css('top', (_currentTop*0.5 - Number(_offset)));
1810						if(!_slider.hasClass('parallax-slider-noopacity')) {
1811							jQuery('#slider>div').css('opacity', (1 - _currentTop/_sliderH*1));
1812						}
1813					}
1814
1815				});
1816		
1817			}
1818		}
1819
1820	}
1821
1822
1823
1824
1825/** 07. Video
1826 **************************************************************** **/
1827	function _video() {
1828
1829		if(jQuery("section.section-video").length > 0) {
1830			var _t = jQuery("section.section-video .section-container-video>video");
1831				_w = jQuery(window).width();
1832
1833			_t.width(_w);
1834			
1835		}
1836
1837	}
1838
1839
1840
1841/** 07. Youtube Backround
1842 **************************************************************** **/
1843	function _youtubeBG() {
1844		var _container = jQuery('#YTPlayer');
1845		
1846		if(_container.length > 0) {
1847			loadScript(plugin_path + 'jquery.mb.YTPlayer.min.js', function() {
1848
1849
1850				if(jQuery().mb_YTPlayer) {
1851					var disableMobile = false;
1852					if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { 
1853						// disableMobile = true; 
1854					}
1855
1856					if(disableMobile === false) {
1857
1858						jQuery(".player").mb_YTPlayer();
1859
1860						jQuery("#video-volume").bind("click", function(e) {
1861							e.preventDefault();
1862
1863							jQuery('#YTPlayer').toggleVolume();
1864						});
1865
1866						// audio control
1867						jQuery("#video-volume").bind("click", function() {
1868							if(jQuery('i.fa', this).hasClass('fa-volume-down')) {
1869								jQuery('i.fa', this).removeClass('fa-volume-down');
1870								jQuery('i.fa', this).removeClass('fa-volume-up');
1871								jQuery('i.fa', this).addClass('fa-volume-up');
1872							} else {
1873								jQuery('i.fa', this).removeClass('fa-volume-up');
1874								jQuery('i.fa', this).removeClass('fa-volume-v');
1875								jQuery('i.fa', this).addClass('fa-volume-down');
1876							}
1877						});
1878
1879					} else {
1880
1881						jQuery(".player , #video-volume").hide();
1882
1883					}
1884
1885				}
1886				
1887			});
1888		}
1889	}
1890
1891
1892/** 08. Mixitup Filter
1893 **************************************************************** **/
1894	function _mixitup() {
1895		var _container = jQuery('.mix-grid');
1896		
1897		if(_container.length > 0) {
1898			loadScript(plugin_path + 'mixitup/jquery.mixitup.min.js', function() {
1899
1900				if(jQuery().mixitup) {
1901
1902					_container.mixitup();
1903					jQuery("ul.mix-filter a").bind("click", function(e) {
1904						e.preventDefault();
1905					});
1906
1907				}
1908			
1909			});
1910		
1911		}
1912
1913	}
1914
1915
1916
1917/** 09. Toggle
1918 **************************************************************** **/
1919	function _toggle() {
1920
1921		var $_t = this,
1922			previewParClosedHeight = 25;
1923
1924		jQuery("div.toggle.active > p").addClass("preview-active");
1925		jQuery("div.toggle.active > div.toggle-content").slideDown(400);
1926		jQuery("div.toggle > label").click(function(e) {
1927
1928			var parentSection 	= jQuery(this).parent(),
1929				parentWrapper 	= jQuery(this).parents("div.toggle"),
1930				previewPar 		= false,
1931				isAccordion 	= parentWrapper.hasClass("toggle-accordion");
1932
1933			if(isAccordion && typeof(e.originalEvent) != "undefined") {
1934				parentWrapper.find("div.toggle.active > label").trigger("click");
1935			}
1936
1937			parentSection.toggleClass("active");
1938
1939			if(parentSection.find("> p").get(0)) {
1940
1941				previewPar 					= parentSection.find("> p");
1942				var previewParCurrentHeight = previewPar.css("height");
1943				var previewParAnimateHeight = previewPar.css("height");
1944				previewPar.css("height", "auto");
1945				previewPar.css("height", previewParCurrentHeight);
1946
1947			}
1948
1949			var toggleContent = parentSection.find("> div.toggle-content");
1950
1951			if(parentSection.hasClass("active")) {
1952
1953				jQuery(previewPar).animate({height: previewParAnimateHeight}, 350, function() {jQuery(this).addClass("preview-active");});
1954				toggleContent.slideDown(350);
1955
1956			} else {
1957
1958				jQuery(previewPar).animate({height: previewParClosedHeight}, 350, function() {jQuery(this).removeClass("preview-active");});
1959				toggleContent.slideUp(350);
1960
1961			}
1962
1963		});
1964	}
1965
1966
1967
1968/** 11. Placeholder
1969 **************************************************************** **/
1970	function _placeholder() {
1971
1972		//check for IE
1973		if(navigator.appVersion.indexOf("MSIE")!=-1) {
1974
1975			jQuery('[placeholder]').focus(function() {
1976
1977				var input = jQuery(this);
1978				if (input.val() == input.attr('placeholder')) {
1979					input.val('');
1980					input.removeClass('placeholder');
1981				}
1982
1983			}).blur(function() {
1984
1985				var input = jQuery(this);
1986				if (input.val() == '' || input.val() == input.attr('placeholder')) {
1987				input.addClass('placeholder');
1988				input.val(input.attr('placeholder'));
1989				}
1990
1991			}).blur();
1992
1993		}
1994
1995	}
1996
1997
1998
1999/** 12. Word Rotate
2000 **************************************************************** **/
2001	function _wrotate() {
2002		jQuery(".word-rotator").each(function() {
2003
2004			var _t 				= jQuery(this),
2005				_items 			= _t.find(".items"),
2006				items 			= _items.find("> span"),
2007				firstItem 		= items.eq(0),
2008				firstItemClone 	= firstItem.clone(),
2009				_iHeight 		= jQuery(this).height(),
2010				_cItem 			= 1,
2011				_cTop 			= 0,
2012				_delay 			= jQuery(this).attr('data-delay') || 2000;
2013
2014			_items.append(firstItemClone);
2015			_t.height(_iHeight).addClass("active");
2016
2017			setInterval(function() {
2018				_cTop = (_cItem * _iHeight);
2019
2020				_items.animate({top: - (_cTop) + "px"}, 300, "easeOutQuad", function(){
2021					_cItem++;
2022
2023					if(_cItem > items.length) {
2024						_items.css("top", 0);
2025						_cItem = 1;
2026					}
2027
2028				});
2029
2030			}, _delay);
2031
2032		});
2033
2034
2035		var _container = jQuery('span.rotate');
2036		
2037		if(_container.length > 0) {
2038
2039			loadScript(plugin_path + 'text-rotator/jquery.simple-text-rotator.min.js', function() {
2040
2041				_container.each(function() {
2042					var _t 			= jQuery(this),
2043						_animation 	= _t.attr('data-animation') || 'fade', // fade|flip|flipCube|flipUp|spin
2044						_speed 		= _t.attr('data-speed') 	|| 2000;
2045
2046					_t.textrotator({
2047						animation: 	_animation,
2048						speed: 		parseInt(_speed)
2049					});
2050
2051				});
2052
2053			});
2054		
2055		}
2056	}
2057
2058
2059
2060
2061/** 08. Lazy Load
2062	<img class="lazy" data-original="img/example.jpg" width="765" height="574">
2063 **************************************************************** **/
2064	function _lazyload() {
2065		var _container = jQuery('img.lazy');
2066		
2067		if(_container.length > 0) {
2068			loadScript(plugin_path + 'lazyload/jquery.lazyload.min.js', function() {
2069
2070				if(jQuery().lazyload) {
2071
2072					_container.each(function () {
2073						var _t 		= jQuery(this),
2074							_effect = _t.attr('data-effect') || 'fadeIn';
2075
2076							_t.lazyload({
2077								effect : _effect
2078							});
2079					});
2080
2081				}
2082			
2083			});
2084		
2085		}
2086
2087	}
2088
2089
2090
2091
2092
2093/** 13. Misc
2094 **************************************************************** **/
2095	function _misc() {
2096
2097
2098		/** Portfolio Bugfix
2099		 *********************** **/
2100		if(jQuery("#portfolio").length > 0) {
2101			jQuery("#portfolio .item-box .owl-carousel").each(function() {
2102
2103				// Fix if has owl-carousel slider!
2104				jQuery(this).parent().parent().find('.item-box-desc').css({"padding-top":"29px"});
2105
2106			});
2107		}
2108		if(jQuery("#portfolio2").length > 0) {
2109			jQuery("#portfolio2 .item-box .owl-carousel").each(function() {
2110
2111				// Fix if has owl-carousel slider!
2112				jQuery(this).parent().parent().find('.item-box-desc').css({"padding-top":"29px"});
2113
2114			});
2115		}
2116		if(jQuery("#portfolio3").length > 0) {
2117			jQuery("#portfolio3 .item-box .owl-carousel").each(function() {
2118
2119				// Fix if has owl-carousel slider!
2120				jQuery(this).parent().parent().find('.item-box-desc').css({"padding-top":"29px"});
2121
2122			});
2123		}
2124
2125		/** Masonry
2126		 *********************** **/
2127		if(jQuery().masonry) {
2128			jQuery(".masonry").masonry();
2129		}
2130
2131
2132
2133		/** Isotope Portfolio
2134		 *********************** **/
2135		var portfolio_isotope_container = jQuery("#portfolio.portfolio-isotope, #portfolio2.portfolio-isotope, #portfolio3.portfolio-isotope");
2136
2137		if(portfolio_isotope_container.length > 0) {
2138			loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
2139
2140				// Isotope Portfolio
2141				if(jQuery().isotope) {
2142
2143					var _container = jQuery('#portfolio');
2144
2145					// Calculate Item Width on Fullwidth portfolio
2146					if(_container.hasClass('portfolio-isotope-2')) {
2147						_cols = 2;
2148					} else
2149					if(_container.hasClass('portfolio-isotope-3')) {
2150						_cols = 3;
2151					} else
2152					if(_container.hasClass('portfolio-isotope-4')) {
2153						_cols = 4;
2154					} else
2155					if(_container.hasClass('portfolio-isotope-5')) {
2156						_cols = 5;
2157					} else
2158					if(_container.hasClass('portfolio-isotope-6')) {
2159						_cols = 6;
2160					} else { _cols = 4; }
2161
2162
2163
2164					function _recalcW() {
2165						_dw		= jQuery(document).width();
2166
2167						if(_container.hasClass('fullwidth')) { // Fullwidth
2168
2169							// _w 		= jQuery(document).width(); // NOT USED - problems on aside header
2170							// _w 		= _container.width();
2171							_w 		= jQuery("#portfolio").parent().width(); // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2172							_wItem	= (_w/_cols);
2173
2174							if(_cols > 4 && _dw < 992) {length
2175								_wItem = (_w/4);
2176							}
2177							if(_dw < 760) {
2178								_wItem = (_w/2);
2179							}
2180							if(_dw < 480) {
2181								_wItem = jQuery("#portfolio").width();
2182							}
2183
2184							// Apply item width
2185							jQuery("#portfolio>
2185.portfolio-item").css({"width":_wItem});
2186
2187						} else { // Non Fullwidth
2188
2189							_mR		= parseInt(jQuery("#portfolio>.portfolio-item").css('margin-right'));
2190							// _w 		= jQuery("#portfolio").closest('.container').width();
2191							_w 		= jQuery("#portfolio").parent().width() + _mR; // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2192							_wItem 	= _w / _cols - _mR;
2193
2194							if(_cols > 4 && _dw < 992) {
2195								_wItem = (_w/4 - _mR);
2196							}
2197							if(_dw < 760) {
2198								_wItem = (_w/2 - _mR);
2199							}
2200							if(_dw < 480) {
2201								_wItem = _w;
2202							}
2203
2204							// Apply item & container width
2205							jQuery("#portfolio.portfolio-isotope").css({"width":_w});
2206							jQuery("#portfolio>.portfolio-item").css({"width":_wItem});
2207
2208						}
2209
2210						// Resize Flex Slider if exists!
2211						if(jQuery('.flexslider').length > 0) {
2212							jQuery('.flexslider').resize();
2213						}
2214
2215					}	_recalcW();
2216
2217
2218
2219					jQuery(window).on("load", function(){
2220
2221						var _t = setTimeout(function(){
2222
2223							_container.isotope({
2224								masonry: {},
2225
2226								filter: '*',
2227								animationOptions: {
2228									duration: 750,
2229									easing: 'linear',
2230									queue: false
2231								}
2232							});
2233
2234							jQuery('#portfolio_filter>li>a').bind("click", function(e){
2235								e.preventDefault();
2236
2237								jQuery('#portfolio_filter>li.active').removeClass('active');
2238								jQuery(this).parent('li').addClass('active');
2239
2240								var selector = jQuery(this).attr('data-filter');
2241								_container.isotope({
2242									filter: selector,
2243									animationOptions: {
2244										duration: 750,
2245										easing: 'linear',
2246										queue: false
2247									}
2248								 });
2249
2250							});
2251
2252
2253						}, 50 );
2254
2255						setTimeout(function() {
2256							_container.isotope('layout');
2257						}, 300);
2258
2259					});
2260
2261
2262
2263					// On Resize
2264					jQuery(window).resize(function() {
2265
2266						if(window.afterResizeApp2) {
2267							clearTimeout(window.afterResizeApp2);
2268						}
2269
2270						window.afterResizeApp2 = setTimeout(function() {
2271							_recalcW();
2272
2273							setTimeout(function() {
2274								_container.isotope('layout');
2275							}, 300);
2276
2277						}, 300);
2278
2279					});
2280
2281
2282				}
2283
2284
2285
2286
2287				// Isotope Portfolio2
2288				if(jQuery().isotope) {
2289
2290					var _container2 = jQuery('#portfolio2');
2291
2292					// Calculate Item Width on Fullwidth portfolio
2293					if(_container2.hasClass('portfolio-isotope-2')) {
2294						_cols2 = 2;
2295					} else
2296					if(_container2.hasClass('portfolio-isotope-3')) {
2297						_cols2 = 3;
2298					} else
2299					if(_container2.hasClass('portfolio-isotope-4')) {
2300						_cols2 = 4;
2301					} else
2302					if(_container2.hasClass('portfolio-isotope-5')) {
2303						_cols2 = 5;
2304					} else
2305					if(_container2.hasClass('portfolio-isotope-6')) {
2306						_cols2 = 6;
2307					} else { _cols2 = 4; }
2308
2309
2310
2311					function _recalcW2() {
2312						_dw2		= jQuery(document).width();
2313
2314						if(_container2.hasClass('fullwidth')) { // Fullwidth
2315
2316							// _w2 		= jQuery(document).width(); // NOT USED - problems on aside header
2317							// _w2 		= _container2.width();
2318							_w2 		= jQuery("#portfolio2").parent().width(); // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2319							_wItem2	= (_w2/_cols2);
2320
2321							if(_cols2 > 4 && _dw2 < 992) {length
2322								_wItem2 = (_w2/4);
2323							}
2324							if(_dw2 < 760) {
2325								_wItem2 = (_w2/2);
2326							}
2327							if(_dw2 < 480) {
2328								_wItem2 = jQuery("#portfolio2").width();
2329							}
2330
2331							// Apply item width
2332							jQuery("#portfolio2>.portfolio-item").css({"width":_wItem2});
2333
2334						} else { // Non Fullwidth
2335
2336							_mR2		= parseInt(jQuery("#portfolio2>.portfolio-item").css('margin-right'));
2337							// _w2 		= jQuery("#portfolio2").closest('.container').width();
2338							_w2 		= jQuery("#portfolio2").parent().width() + _mR2; // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2339							_wItem2 	= _w2 / _cols2 - _mR2;
2340
2341							if(_cols2 > 4 && _dw2 < 992) {
2342								_wItem2 = (_w2/4 - _mR2);
2343							}
2344							if(_dw2 < 760) {
2345								_wItem2 = (_w2/2 - _mR2);
2346							}
2347							if(_dw2 < 480) {
2348								_wItem2 = _w2;
2349							}
2350
2351							// Apply item & container width
2352							jQuery("#portfolio2.portfolio-isotope").css({"width":_w2});
2353							jQuery("#portfolio2>
2353.portfolio-item").css({"width":_wItem2});
2354
2355						}
2356
2357						// Resize Flex Slider if exists!
2358						if(jQuery('.flexslider').length > 0) {
2359							jQuery('.flexslider').resize();
2360						}
2361
2362					}	_recalcW2();
2363
2364
2365
2366					jQuery(window).on("load", function(){
2367
2368						var _t2 = setTimeout(function(){
2369
2370							_container2.isotope({
2371								masonry: {},
2372
2373								filter: '*',
2374								animationOptions: {
2375									duration: 750,
2376									easing: 'linear',
2377									queue: false
2378								}
2379							});
2380
2381							jQuery('#portfolio2_filter>li>a').bind("click", function(e){
2382								e.preventDefault();
2383
2384								jQuery('#portfolio2_filter>li.active').removeClass('active');
2385								jQuery(this).parent('li').addClass('active');
2386
2387								var selector2 = jQuery(this).attr('data-filter');
2388								_container2.isotope({
2389									filter: selector2,
2390									animationOptions: {
2391										duration: 750,
2392										easing: 'linear',
2393										queue: false
2394									}
2395								 });
2396
2397							});
2398
2399
2400						}, 50 );
2401
2402						setTimeout(function() {
2403							_container2.isotope('layout');
2404						}, 300);
2405
2406					});
2407
2408
2409
2410					// On Resize
2411					jQuery(window).resize(function() {
2412
2413						if(window.afterResizeApp2_2) {
2414							clearTimeout(window.afterResizeApp2_2);
2415						}
2416
2417						window.afterResizeApp2_2 = setTimeout(function() {
2418
2419							_recalcW2();
2420
2421							setTimeout(function() {
2422								_container2.isotope('layout');
2423							}, 300);
2424
2425						}, 300);
2426
2427					});
2428
2429
2430				}
2431
2432
2433
2434				// Isotope Portfolio3
2435				if(jQuery().isotope) {
2436
2437					var _container3 = jQuery('#portfolio3');
2438
2439					// Calculate Item Width on Fullwidth portfolio
2440					if(_container3.hasClass('portfolio-isotope-2')) {
2441						_cols3 = 2;
2442					} else
2443					if(_container3.hasClass('portfolio-isotope-3')) {
2444						_cols3 = 3;
2445					} else
2446					if(_container3.hasClass('portfolio-isotope-4')) {
2447						_cols3 = 4;
2448					} else
2449					if(_container3.hasClass('portfolio-isotope-5')) {
2450						_cols3 = 5;
2451					} else
2452					if(_container3.hasClass('portfolio-isotope-6')) {
2453						_cols3 = 6;
2454					} else { _cols3 = 4; }
2455
2456
2457
2458					function _recalcW3() {
2459						_dw3		= jQuery(document).width();
2460
2461						if(_container3.hasClass('fullwidth')) { // Fullwidth
2462
2463							// _w3 		= jQuery(document).width(); // NOT USED - problems on aside header
2464							// _w3 		= _container3.width();
2465							_w3 		= jQuery("#portfolio3").parent().width(); // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2466							_wItem3	= (_w3/_cols3);
2467
2468							if(_cols3 > 4 && _dw3 < 992) {length
2469								_wItem3 = (_w3/4);
2470							}
2471							if(_dw3 < 760) {
2472								_wItem3 = (_w3/2);
2473							}
2474							if(_dw3 < 480) {
2475								_wItem3 = jQuery("#portfolio3").width();
2476							}
2477
2478							// Apply item width
2479							jQuery("#portfolio3>.portfolio-item").css({"width":_wItem3});
2480
2481						} else { // Non Fullwidth
2482
2483							_mR3		= parseInt(jQuery("#portfolio3>.portfolio-item").css('margin-right'));
2484							// _w3 		= jQuery("#portfolio3").closest('.container').width();
2485							_w3 		= jQuery("#portfolio3").parent().width() + _mR3; // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2486							_wItem3 	= _w3 / _cols3 - _mR3;
2487
2488							if(_cols3 > 4 && _dw3 < 992) {
2489								_wItem3 = (_w3/4 - _mR3);
2490							}
2491							if(_dw3 < 760) {
2492								_wItem3 = (_w3/2 - _mR3);
2493							}
2494							if(_dw3 < 480) {
2495								_wItem3 = _w3;
2496							}
2497
2498							// Apply item & container width
2499							jQuery("#portfolio3.portfolio-isotope").css({"width":_w3});
2500							jQuery("#portfolio3>.portfolio-item").css({"width":_wItem3});
2501
2502						}
2503
2504						// Resize Flex Slider if exists!
2505						if(jQuery('.flexslider').length > 0) {
2506							jQuery('.flexslider').resize();
2507						}
2508
2509					}	_recalcW3();
2510
2511
2512
2513					jQuery(window).on("load", function(){
2514
2515						var _t3 = setTimeout(function(){
2516
2517							_container3.isotope({
2518								masonry: {},
2519
2520								filter: '*',
2521								animationOptions: {
2522									duration: 750,
2523									easing: 'linear',
2524									queue: false
2525								}
2526							});
2527
2528							jQuery('#portfolio3_filter>li>a').bind("click", function(e){
2529								e.preventDefault();
2530
2531								jQuery('#portfolio3_filter>li.active').removeClass('active');
2532								jQuery(this).parent('li').addClass('active');
2533
2534								var selector3 = jQuery(this).attr('data-filter');
2535								_container3.isotope({
2536									filter: selector3,
2537									animationOptions: {
2538										duration: 750,
2539										easing: 'linear',
2540										queue: false
2541									}
2542								 });
2543
2544							});
2545
2546
2547						}, 50 );
2548
2549						setTimeout(function() {
2550							_container3.isotope('layout');
2551						}, 300);
2552
2553					});
2554
2555
2556
2557					// On Resize
2558					jQuery(window).resize(function() {
2559
2560						if(window.afterResizeApp2_3) {
2561							clearTimeout(window.afterResizeApp2_3);
2562						}
2563
2564						window.afterResizeApp2_3 = setTimeout(function() {
2565
2566							_recalcW3();
2567
2568							setTimeout(function() {
2569								_container3.isotope('layout');
2570							}, 300);
2571
2572						}, 300);
2573
2574					});
2575
2576
2577				}
2578
2579
2580			});
2581		}	/** end isotope **/
2582
2583
2584
2585
2586		/** Isotope Blog
2587		 *********************** **/
2588		var blog_isotope_container = jQuery("#blog.blog-isotope");
2589
2590		if(blog_isotope_container.length > 0) {
2591			loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
2592
2593				// Isotope blog
2594				if(jQuery().isotope) {
2595
2596					var _container = jQuery('#blog');
2597
2598					// Calculate Item Width on Fullwidth Blog
2599					if(_container.hasClass('blog-isotope-2')) {
2600						_colsB = 2;
2601					} else
2602					if(_container.hasClass('blog-isotope-3')) {
2603						_colsB = 3;
2604					} else
2605					if(_container.hasClass('blog-isotope-4')) {
2606						_colsB = 4;
2607					} else
2608					if(_container.hasClass('blog-isotope-5')) {
2609						_colsB = 5;
2610					} else
2611					if(_container.hasClass('blog-isotope-6')) {
2612						_colsB = 6;
2613					} else { _colsB = 4; }
2614
2615
2616					function _recalcWb() {
2617						_dwB		= jQuery(document).width();
2618
2619						if(_container.hasClass('fullwidth')) { // Fullwidth
2620
2621							// _wB 		= jQuery(document).width();
2622							_wB 		= jQuery("#blog").parent().width(); // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2623							_wItemB	= (_wB/_colsB);
2624
2625							if(_colsB > 4 && _dwB < 992) {
2626								_wItemB = (_wB/4);
2627							}
2628							if(_dwB < 760) {
2629								_wItemB = (_wB/2);
2630							}
2631							if(_dwB < 480) {
2632								_wItemB = jQuery("#blog").width();
2633							}
2634
2635							// Apply item width
2636							jQuery("#blog>.blog-post-item").css({"width":_wItemB});
2637
2638						} else { // Non Fullwidth
2639
2640							_mRB		= parseInt(jQuery("#blog>.blog-post-item").css('margin-right'));
2641							// _wB 		= jQuery("#blog").closest('.container').width();
2642							_wB 		= jQuery("#blog").parent().width() + _mRB; // RD: this has already some inline styles at this point so the above doesnt work as ai would expect it
2643							_wItemB 	= _wB / _colsB - _mRB;
2644
2645							if(_colsB > 4 && _dwB < 992) {
2646								_wItemB = (_wB/4 - _mRB);
2647							}
2648							if(_dwB < 760) {
2649								_wItemB = (_wB/2 - _mRB);
2650							}
2651							if(_dwB < 480) {
2652								_wItemB = _wB;
2653							}
2654
2655							// Apply item & container width
2656							jQuery("#blog.blog-isotope").css({"width":_wB});
2657							jQuery("#blog>.blog-post-item").css({"width":_wItemB});
2658
2659						}
2660
2661						// Resize Flex Slider if exists!
2662						if(jQuery('.flexslider').length > 0) {
2663							jQuery('.flexslider').resize();
2664						}
2665
2666					}	_recalcWb();
2667
2668
2669
2670					jQuery(window).on("load", function(){
2671
2672						var _t = setTimeout(function(){
2673
2674							_container.isotope({
2675								masonry: {},
2676
2677								filter: '*',
2678								animationOptions: {
2679									duration: 750,
2680									easing: 'linear',
2681									queue: false
2682								}
2683							});
2684
2685							jQuery('#blog_filter>li>a').bind("click", function(e){
2686								e.preventDefault();
2687
2688								jQuery('#blog_filter>li.active').removeClass('active');
2689								jQuery(this).parent('li').addClass('active');
2690
2691								var selectorB = jQuery(this).attr('data-filter');
2692								_container.isotope({
2693									filter: selectorB,
2694									animationOptions: {
2695										duration: 750,
2696										easing: 'linear',
2697										queue: false
2698									}
2699								 });
2700
2701							});
2702
2703
2704						}, 50 );
2705
2706						setTimeout(function() {
2707							_container.isotope('layout');
2708						}, 300);
2709
2710					});
2711
2712
2713
2714					// On Resize
2715					jQuery(window).resize(function() {
2716
2717						if(window.afterResizeApp2_B) {
2718							clearTimeout(window.afterResizeApp2_B);
2719						}
2720
2721						window.afterResizeApp2_B = setTimeout(function() {
2722
2723							_recalcWb();
2724
2725							setTimeout(function() {
2726								_container.isotope('layout');
2727							}, 300);
2728
2729						}, 300);
2730
2731					});
2732
2733
2734				}
2735
2736
2737			});
2738		}	/** end isotope **/
2739
2740
2741
2742
2743		/** Flip Boxes
2744		 *********************** **/
2745		if(jQuery('.box-flip').length > 0) {
2746			
2747			jQuery('.box-flip').each(function() {
2748				_height1 = jQuery('.box1',this).outerHeight();
2749				_height2 = jQuery('.box2',this).outerHeight();
2750
2751				if(_height1 >= _height2) {
2752					_height = _height1;
2753				} else {
2754					_height = _height2;
2755				}
2756
2757				jQuery(this).css({"min-height":_height+"px"});
2758				jQuery('.box1',this).css({"min-height":_height+"px"});
2759				jQuery('.box2',this).css({"min-height":_height+"px"});
2760			});
2761			
2762			jQuery('.box-flip').hover(function() {
2763				jQuery(this).addClass('flip');
2764			},function(){
2765				jQuery(this).removeClass('flip');
2766			});
2767		}
2768
2769
2770
2771
2772		/** Sticky Side (social icons)
2773		 *********************** **/
2774		if(jQuery("div.sticky-side").length > 0) {
2775		
2776			var _t 	= jQuery("div.sticky-side");
2777				_h	= _t.height() / 2;
2778				
2779			_t.css({"margin-top":"-"+_h+"px"});
2780		}
2781
2782
2783
2784
2785		/** Increase / Decrease No.
2786			Example: shop-single-left.html
2787		 *********************** **/
2788		jQuery(".incr").bind("click", function(e) {
2789			e.preventDefault();
2790
2791			var _for	= jQuery(this).attr('data-for'),
2792				_max	= parseInt(jQuery(this).attr('data-max')),
2793				_curVal	= parseInt(jQuery("#" + _for).val());
2794
2795			if(_curVal < _max) {
2796				jQuery("#" + _for).val(_curVal + 1);
2797			}
2798		});
2799
2800		jQuery(".decr").bind("click", function(e) {
2801			e.preventDefault();
2802
2803			var _for	= jQuery(this).attr('data-for'),
2804				_min	= parseInt(jQuery(this).attr('data-min')),
2805				_curVal	= parseInt(jQuery("#" + _for).val());
2806
2807			if(_curVal > _min) {
2808				jQuery("#" + _for).val(_curVal - 1);
2809			}
2810		});
2811
2812
2813
2814
2815
2816		/** Default Button Toggle
2817		 *********************** **/
2818		jQuery("a.toggle-default").bind("click", function(e) {
2819			e.preventDefault();
2820
2821			var _href = jQuery(this).attr('href');
2822
2823			if(jQuery(_href).is(":hidden")) {
2824
2825				jQuery(_href).slideToggle(200);
2826				jQuery('i.fa', this).removeClass('fa-plus-square').addClass('fa-minus-square');
2827
2828			} else {
2829
2830				jQuery(_href).slideToggle(200);
2831				jQuery('i.fa', this).removeClass('fa-minus-square').addClass('fa-plus-square');
2832			
2833			}
2834
2835		});
2836
2837
2838
2839
2840
2841		/** Custom File Upload
2842			<input class="custom-file-upload" type="file" id="file" name="myfiles[]" multiple />
2843		 *********************** **/
2844		var file_container = jQuery("input[type=file]");
2845
2846		if(file_container.length > 0) {
2847			loadScript(plugin_path + 'custom.fle_upload.js');
2848		}
2849
2850
2851
2852		/** Textarea Words Limit
2853		 *********************** **/
2854		jQuery("textarea.word-count").on('keyup', function() {
2855			var _t		= jQuery(this),
2856				words 	= this.value.match(/\S+/g).length,
2857				_limit	= _t.attr('data-maxlength') || 200;
2858
2859			if (words > parseInt(_limit)) {
2860
2861				// Split the string on first 200 words and rejoin on spaces
2862				var trimmed = _t.val().split(/\s+/, 200).join(" ");
2863				// Add a space at the end to keep new typing making new words
2864				_t.val(trimmed + " ");
2865
2866			} else {
2867
2868				var _data_info = _t.attr('data-info');
2869
2870				if(_data_info == '' || _data_info == undefined) {
2871					var _infoContainer = _t.next('div');
2872					jQuery('span', _infoContainer).text(words + '/' + _limit);
2873				} else {
2874					jQuery('#' +_data_info).text(words + '/' + _limit);
2875				}
2876
2877
2878			}
2879		});
2880
2881	}
2882
2883
2884
2885/** Sticky Footer
2886 **************************************************************** **/
2887	function _stickyFooter() {
2888		if(jQuery("#footer").hasClass('sticky')) {
2889
2890			var footerHeight = 0,
2891				footerTop 	= 0,
2892				_footer 		= jQuery("#footer.sticky");
2893
2894			positionFooter();
2895
2896			function positionFooter() {
2897				footerHeight = _footer.height();
2898				footerTop = (jQuery(window).scrollTop()+jQuery(window).height()-footerHeight)+"px";
2899
2900				if((jQuery(document.body).height()+footerHeight) > jQuery(window).height()) {
2901					_footer.css({
2902						position: "absolute"
2903					}).stop().animate({
2904						top: footerTop
2905					},0);
2906				} else {
2907					_footer.css({position: "static"});
2908				}
2909
2910			}
2911
2912			jQuery(window).scroll(positionFooter).resize(positionFooter);
2913
2914		}
2915	}
2916
2917
2918
2919
2920
2921/** Countdown
2922 **************************************************************** **/
2923	function _countDown() {
2924		var _container 	= jQuery(".countdown"),
2925			_container2 = jQuery(".countdown-download");
2926		
2927		if(_container.length > 0 || _container2.length > 0) {
2928
2929			loadScript(plugin_path + 'countdown/jquery.countdown.pack.min.js', function() {
2930
2931				/** On Page Load **/
2932				_container.each(function() {
2933					var _t 		= jQuery(this),
2934						_date 	= _t.attr('data-from'),
2935						_labels	= _t.attr('data-labels');
2936
2937						if(_labels) {
2938							_labels = _labels.split(",");
2939						}
2940
2941						if(_date) {
2942							var _d = new Date(_date);
2943							jQuery(this).countdown({
2944								until: new Date(_d),
2945								labels: _labels || ["Years","Months","Weeks","Days","Hours","Minutes","Seconds"]
2946							});
2947						}
2948				});
2949
2950
2951				/** Download **/
2952				_container2.bind("click", function(e){
2953					e.preventDefault();
2954
2955					var _t = jQuery(this),
2956						cd_container 	= _t.attr('data-for'),
2957						_countdown		= jQuery("#"+cd_container+' span.download-wait>.countdown'),
2958						_seconds 		= parseInt(_t.attr('data-seconds')),
2959						_dataURL		= _t.attr('href');
2960
2961					_t.fadeOut(250, function(){
2962						jQuery("#"+cd_container).fadeIn(250, function() {
2963
2964							var currentDate = new Date();
2965							currentDate.setSeconds(currentDate.getSeconds() + _seconds);
2966
2967							_countdown.countdown({
2968								until: currentDate,
2969								format: 'S',
2970								expiryUrl: _dataURL,
2971								onExpiry: function(){
2972									jQuery("#"+cd_container+' span.download-message').removeClass('hide');
2973									jQuery("#"+cd_container+' span.download-wait').addClass('hide');
2974								}
2975							});
2976
2977						});
2978					});
2979
2980					return false;
2981
2982				});
2983
2984
2985			});
2986		
2987		}
2988
2989	}
2990
2991
2992
2993/** Masonry Gallery
2994 **************************************************************** **/
2995	function _masonryGallery() {
2996
2997		if(jQuery(".masonry-gallery").length > 0) {
2998
2999			jQuery(".masonry-gallery").each(function() {
3000				var _container = jQuery(this),
3001					columns		= 4;
3002
3003					 if(_container.hasClass('columns-2')) 	columns = 2;
3004				else if(_container.hasClass('columns-3')) 	columns = 3;
3005				else if(_container.hasClass('columns-4')) 	columns = 4;
3006				else if(_container.hasClass('columns-5')) 	columns = 5;
3007				else if(_container.hasClass('columns-6')) 	columns = 6;
3008
3009				var _firstElemWidth 	= _container.find('a:eq(0)').outerWidth(),
3010					_bigImageNo 		= _container.attr('data-img-big'),
3011					_containerWidth		= _container.width();
3012
3013
3014				// Fix margins & Width
3015                var postWidth = (_containerWidth/columns);
3016					postWidth = Math.floor(postWidth);
3017                if((postWidth * columns) >= _containerWidth) { 
3018					_container.css({ 'margin-right': '-1px' }); 
3019				}
3020				if(columns < 6) {
3021					_container.children('a').css({"width":postWidth+"px"});
3022				}
3023
3024
3025				// Set Big Image
3026                if(parseInt(_bigImageNo) > 0) {
3027
3028					_bigImageNo 	= Number(_bigImageNo) - 1; 
3029					_container.find('a:eq('+_bigImageNo+')').css({ width: _firstElemWidth*2 + 'px'});
3030
3031					loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
3032
3033						setTimeout( function() {
3034							_container.isotope({
3035								masonry: {
3036									columnWidth: _firstElemWidth
3037								}
3038							});
3039
3040							_container.isotope('layout');
3041
3042						}, 1000);
3043					
3044					});
3045
3046                }
3047
3048			});
3049
3050
3051		}
3052
3053	}
3054
3055
3056
3057	
3058/** Toastr
3059
3060	TYPE:
3061		primary
3062		info
3063		error
3064		sucess
3065		warning
3066
3067	POSITION
3068		top-right
3069		top-left
3070		top-center
3071		top-full-width
3072		bottom-right
3073		bottom-left
3074		bottom-center
3075		bottom-full-width
3076		
3077	USAGE:
3078		_toastr("My Message here","top-right","error",false);
3079		
3080	NOTE:
3081		_onclick = url to redirect (example: http://www.stepofweb.com)
3082 **************************************************************** **/
3083	function _toastr(_message,_position,_notifyType,_onclick) {
3084		var _btn 	= jQuery(".toastr-notify");
3085
3086		if(_btn.length > 0 && _message != false) {
3087
3088			loadScript(plugin_path + 'toastr/toastr.js', function() {
3089				// toastr.clear();
3090
3091				/** BUTTON CLICK
3092				 ********************* **/
3093				_btn.bind("click", function(e) {
3094					e.preventDefault();
3095
3096
3097					var _message 			= jQuery(this).attr('data-message'),
3098						_notifyType 		= jQuery(this).attr('data-notifyType')			|| "default",
3099						_position	 		= jQuery(this).attr('data-position')			|| "top-right",
3100						_progressBar 		= jQuery(this).attr('data-progressBar') 		== "true" ? true : false,
3101						_closeButton		= jQuery(this).attr('data-closeButton') 		== "true" ? true : false,
3102						_debug		 		= jQuery(this).attr('data-debug') 				== "true" ? true : false,
3103						_newestOnTop 		= jQuery(this).attr('data-newestOnTop') 		== "true" ? true : false,
3104						_preventDuplicates	= jQuery(this).attr('data-preventDuplicates') 	== "true" ? true : false,
3105						_showDuration 		= jQuery(this).attr('data-showDuration') 		|| "300",
3106						_hideDuration 		= jQuery(this).attr('data-hideDuration') 		|| "1000",
3107						_timeOut 			= jQuery(this).attr('data-timeOut') 			|| "5000",
3108						_extendedTimeOut	= jQuery(this).attr('data-extendedTimeOut')		|| "1000",
3109						_showEasing 		= jQuery(this).attr('data-showEasing') 			|| "swing",
3110						_hideEasing 		= jQuery(this).attr('data-hideEasing') 			|| "linear",
3111						_showMethod 		= jQuery(this).attr('data-showMethod') 			|| "fadeIn",
3112						_hideMethod 		= jQuery(this).attr('data-hideMethod') 			|| "fadeOut";
3113
3114						toastr.options = {
3115							"closeButton": 			_closeButton,
3116							"debug": 				_debug,
3117							"newestOnTop": 			_newestOnTop,
3118							"progressBar": 			_progressBar,
3119							"positionClass": 		"toast-" + _position,
3120							"preventDuplicates": 	_preventDuplicates,
3121							"onclick": 				null,
3122							"showDuration": 		_showDuration,
3123							"hideDuration": 		_hideDuration,
3124							"timeOut": 				_timeOut,
3125							"extendedTimeOut": 		_extendedTimeOut,
3126							"showEasing": 			_showEasing,
3127							"hideEasing": 			_hideEasing,
3128							"showMethod": 			_showMethod,
3129							"hideMethod": 			_hideMethod
3130						}
3131
3132					toastr[_notifyType](_message);
3133				});
3134
3135
3136				/** JAVSCRIPT / ON LOAD
3137				 ************************* **/
3138				if(_message != false) {
3139
3140					if(_onclick != false) {
3141						onclick = function() {
3142							window.location = _onclick;
3143						}
3144					} else {
3145						onclick = null
3146					}
3147
3148					toastr.options = {
3149						"closeButton": 			true,
3150						"debug": 				false,
3151						"newestOnTop": 			false,
3152						"progressBar": 			true,
3153						"positionClass": 		"toast-" + _position,
3154						"preventDuplicates": 	false,
3155						"onclick": 				onclick,
3156						"showDuration": 		"300",
3157						"hideDuration": 		"1000",
3158						"timeOut": 				"5000",
3159						"extendedTimeOut": 		"1000",
3160						"showEasing": 			"swing",
3161						"hideEasing": 			"linear",
3162						"showMethod": 			"fadeIn",
3163						"hideMethod": 			"fadeOut"
3164					}
3165
3166					setTimeout(function(){
3167						toastr[_notifyType](_message);
3168					}, 1500); // delay 1.5s
3169				}
3170			});
3171		
3172		}
3173
3174	}
3175
3176
3177/** Chart
3178 **************************************************************** **/
3179	function _charts() {
3180
3181		/** Easy Pie Chart 
3182		 ************************* **/
3183		var _container = jQuery(".piechart");
3184
3185		if(_container.length > 0) {
3186
3187			loadScript(plugin_path + 'chart.easypiechart/dist/jquery.easypiechart.min.js', function() {
3188
3189				jQuery(".piechart").each(function() {
3190					var _t = jQuery(this),
3191						_size 		= _t.attr('data-size') || 150,
3192						_animate 	= _t.attr('data-animate') || "3000";
3193
3194					_t.easyPieChart({
3195						size: 			_size,
3196						animate: 		_animate,
3197						scaleColor: 	false,
3198						trackColor: 	_t.attr('data-trackcolor') || 'rgba(0,0,0,0.04)',
3199						lineWidth: 		_t.attr('data-width') || '2',
3200						lineCap: 		'square',
3201						barColor: 		_t.attr('data-color') || '#0093BF'
3202					});
3203
3204					/* fix element positioning */
3205					jQuery("*", this).attr('style', "line-height:"+_size+"px !important; height:"+_size+"px !important; width:"+_size+"px !important");
3206
3207				});
3208		
3209			});
3210
3211		}
3212
3213		
3214	}
3215
3216
3217
3218/** Select2
3219 **************************************************************** **/
3220	function _select2() {
3221		var _container = jQuery('select.select2');
3222		
3223		if(_container.length > 0) {
3224			
3225			loadScript(plugin_path + 'select2/js/select2.full.min.js', function() {
3226		
3227				_container.each(function() {
3228					var _t = jQuery(this);
3229
3230					if(!_t.hasClass('select2-custom')) {
3231						_t.select2();
3232					}
3233					
3234				})
3235
3236			});
3237		}
3238
3239	}
3240
3241
3242
3243
3244/** Form [form plugin + validation plugin]
3245 **************************************************************** **/
3246	function _form() {
3247
3248
3249		/** Form Validate 
3250			LOAD PLUGIN ONLY!
3251		 ************************ **/
3252		if(jQuery('form.validate-plugin').length > 0) {
3253
3254			loadScript(plugin_path + 'form.validate/jquery.form.min.js', function() {
3255				loadScript(plugin_path + 'form.validate/jquery.validation.min.js');
3256			});
3257
3258		}
3259
3260
3261
3262		/** Form Validate
3263		 ************************ **/
3264		if(jQuery('form.validate').length > 0) {
3265
3266			loadScript(plugin_path + 'form.validate/jquery.form.min.js', function() {
3267				loadScript(plugin_path + 'form.validate/jquery.validation.min.js', function() {
3268
3269					if(jQuery().validate) {
3270
3271						jQuery('form.validate').each(function() {
3272
3273							var _t 			= jQuery(this),
3274								_Smessage 	= _t.attr('data-success') 			|| "Successfully! Thank you!",
3275								_Cmessage 	= _t.attr('data-captcha') 			|| "Invalid Captcha!",
3276								_Tposition 	= _t.attr('data-toastr-position') 	|| "top-right",
3277								_Ttype	 	= _t.attr('data-toastr-type') 		|| "success";
3278								_Turl	 	= _t.attr('data-toastr-url') 		|| false;
3279
3280							// Append 'is_ajax' hidden input field!
3281							_t.append('<input type="hidden" name="is_ajax" value="true" />');
3282
3283							_t.validate({
3284								submitHandler: function(form) {
3285
3286									// Show spin icon
3287									jQuery(form).find('.input-group-addon').find('.fa-envelope').removeClass('fa-envelope').addClass('fa-refresh fa-spin');
3288
3289									jQuery(form).ajaxSubmit({
3290
3291										target: 	jQuery(form).find('.validate-result').length > 0 ? jQuery(form).find('.validate-result') : '',
3292
3293										error: 		function(data) { 
3294											_toastr("Sent Failed!",_Tposition,"error",false);
3295										},
3296
3297										success: 	function(data) {
3298											var data = data.trim();
3299
3300											// SMTP ERROR
3301											if(data == '_failed_') {
3302												_toastr("SMTP ERROR! Please, check your config file!",_Tposition,"error",false);
3303											}
3304
3305											// CAPTCHA ERROR
3306											else if(data == '_captcha_') {
3307												_toastr("Invalid Captcha!",_Tposition,"error",false);
3308
3309
3310											// SUCCESS
3311											} else {
3312
3313												// Remove spin icon
3314												jQuery(form).find('.input-group-addon').find('.fa-refresh').removeClass('fa-refresh fa-spin').addClass('fa-envelope');
3315
3316												// Clear the form
3317												jQuery(form).find('input.form-control').val('');
3318
3319												// Toastr Message
3320												_toastr(_Smessage,_Tposition,_Ttype,_Turl);
3321											
3322											}
3323										}
3324									});
3325
3326								}
3327							});
3328
3329						});
3330
3331					}
3332
3333				});
3334			});
3335
3336		}
3337
3338
3339
3340
3341		/** Masked Input
3342		 ************************ **/
3343		var _container = jQuery('input.masked');
3344		if(_container.length > 0) {
3345
3346			loadScript(plugin_path + 'form.masked/jquery.maskedinput.js', function() {
3347				
3348				_container.each(function() {
3349				
3350					var _t 				= jQuery(this);
3351						_format 		= _t.attr('data-format') 		|| '(999) 999-999999',
3352						_placeholder 	= _t.attr('data-placeholder') 	|| 'X';
3353
3354					jQuery.mask.definitions['f'] = "[A-Fa-f0-9]";
3355					_t.mask(_format, {placeholder:_placeholder});
3356
3357				});
3358				
3359			});
3360
3361		}
3362
3363	}
3364
3365
3366
3367
3368
3369/** Pickers
3370 **************************************************************** **/
3371	function _pickers() {
3372
3373		/** Date Picker
3374			<input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" data-lang="en" data-RTL="false">
3375		 ******************* **/
3376		var _container_1 = jQuery('.datepicker');
3377		
3378		if(_container_1.length > 0) {
3379			loadScript(plugin_path + 'bootstrap.datepicker/js/bootstrap-datepicker.min.js', function() {
3380		
3381				if(jQuery().datepicker) {
3382
3383					_container_1.each(function() {
3384						var _t 		= jQuery(this),
3385							_lang 	=	_t.attr('data-lang') || 'en';
3386
3387						if(_lang != 'en' && _lang != '') { // load language file
3388							loadScript(plugin_path + 'bootstrap.datepicker/locales/bootstrap-datepicker.'+_lang+'.min.js');
3389						}
3390
3391						jQuery(this).datepicker({
3392							format:			_t.attr('data-format') 			|| 'yyyy-mm-dd', 
3393							language: 		_lang,
3394							rtl: 			_t.attr('data-RTL') 			== "true"  ? true  : false,
3395							changeMonth: 	_t.attr('data-changeMonth') 	== "false" ? false : true,
3396							todayBtn: 		_t.attr('data-todayBtn') 		== "false" ? false : "linked",
3397							calendarWeeks: 	_t.attr('data-calendarWeeks') 	== "false" ? false : true,
3398							autoclose: 		_t.attr('data-autoclose') 		== "false" ? false : true,
3399							todayHighlight: _t.attr('data-todayHighlight') 	== "false" ? false : true,
3400
3401							onRender: function(date) {
3402								// return date.valueOf() < nowDate.valueOf() ? 'disabled' : '';
3403							}
3404						}).on('changeDate', function(ev) {
3405
3406							// AJAX POST - OPTIONAL
3407
3408						}).data('datepicker'); 
3409					});
3410					
3411				}
3412
3413			});
3414		}
3415
3416
3417
3418
3419		/** Range Picker
3420			<input type="text" class="form-control rangepicker" value="2015-01-01 - 2016-12-31" data-format="yyyy-mm-dd" data-from="2015-01-01" data-to="2016-12-31">
3421		 ******************* **/
3422		var _container_2 = jQuery('.rangepicker');
3423		
3424		if(_container_2.length > 0) {
3425			loadScript(plugin_path + 'bootstrap.daterangepicker/moment.min.js', function() {
3426				loadScript(plugin_path + 'bootstrap.daterangepicker/daterangepicker.js', function() {
3427			
3428					if(jQuery().datepicker) {
3429
3430						_container_2.each(function() {
3431						
3432							var _t 		= jQuery(this),
3433								_format = _t.attr('data-format').toUpperCase() || 'YYYY-MM-DD';
3434
3435							_t.daterangepicker(
3436							{
3437								format: 		_format,
3438								startDate: 		_t.attr('data-from'),
3439								endDate: 		_t.attr('data-to'),
3440
3441								ranges: {
3442								   'Today': [moment(), moment()],
3443								   'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
3444								   'Last 7 Days': [moment().subtract(6, 'days'), moment()],
3445								   'Last 30 Days': [moment().subtract(29, 'days'), moment()],
3446								   'This Month': [moment().startOf('month'), moment().endOf('month')],
3447								   'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
3448								}
3449							}, 
3450							function(start, end, label) {
3451								// alert("A new date range was chosen: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
3452							});
3453
3454						});
3455						
3456					}
3457
3458				});
3459			});
3460		}
3461
3462
3463
3464		/** Time Picker
3465			<input type="text" class="form-control timepicker" value="11 : 55 : PM">
3466		 ******************* **/
3467		var _container_3 = jQuery('.timepicker');
3468		
3469		if(_container_3.length > 0) {
3470			loadScript(plugin_path + 'timepicki/timepicki.min.js', function() {
3471			
3472				if(jQuery().timepicki) {
3473
3474					_container_3.timepicki();
3475					
3476				}
3477
3478			});
3479		}
3480
3481
3482
3483		/** Color Picker
3484		 ******************* **/
3485		var _container_4 = jQuery('.colorpicker');
3486		
3487		if(_container_4.length > 0) {
3488			loadScript(plugin_path + 'spectrum/spectrum.min.js', function() {
3489			
3490				if(jQuery().spectrum) {
3491
3492					_container_4.each(function() {
3493						var _t 					= jQuery(this),
3494							_preferredFormat 	= _t.attr('data-format') 		|| "hex", // hex, hex3, hsl, rgb, name
3495							_palletteOnly		= _t.attr('data-palletteOnly') 	|| "false",
3496							_fullPicker			= _t.attr('data-fullpicker') 	|| "false",
3497							_allowEmpty			= _t.attr('data-allowEmpty') 	|| false;
3498							_flat				= _t.attr('data-flat') 			|| false;
3499
3500							if(_palletteOnly == "true" || _fullPicker == "true") {
3501
3502								var _palette = [
3503										["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],
3504										["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],
3505										["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],
3506										["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],
3507										["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],
3508										["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],
3509										["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],
3510										["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]
3511									];
3512	
3513							} else {
3514								_palette = null;
3515							}
3516
3517							if(_t.attr('data-defaultColor')) {
3518								_color = _t.attr('data-defaultColor');
3519							} else {
3520								_color = "#ff0000";
3521							}
3522							
3523							if(!_t.attr('data-defaultColor') && _allowEmpty == "true") {
3524								_color = null;
3525							}
3526
3527						_t.spectrum({
3528							showPaletteOnly: 	_palletteOnly == "true" ? true : false,
3529							togglePaletteOnly: 	_palletteOnly == "true" ? true : false,
3530
3531							flat:				_flat 		== "true" ? true : false,
3532							showInitial: 		_allowEmpty == "true" ? true : false,
3533							showInput: 			_allowEmpty == "true" ? true : false,
3534							allowEmpty:			_allowEmpty == "true" ? true : false,
3535
3536							chooseText: 		_t.attr('data-chooseText') || "Coose",
3537							cancelText: 		_t.attr('data-cancelText') || "Cancel",
3538
3539							color: 				_color,
3540							showInput:			true,
3541							showPalette: 		true,
3542							preferredFormat: 	_preferredFormat,
3543							showAlpha: 			_preferredFormat == "rgb" ? true : false,
3544							palette: 			_palette
3545						});
3546
3547					});
3548					
3549				}
3550
3551			});
3552		}
3553
3554	}
3555
3556
3557
3558
3559
3560/** Editors
3561 **************************************************************** **/
3562	function _editors() {
3563
3564		/** Summernote HTML Editor
3565			<textarea class="summernote form-control" data-height="200"></textarea>
3566		 ***************************** **/
3567		var _container_1 = jQuery('textarea.summernote');
3568		
3569		if(_container_1.length > 0) {
3570			
3571			loadScript(plugin_path + 'editor.summernote/summernote.min.js', function() {
3572		
3573				if(jQuery().summernote) {
3574
3575					_container_1.each(function() {
3576
3577						var _lang = jQuery(this).attr('data-lang') || 'en-US';
3578
3579						if(_lang != 'en-US') { // Language!
3580						alert(_lang);
3581							loadScript(plugin_path + 'editor.summernote/lang/summernote-'+_lang+'.js');
3582						}
3583
3584						jQuery(this).summernote({
3585							height: jQuery(this).attr('data-height') || 200,
3586							lang: 	jQuery(this).attr('data-lang') || 'en-US', // default: 'en-US'
3587							toolbar: [
3588							/*	[groupname, 	[button list]]	*/
3589								['style', 		['style']],
3590								['fontsize', 	['fontsize']],
3591								['style', 		['bold', 'italic', 'underline','strikethrough', 'clear']],
3592								['color', 		['color']],
3593								['para', 		['ul', 'ol', 'paragraph']],
3594								['table', 		['table']],
3595								['media', 		['link', 'picture', 'video']],
3596								['misc', 		['codeview', 'fullscreen', 'help']]
3597							]
3598						});
3599					});
3600
3601				}
3602			});
3603		}
3604
3605
3606
3607
3608
3609		/** Markdown HTML Editor
3610			<textarea class="markdown" data-height="300" name="content" data-provide="markdown" data-lang="en" rows="10"></textarea>
3611		 ***************************** **/
3612		var _container_2 = jQuery('textarea.markdown');
3613		
3614		if(_container_2.length > 0) {
3615			
3616			loadScript(plugin_path + 'editor.markdown/js/bootstrap-markdown.min.js', function() {
3617		
3618				if(jQuery().markdown) {
3619
3620					_container_2.each(function() {
3621						var _t = jQuery(this);
3622
3623						var _lang = _t.attr('data-lang') || 'en';
3624
3625						if(_lang != 'en') { // Language!
3626							loadScript(plugin_path + 'editor.markdown/locale/bootstrap-markdown.'+_lang+'.js');
3627						}
3628
3629						jQuery(this).markdown({
3630							autofocus:		_t.attr('data-autofocus') 	== "true" ? true : false,
3631							savable:		_t.attr('data-savable') 	== "true" ? true : false,
3632							height:			_t.attr('data-height') 		|| 'inherit',
3633							language:		_lang == 'en' ? null : _lang
3634						});
3635
3636					});
3637
3638				}
3639				
3640			});
3641			
3642		}
3643
3644	}
3645
3646
3647
3648
3649
3650
3651/** Pajinate [jQuery Pagination]
3652	USAGE
3653	
3654	<div class="pajinate" data-pajinante-items-per-page="8" data-pajinate-container=".pajinate-container">
3655	
3656		<div class="pajinate-container">
3657		
3658			<div>item1</div>
3659			<div>item2</div>
3660			<div>item3</div>
3661			.....
3662
3663		</div>
3664
3665		<div class="pajinate-nav">
3666			<ul class="pagination"><!-- pages added by pajinate plugin --></ul>
3667		</div>
3668
3669	</div>
3670 **************************************************************** **/
3671	function _pajinate() {
3672		var _container = jQuery('div.pajinate');
3673
3674		if(_container.length > 0) {
3675
3676			loadScript(plugin_path + 'pajinate/jquery.pajinate.bootstrap.min.js', function() {
3677			
3678				if(jQuery().pajinate) {
3679
3680					_container.each(function() {
3681						var _t 			= jQuery(this),
3682							_perPage 	= _t.attr('data-pajinante-items-per-page') 	|| 8;
3683							_numLinks 	= _t.attr('data-pajinante-num-links') 		|| 5;
3684
3685						_t.pajinate({
3686							items_per_page 				: parseInt(_perPage),
3687							num_page_links_to_display	: parseInt(_numLinks),
3688							item_container_id 			: _t.attr('data-pajinate-container') || '.pajinate-container',
3689							nav_panel_id 				: '.pajinate-nav ul',
3690							show_first_last 			: false,
3691							wrap_around					: true,
3692							abort_on_small_lists 		: true,
3693							start_page 					: 0,
3694							nav_label_prev 				: '&laquo;',
3695							nav_label_next 				: '&raquo;'
3696						});
3697
3698					});
3699				}
3700			
3701			});
3702		
3703		}
3704
3705	}
3706
3707
3708
3709
3710
3711/** Infininte Scroll
3712 **************************************************************** **/
3713	function _infiniteScroll() {
3714		var _container 	= jQuery(".infinite-scroll");
3715
3716		if(_container.length > 0) {
3717
3718			loadScript(plugin_path + 'infinite-scroll/jquery.infinitescroll.min.js', function() {
3719
3720					_navSelector	= _container.attr('data-nextSelector') || "#inf-load-nex",
3721					_itemSelector	= _container.attr('data-itemSelector') || ".item",
3722					_nextSelector	= _navSelector + " a";
3723
3724				_container.infinitescroll({
3725					loading: {
3726						finishedMsg	: '<i class="fa fa-check"></i>',
3727						msgText		: '<i class="fa fa-refresh fa-spin"></i>',
3728						img			: "data:image/gif;base64,R0lGODlhGAAYAPUAABQSFCwuLBwaHAwKDKyurGxqbNze3CwqLCQmJLS2tOzu7OTi5JyenBweHBQWFJyanPz+/HRydLSytFxeXPz6/ExOTKSmpFRSVHR2dAwODAQCBOzq7PTy9ISChPT29IyKjIyOjISGhOTm5GRiZJSWlJSSlFRWVMTCxNza3ExKTNTS1KyqrHx6fGRmZKSipMzOzMTGxDQyNDw+PAQGBDQ2NERCRFxaXMzKzGxubDw6PCQiJLy+vERGRLy6vHx+fNTW1CH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBQAAACwAAAAAGAAYAEAGqECAcAhoRAiojQJFiAiI0Kh0qOsZOhqhDMK9ZadgAI0WBmhAXAhFVm5HbZR0aTYdsFpSkwqjo5sRLAtpIjxuUzZpECmGjI1QA4JcKH5lGVICDHFpGyoqGx4uDWENFh4iKjcbiR4MT1ItLJSPJWkUNo9uAyhpBpaOGjdpOY7ExcYaIQs9OsUpibfENZoQIF9gY1EpqlwiLAh+M4AqJmUCOBJJGz8EOKJRQQAh+QQJBQABACwAAAAAGAAYAAAGp8CAcBhoRBILDgdFKAiI0KHAB5rUZBUWDALxMJ5R4SCmiWpoJ67iEm4TZx0upOCuB1jyir2tuXE3DnthE3IlglENchwDh0QDG3ITjUQ7ciGTQxFybJgBGkcYGhoYPaGdARdyOKchcjunhH8znQAccmCYJZGnDpAQN2WdFXI+pwEFch2znRe+MDTBbzGMbQIPHlwwLBcyNSMgLIF2Ai0WKAocBhI4uERBACH5BAkFACwALAAAAAAYABgAAAaoQJZwyNIEJiAJCpWICIjQKFGD6Gw8D4d0C3UQIJsKd1wsQSgFMldjgUAu6q1jA27EpRg34x5FUCAeT3xDAx5uBQAMJyZ8GRxuFiRuFAF3B24QKguYE3cpmAubbil3I5gGKpgIdwF/EA9tgAN8JicMGQVuHLODQgKGEKu9QgxuGMNCDQpgAMgsF38rGs4Ffx/TyBUiECtayAIPHgohAdi9DRFKTCAj5VJBACH5BAkFAAAALAAAAAAYABgAAAa0QIBwSAQMaphHoVFsOoezlsEleFqJDsnmcu1qLJBW9zpQUSpjqwyycQgPBAIiLYRBGIDMAgJRaegREB4CE3wQFAN0NHwRYHwwdAANfBIqhlx0AXwGCnx+kQV8Cp0QBZEaL3wbBnwBkReGKgl8TGkadnwugRA0dBkUhhMNHhARdBqWEAsZAAwQkHQIEgQHQgIbFDKRTRUUL4nbRC0QFjPhRBcbEm7nQg0uBi3g7Q0RDxEyzFdBACH5BAkFAAgALAAAAAAYABgAAAaxQIRwSCwKHMWkssgLCZbQYmNnUgpMh6gQoIoUZQqIh6ZFHDjV7QLCLpURIcUTAWKzvWUBhYFwcOwnA28IOx4CBXY3AIMIJRAFEmwoSIwYEAQGbDWMQiwQBh4QKpxCjhyhbqQqEByZLKQ1bAaRr4wOKGwSiKlvADd2BQIeJ4MDJ3YcSA8UlFqWdiBCAgohbyR2C4tCJhwBZTQUEAo5RQUqzVAHJuhDJjsNpFIhKfFG7FFBACH5BAkFAAAALAAAAQAYABYAAAa3QIBQmEnlNMOkcgmoGSCQEJNIY048UIhhKqS1lClKFtLjClmmoWAzvunMgJmqIWRkDTYkHIBxARpiECUDe0MIHg0RUCV6hQAaGxESEAszjkkvEk8sl0kqKgoQCJ1CGiIKChuNlwcQCigvpGcQKBKxpAMLEBI4IpaXGiVQODoeb44DwhAUAgAuGIUaEyhZDEINKr9
3728cCDdjG81CJpxmO2MUPEojVVy6UBQ2TDGEUyFQCzKyjzk880NBACH5BAkFAAEALAAAAAAYABgAAAazwIBwGABMOhcNcckUOkoKiJTVrAYqG6k2YWXiKFptpEs0gbWbXmFmHQwbWcjNJlCSYwIhQ9qxk4UaVAIeEB1/TCANBRAnfodCExEEEDSPSzUJKCeWSzQGHBicRBUcHimiQywKC5WoGjAoCTKoATQUBBETqDMnEAUNH6ghEBQOAT6OZBo+UgxCAjF/Mw0TN1IKeUJuVTMFPSJhEBePGOHEBZYJ4SI8nCxaHB/GnBoXISYATUEAIfkECQUAKgAsAAAAABgAGAAABqpAlXCoErQsr4WBlCE6nQ2XB0Ktup5Yk6LKhZywzgKlyplSKRfwsELdYA6DDCI1OaiFgg2EALirHxAfGn5gDR4rg4RPGhEbDopYAQkdkFgjBnaVTiEoiZpDCQmfRBooIKNDBwYjqEIdCQGtDgoFnpoaEh4NqBogEA+oDisQjn4xExUIAAMILCIQFBV+JmNUHh7VEAWEMF1VCmmELt4UDAKQGSUoCy8WI+dPQQAh+QQJBQAJACwAAAAAGAAYAAAGrMCEcJhoRCQoxUblmmSI0KGA4YFYr9bFIUqsbLBgK4ErLFAosEiuESi8sBKyifKqRTWXk+el4zYULgNkQhkaZBYShoOLOigAi5ARE5CQDzOUixGYi3abXANPnlE5olyapUQzD6hELaesDgYNrAkzEi5kMwOKnxYbs1EIKh4wF5dQNSoQF2QSWC8FATo0GDcUHi2DBGFgGymLBwvcEBQPDpQZNi4qGxsoEjgCXEEAIfkEBQUACAAsAAAAABgAGAAABqZAhHCIEBQIBg/HICk4iNCh4OGBWK9WTgkQHZoUlFMJwyKpsJCFrBvhhJ7QGgqrgA9tr0BX6HhhTUQNO3Z7ADBWFAdEIQJ7UAMRJTREAjyOl0MNmJucnZ6foKGio6SdmqQphDljA5wCIUQBVRAwXJcAO6dCJlg3tl0BPxdQAgpYKDVRAh8cOF05C2g/JSw+JTAeCsOFJRxoVx4PjZgORygcHCgETl1BADs=",
3729						speed		: 'normal'
3730					},
3731					nextSelector	: _nextSelector,
3732					navSelector		: _navSelector,
3733					itemSelector	: _itemSelector,
3734					behavior		: '',
3735
3736					state: {
3737						isDone		: false
3738					}
3739				},
3740
3741				function(newElements) {
3742
3743					Init(true);
3744
3745					if(jQuery().isotope) {
3746
3747						_container.isotope('appended', jQuery(newElements));
3748
3749						setTimeout( function(){ 
3750							_container.isotope('layout'); 
3751						}, 2000);
3752
3753					}
3754
3755				});
3756
3757			});
3758
3759		}
3760
3761	}
3762
3763
3764
3765
3766
3767/** Image Zoom
3768 **************************************************************** **/
3769	function _zoom() {
3770		var _container = jQuery('figure.zoom');
3771		var _zoomDisabled = _container.hasClass('zoom-disabled')
3772		
3773		if(_container.length > 0) {
3774		
3775			loadScript(plugin_path + 'image.zoom/jquery.zoom.min.js', function() {
3776				
3777				if(jQuery().zoom) {
3778
3779					_container.each(function() {
3780						var _t 		= jQuery(this),
3781							_mode 	= _t.attr('data-mode'),
3782							_id		= _t.attr('id');
3783
3784						if(!_zoomDisabled) {
3785							if(_mode == 'grab') {
3786								_t.zoom({ on:'grab' });
3787							} else
3788
3789							if(_mode == 'click') {
3790								_t.zoom({ on:'click' });
3791							} else
3792
3793							if(_mode == 'toggle') {
3794								_t.zoom({ on:'toggle' });
3795							} else {
3796								_t.zoom();
3797							}
3798
3799							if(isMobile.any())  {
3800								_t.zoom({ on:'toggle' });
3801							}
3802						}
3803
3804						// Thumbnails
3805						if(_id) {
3806							jQuery('.zoom-more[data-for='+_id+'] a').bind("click", function(e) {
3807								e.preventDefault();
3808
3809								/* ---------- */
3810								var imgNr = jQuery(this).parent().index();
3811								/* ---------- */
3812
3813								var _href = jQuery(this).attr('href');
3814								
3815								if(_href != "#") {
3816									jQuery('.zoom-more[data-for='+_id+'] a').removeClass('active');
3817									jQuery(this).addClass('active');
3818
3819									/*
3820									jQuery('figure#'+_id + '>.lightbox').attr('href', _href);
3821									*/
3822
3823									$lightBoxImgs = jQuery('figure#'+_id + '>.lightbox-button');
3824									if ($lightBoxImgs.length > 0) {
3825										$lightBoxImgs.addClass('hidden').eq(imgNr).removeClass('hidden');
3826									}
3827
3828									jQuery('figure#'+_id + '>img').fadeOut(0, function() {
3829										jQuery('figure#'+_id + '>img').attr('src', _href);
3830									}).fadeIn(500);
3831
3832
3833								}
3834							});
3835						}
3836
3837					});
3838
3839				}
3840			
3841			});
3842		
3843		}
3844
3845	}
3846
3847
3848
3849
3850
3851/** Autosuggest
3852	http://twitter.github.io/typeahead.js/
3853 **************************************************************** **/
3854	function _autosuggest() {
3855		_container = jQuery('div.autosuggest');
3856
3857		if(_container.length > 0) {
3858
3859			loadScript(plugin_path + 'typeahead.bundle.js', function() {
3860
3861				if(jQuery().typeahead) {
3862					
3863					_container.each(function() {
3864						var	_t 					= jQuery(this),
3865							_minLength			= _t.attr('data-minLength') || 1,
3866							_qryURL 			= _t.attr('data-queryURL'),
3867							_limit	 			= _t.attr('data-limit') 	|| 10,
3868							_autoload 			= _t.attr('data-autoload');
3869							
3870							if(_autoload == "false") {
3871								return false;
3872							}
3873
3874							/** **/
3875							/* Bloodhound (Suggestion Engine) */
3876							var _typeahead = new Bloodhound({
3877								datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
3878								queryTokenizer: Bloodhound.tokenizers.whitespace,
3879								limit:	_limit,
3880								remote: {
3881									url: _qryURL + '%QUERY',
3882								},
3883 							});
3884
3885							jQuery('.typeahead', _t).typeahead({
3886								limit: 		_limit,
3887								hint: 		_t.attr('data-hint') 		== "false" ? false : true,
3888								highlight: 	_t.attr('data-highlight') 	== "false" ? false : true,
3889								minLength: parseInt(_minLength),
3890
3891								cache: 			false,
3892							},
3893							{
3894								name: '_typeahead',
3895								source: _typeahead
3896							});
3897							/** **/
3898  
3899					});
3900
3901					
3902				}
3903				
3904			});
3905			
3906		}
3907
3908	}
3909
3910
3911
3912
3913
3914
3915/** Form Stepper
3916 **************************************************************** **/
3917	function _stepper() {
3918		var _container = jQuery('input.stepper');
3919
3920		if(_container.length > 0) {
3921
3922			loadScript(plugin_path + 'form.stepper/jquery.stepper.min.js', function() {
3923
3924				if(jQuery().stepper) {
3925
3926					jQuery(_container).each(function() {
3927						var _t 		= jQuery(this),
3928							_min 	= _t.attr('min') || null,
3929							_max 	= _t.attr('max') || null;
3930
3931						_t.stepper({
3932							limit:						[_min,_max],
3933							floatPrecission:			_t.attr('data-floatPrecission') || 2,
3934							wheel_step: 				_t.attr('data-wheelstep') 		|| 0.1,
3935							arrow_step:	 				_t.attr('data-arrowstep') 		|| 0.2,
3936							allowWheel: 				_t.attr('data-mousescrool') 	== "false" ? false : true,
3937							UI: 						_t.attr('data-UI') 				== "false" ? false : true,
3938							// --
3939							type: 						_t.attr('data-type') 			|| "float",
3940							preventWheelAcceleration:	_t.attr('data-preventWheelAcceleration') == "false" ? false : true,
3941							incrementButton:			_t.attr('data-incrementButton') || "&blacktriangle;",
3942							decrementButton:			_t.attr('data-decrementButton') || "&blacktriangledown;",
3943							onStep:						null,
3944							onWheel:					null,
3945							onArrow:					null,
3946							onButton:					null,
3947							onKeyUp:					null
3948						});
3949
3950					});
3951
3952				}
3953
3954			});
3955
3956		}
3957
3958	}
3959
3960
3961
3962
3963
3964
3965/** Slimscroll
3966 **************************************************************** **/
3967	function _slimScroll() {
3968		var _container = jQuery('.slimscroll');
3969
3970		if(_container.length > 0) {
3971
3972			loadScript(plugin_path + 'slimscroll/jquery.slimscroll.min.js', function() {
3973
3974				if(jQuery().slimScroll) {
3975
3976					jQuery('.slimscroll').each(function () {
3977
3978						var height;
3979						if (jQuery(this).attr("data-height")) {
3980							height = jQuery(this).attr("data-height");
3981						} else {
3982							height = jQuery(this).height();
3983						}
3984
3985						jQuery(this).slimScroll({
3986							size: 				jQuery(this).attr("data-size") 							|| '5px',
3987							opacity: 			jQuery(this).attr("data-opacity") 						|| .6,
3988							position: 			jQuery(this).attr("data-position") 						|| 'right',
3989							allowPageScroll:	false, // not working
3990							disableFadeOut: 	false,
3991							railVisible: 		true,
3992							railColor: 			jQuery(this).attr("data-railColor")						|| '#222',
3993							railOpacity: 		jQuery(this).attr("data-railOpacity") 					|| 0.05,
3994							alwaysVisible: 		(jQuery(this).attr("data-alwaysVisible") != "false" 	? true : false),
3995							railVisible: 		(jQuery(this).attr("data-railVisible")   != "false" 	? true : false),
3996							color: 				jQuery(this).attr("data-color")  						|| '#333',
3997							wrapperClass: 		jQuery(this).attr("data-wrapper-class") 				|| 'slimScrollDiv',
3998							railColor: 			jQuery(this).attr("data-railColor")  					|| '#eaeaea',
3999							height: 			height
4000						});
4001					
4002
4003						// Disable body scroll on slimscroll hover
4004						if(jQuery(this).attr('disable-body-scroll') == 'true') {
4005
4006							jQuery(this).bind('mousewheel DOMMouseScroll', function(e) {
4007								var scrollTo = null;
4008
4009								if (e.type == 'mousewheel') {
4010									scrollTo = (e.originalEvent.wheelDelta * -1);
4011								}
4012								else if (e.type == 'DOMMouseScroll') {
4013									scrollTo = 40 * e.originalEvent.detail;
4014								}
4015
4016								if (scrollTo) {
4017									e.preventDefault();
4018									jQuery(this).scrollTop(scrollTo + jQuery(this).scrollTop());
4019								}
4020							});
4021
4022						}
4023
4024					});
4025
4026				}
4027				
4028			});
4029
4030		}
4031
4032	}
4033
4034
4035
4036
4037/** Modal Autoload
4038
4039	USAGE:
4040	
4041	<div id="MODAL-ID-REQUIRED" class="modal fade" data-autoload="true" data-autoload-delay="2000">
4042		...
4043	</div>
4044 **************************************************************** **/
4045	function _modalAutoLoad() {
4046		if(jQuery("div.modal").length > 0) {
4047
4048			jQuery("div.modal").each(function() {
4049				var _t 			= jQuery(this),
4050					_id			= _t.attr('id'),
4051					_autostart 	= _t.attr('data-autoload') || false;
4052
4053
4054				// reset allow
4055				// localStorage.removeItem(_id);
4056
4057
4058				if(_id != '') { // rewrite if set to hidden by the user
4059					if(localStorage.getItem(_id) == 'hidden') {
4060						_autostart = 'false';
4061					}
4062				}
4063
4064
4065				if(_autostart == 'true') {
4066
4067					jQuery(window).on("load", function() { // required on load!
4068						var _delay = _t.attr('data-autoload-delay') || 1000; // delay when modal apprear
4069
4070						setTimeout(
4071							function()  {
4072
4073								_t.modal('toggle');
4074
4075						}, parseInt(_delay));
4076
4077					});
4078
4079				}
4080
4081				// LOCAL STORAGE - DO NOT HIDE ON NEXT PAGE LOAD!
4082				jQuery("input.loadModalHide", this).bind("click", function() {
4083					var _tt = jQuery(this);
4084					
4085					if(_tt.is(":checked")) {
4086						localStorage.setItem(_id, 'hidden');
4087						console.log('[Modal Autoload #'+_id+'] Added to localStorage');
4088					} else {
4089						localStorage.removeItem(_id);
4090						console.log('[Modal Autoload #'+_id+'] Removed from localStorage');
4091					}
4092
4093				});
4094
4095			});
4096
4097		}
4098	}
4099
4100
4101
4102
4103
4104/** 10. Background Image
4105	class="boxed" should be added to body.
4106	Add to body - example: data-background="assets/images/boxed_background/1.jpg"
4107 **************************************************************** **/
4108	function _bgimage() {
4109
4110
4111		// Section Background Slideshow
4112		var _t 	= jQuery('section[data-background], section div[data-background]');
4113
4114		if(_t.length > 0) {
4115
4116			loadScript(plugin_path + 'jquery.backstretch.min.js', function() {
4117
4118				jQuery(_t).each(function() {
4119					var _this 				= jQuery(this),
4120						data_background 	= _this.attr('data-background')  	|| '';
4121
4122
4123					if(data_background != '') {
4124
4125						var data_background_delay	= _this.attr('data-background-delay') 	|| 3000,
4126							data_background_fade	= _this.attr('data-background-fade') 	|| 750;
4127							var instance;
4128
4129
4130
4131						var _db = data_background.split(',');
4132						var _db = data_background.replace(" ", "").split(',');
4133
4134						if(_db[1]) {
4135							_this.backstretch(_db, {duration: parseInt(data_background_delay), fade: parseInt(data_background_fade)});
4136						} else {
4137							_this.backstretch(_db);
4138						}
4139
4140
4141						/** NEXT|PREV
4142							<!-- Backstretch Navigation -->
4143							<a id="bs-next" href="#"></a>
4144							<a id="bs-prev" href="#"></a>
4145						**/
4146						jQuery(".bs-next", _this).bind("click", function(e) {
4147							e.preventDefault();
4148
4149							_this.data('backstretch').next();
4150						});
4151
4152						jQuery(".bs-prev", _this).bind("click", function(e) {
4153							e.preventDefault();
4154
4155							_this.data('backstretch').prev();
4156						});
4157
4158
4159						/** BACKSTRETCH BUGFIX
4160							For some reason, this plugin has some issues on window resize
4161							We use a small trick to force it to resize the background
4162						**/
4163						jQuery(window).resize(function() {
4164
4165							if(window.afterResizeBkstr) {
4166								clearTimeout(window.afterResizeBkstr);
4167							}
4168
4169							window.afterResizeBkstr = setTimeout(function() {
4170
4171								_this.data('backstretch').next();
4172
4173							}, 350);
4174
4175						});
4176
4177
4178					}
4179
4180				})
4181
4182			});
4183
4184
4185
4186
4187		}
4188
4189
4190		// BODY BACKGROUND ONLY
4191		var data_background = jQuery('body').attr('data-background') || '';
4192
4193		if(data_background != '') {
4194		
4195			loadScript(plugin_path + 'jquery.backstretch.min.js', function() {
4196
4197				if(data_background) {
4198					jQuery.backstretch(data_background);
4199					jQuery('body').addClass('transparent'); // remove backround color of boxed class
4200				}
4201
4202			});
4203
4204		}
4205	}
4206
4207
4208
4209
4210
4211/** STICKY ELEMENTS
4212 **************************************************************** **/
4213	function _stickyKit() {
4214
4215		if(jQuery('.sticky-kit').length < 1 || window.width < 960)
4216			return;
4217
4218		loadScript(plugin_path + "jquery.sticky-kit/jquery.sticky-kit.min.js", function(){
4219
4220			jQuery(".sticky-kit").each(function() {
4221
4222				var _t 				= jQuery(this),
4223					_offset 		= _t.data('offset') || Number(jQuery('#header').outerHeight());
4224
4225				_t.stick_in_parent({
4226					offset_top: 	Number(_offset)
4227				});
4228
4229			});
4230
4231
4232
4233		});
4234
4235	}
4236
4237
4238
4239
4240/** Cookie Alert
4241 **************************************************************** **/
4242	function _cookie_alert() {
4243
4244		var _el 		= jQuery('#cookie-alert'),
4245			_elCookie 	= _getCookie('cookie-alert');
4246
4247		if(_el.length > 0 && _elCookie == null) { // only if cookie is not set
4248			var _expire = _el.attr('data-expire') || 30;
4249
4250			if(_el.hasClass('alert-position-bottom')){
4251
4252				_el.animate({"bottom":"0px"}, 800, 'easeInOutExpo');
4253
4254			} else {
4255
4256				_el.animate({"top":"0px"}, 800, 'easeInOutExpo');
4257
4258			}
4259
4260			// on close, set cookie as closed
4261			jQuery('button', _el).bind('click', function() {
4262				_setCookie('cookie-alert','closed',Number(_expire))
4263			});
4264
4265		}
4266
4267		// reset cookie on request
4268		if(_el.length > 0 && _el.hasClass('cookie-reset')) {
4269			_delCookie('cookie-alert');
4270		}
4271
4272	}
4273
4274
4275
4276
4277
4278/** Flickr Widget
4279	<div class="widget-flickr clearfix lightbox margin-bottom-60" data-id="37304598@N02" data-limit="16" data-plugin-options='{"delegate": "a", "gallery": {"enabled": true}}'></div>
4280 **************************************************************** **/
4281	function _widget_flickr() {
4282		var _container = jQuery('.widget-flickr');
4283
4284		if(_container.length > 0) {
4285
4286			loadScript(plugin_path + 'widget.jflickr/jflickrfeed.min.js', function() {
4287
4288				if(jQuery().jflickrfeed) {
4289					if(jQuery('.widget-flickr')) {
4290
4291						/** **/
4292						_container.each(function() {
4293							var _t 		= jQuery(this),
4294								_id 	= _t.attr('data-id'),
4295								_limit 	= _t.attr('data-limit') || 14;
4296
4297							_t.jflickrfeed({
4298								limit: parseInt(_limit),
4299								qstrings: {
4300									id: _id
4301								},
4302								itemTemplate: '<li>'+
4303												'<a href="{{image}}" title="{{title}}">' +
4304													'<img src="{{image_s}}" alt="{{title}}" width="63" height="63" />' +
4305												'</a>' +
4306											  '</li>'
4307							}, function(data) {
4308								_lightbox();
4309							});
4310						
4311						});
4312						/** **/
4313
4314					}
4315				}
4316
4317			});
4318		
4319		}
4320
4321	}
4322
4323
4324
4325
4326/** Twitter Widget
4327 **************************************************************** **/
4328	function _widget_twitter() {
4329		var _container = jQuery(".widget-twitter");
4330
4331		if(_container.length > 0) {
4332
4333			loadScript(plugin_path + 'widget.twittie/twittie.min.js', function() {
4334
4335				if(jQuery().twittie) {
4336					// jQuery('.example1 .tweet').twittie({
4337						// dateFormat: '%b. %d, %Y',
4338						// template: '{{tweet}} <div class="date">{{date}}</div>',
4339						// count: 1,
4340						// loadingText: 'Loading!'
4341					// });
4342
4343						_container.each(function() {
4344							var _t 		= jQuery(this),
4345								_php 	= _t.attr('data-php'),			// PHP Script Path
4346								_usr 	= _t.attr('data-username'),		// Twitter Username
4347								_lmt 	= _t.attr('data-limit')	|| 3,	// Tweets Limit
4348								
4349								_url	= _php + "?username=" + _usr + "&limit=" + _lmt;
4350
4351							jQuery.getJSON(_url, function(tweets){
4352								_t.html(format_twitter(tweets));
4353							});
4354
4355						});
4356
4357				}
4358			
4359			});
4360		
4361		}
4362
4363	}
4364
4365	function format_twitter(twitt) {
4366		var statusHTML = [];
4367
4368		for(var i=0; i<twitt.length; i++) {
4369			var username = twitt[i].user.screen_name;
4370
4371			var status = twitt[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
4372				return '<a href="'+url+'" target="_blank">'+url+'</a>';
4373			}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
4374				return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>';
4375			});
4376
4377			statusHTML.push('<li><i class="fa fa-twitter"></i><span>'+status+'</span><small><a href="http://twitter.com/'+username+'/statuses/'+twitt[i].id_str+'" target="_blank">'+relative_time(twitt[i].created_at)+'</a></small></li>');
4378		}
4379
4380		return statusHTML.join('');
4381	}
4382
4383
4384	function relative_time(time_value) {
4385		var values 		= time_value.split(" "),
4386			parsed_date = Date.parse(time_value),
4387			relative_to = (arguments.length > 1) ? arguments[1] : new Date(),
4388			delta 		= parseInt((relative_to.getTime() - parsed_date) / 1000);
4389
4390		time_value 		= values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
4391		delta 			= delta + (relative_to.getTimezoneOffset() * 60);
4392
4393		if (delta < 60) {
4394			return 'less than a minute ago';
4395		} else if(delta < 120) {
4396			return 'about a minute ago';
4397		} else if(delta < (60*60)) {
4398			return (parseInt(delta / 60)).toString() + ' minutes ago';
4399		} else if(delta < (120*60)) {
4400			return 'about an hour ago';
4401		} else if(delta < (24*60*60)) {
4402			return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
4403		} else if(delta < (48*60*60)) {
4404			return '1 day ago';
4405		} else {
4406			return (parseInt(delta / 86400)).toString() + ' days ago';
4407		}
4408	}
4409
4410
4411
4412
4413/** Facebook Widget
4414	<div class="fb-like" data-href="http://www.stepofweb.com" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div>
4415 **************************************************************** **/
4416	function _widget_facebook() {
4417
4418		/** Like & Share Button
4419		 ************************ **/
4420		var _container_1 = jQuery('div.fb-like');
4421		var _container_2 = jQuery('div.fb-share-button');
4422		
4423		if(_container_1.length > 0 || _container_2.length > 0) {
4424
4425			jQuery('body').append('<div id="fb-root"></div>');
4426
4427			(function(d, s, id) {
4428				var js, fjs = d.getElementsByTagName(s)[0];
4429				if (d.getElementById(id)) return;
4430				js = d.createElement(s); js.id = id;
4431				js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
4432				fjs.parentNode.insertBefore(js, fjs);
4433			}(document, 'script', 'facebook-jssdk'));
4434		
4435		}
4436
4437	}
4438
4439
4440
4441
4442
4443/** Dribbble Widget
4444 **************************************************************** **/
4445	function _widget_dribbble() {
4446		var _container = jQuery(".widget-dribbble");
4447		
4448		if(_container.length > 0) {
4449
4450			loadScript(plugin_path + 'widget.dribbble/jribbble.min.js', function() {
4451
4452					var _token 	= _container.attr('data-token') 	|| 'f688ac519289f19ce5cebc1383c15ad5c02bd58205cd83c86cbb0ce09170c1b4', // demo default
4453						_target	= _container.attr('data-target') 	|| '_blank',
4454						_shots	= _container.attr('data-shots') 	|| 2046896; // demo default
4455
4456					jQuery.jribbble.setToken(_token);
4457
4458					jQuery.jribbble.shots(_shots).rebounds().then(function(res) {
4459						var html = [];
4460
4461						res.forEach(function(shot) {
4462							html.push('<li>');
4463							html.push('<a href="' + shot.html_url + '" target="' + _target + '">');
4464							html.push('<img class="img-responsive" src="' + shot.images.normal + '" alt="image">');
4465							html.push('</a></li>');
4466						});
4467
4468						_container.html(html.join(''));
4469					});
4470			
4471
4472			});
4473		
4474		}
4475
4476	}
4477
4478
4479
4480
4481
4482/** Media Widget [mediaelement plugin]
4483 **************************************************************** **/
4484	function _widget_media() {
4485		var _container = jQuery(".widget-media");
4486
4487		if(_container.length > 0) {
4488
4489			loadScript(plugin_path + 'widget.mediaelementbuild/mediaelement-and-player.min.js', function() {
4490
4491
4492			
4493			});
4494		
4495		}
4496
4497	}
4498
4499
4500
4501/** **************************************************************************************************************** **/
4502/** **************************************************************************************************************** **/
4503/** **************************************************************************************************************** **/
4504/** **************************************************************************************************************** **/
4505
4506
4507	/* 
4508		Mobile Check
4509
4510		if( isMobile.any() ) alert('Mobile');
4511		if( isMobile.iOS() ) alert('iOS');
4512	*/
4513
4514	var isMobile = {
4515	    iOS: function() {
4516	        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
4517	    },
4518	    Android: function() {
4519	        return navigator.userAgent.match(/Android/i);
4520	    },
4521	    BlackBerry: function() {
4522	        return navigator.userAgent.match(/BlackBerry/i);
4523	    },
4524	    Opera: function() {
4525	        return navigator.userAgent.match(/Opera Mini/i);
4526	    },
4527	    Windows: function() {
4528	        return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
4529	    },
4530	    any: function() {
4531	        return (isMobile.iOS() || isMobile.Android() || isMobile.BlackBerry() || isMobile.Opera() || isMobile.Windows());
4532	    }
4533	};
4534
4535
4536
4537
4538 	// Number Format
4539	Number.prototype.formatMoney = function(c, d, t){
4540	var n = this, 
4541	    c = isNaN(c = Math.abs(c)) ? 2 : c, 
4542	    d = d == undefined ? "." : d, 
4543	    t = t == undefined ? "," : t, 
4544	    s = n < 0 ? "-" : "", 
4545	    i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))), 
4546	    j = (j = i.length) > 3 ? j % 3 : 0;
4547	   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
4548	};
4549
4550
4551	// scroll 
4552	function wheel(e) {
4553	  e.preventDefault();
4554	}
4555
4556	function disable_scroll() {
4557	  if (window.addEventListener) {
4558		  window.addEventListener('DOMMouseScroll', wheel, false);
4559	  }
4560	  window.onmousewheel = document.onmousewheel = wheel;
4561	}
4562
4563	function enable_scroll() {
4564		if (window.removeEventListener) {
4565			window.removeEventListener('DOMMouseScroll', wheel, false);
4566		}
4567		window.onmousewheel = document.onmousewheel = document.onkeydown = null;  
4568	}
4569
4570	// overlay
4571	function enable_overlay() {
4572		jQuery("span.global-overlay").remove(); // remove first!
4573		jQuery('body').append('<span class="global-overlay"></span>');
4574	}
4575	function disable_overlay() {
4576		jQuery("span.global-overlay").remove();
4577	}
4578
4579
4580
4581
4582
4583
4584
4585/** Cookies
4586 **************************************************************** **/
4587function _setCookie(name,value,days) {
4588    var expires = "";
4589    if (days) {
4590        var date = new Date();
4591        date.setTime(date.getTime() + (days*24*60*60*1000));
4592        expires = "; expires=" + date.toUTCString();
4593    }
4594    document.cookie = name + "=" + value + expires + "; path=/";
4595}
4596
4597function _getCookie(name) {
4598    var nameEQ = name + "=";
4599    var ca = document.cookie.split(';');
4600    for(var i=0;i < ca.length;i++) {
4601        var c = ca[i];
4602        while (c.charAt(0)==' ') c = c.substring(1,c.length);
4603        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
4604    }
4605    return null;
4606}
4607
4608
4609function _delCookie(name) {
4610    _setCookie(name,"",-1);
4611}
4612
4613
4614
4615/** COUNT TO
4616	https://github.com/mhuggins/jquery-countTo
4617 **************************************************************** **/
4618 (function ($) {
4619	$.fn.countTo = function (options) {
4620		options = options || {};
4621
4622		return jQuery(this).each(function () {
4623			// set options for current element
4624			var settings = jQuery.extend({}, $.fn.countTo.defaults, {
4625				from:            jQuery(this).data('from'),
4626				to:              jQuery(this).data('to'),
4627				speed:           jQuery(this).data('speed'),
4628				refreshInterval: jQuery(this).data('refresh-interval'),
4629				decimals:        jQuery(this).data('decimals')
4630			}, options);
4631
4632			// how many times to update the value, and how much to increment the value on each update
4633			var loops = Math.ceil(settings.speed / settings.refreshInterval),
4634				increment = (settings.to - settings.from) / loops;
4635
4636			// references & variables that will change with each update
4637			var self = this,
4638				$self = jQuery(this),
4639				loopCount = 0,
4640				value = settings.from,
4641				data = $self.data('countTo') || {};
4642
4643			$self.data('countTo', data);
4644
4645			// if an existing interval can be found, clear it first
4646			if (data.interval) {
4647				clearInterval(data.interval);
4648			}
4649			data.interval = setInterval(updateTimer, settings.refreshInterval);
4650
4651			// __construct the element with the starting value
4652			render(value);
4653
4654			function updateTimer() {
4655				value += increment;
4656				loopCount++;
4657
4658				render(value);
4659
4660				if (typeof(settings.onUpdate) == 'function') {
4661					settings.onUpdate.call(self, value);
4662				}
4663
4664				if (loopCount >= loops) {
4665					// remove the interval
4666					$self.removeData('countTo');
4667					clearInterval(data.interval);
4668					value = settings.to;
4669
4670					if (typeof(settings.onComplete) == 'function') {
4671						settings.onComplete.call(self, value);
4672					}
4673				}
4674			}
4675
4676			function render(value) {
4677				var formattedValue = settings.formatter.call(self, value, settings);
4678				$self.html(formattedValue);
4679			}
4680		});
4681	};
4682
4683	$.fn.countTo.defaults = {
4684		from: 0,               // the number the element should start at
4685		to: 0,                 // the number the element should end at
4686		speed: 1000,           // how long it should take to count between the target numbers
4687		refreshInterval: 100,  // how often the element should be updated
4688		decimals: 0,           // the number of decimal places to show
4689		formatter: formatter,  // handler for formatting the value before rendering
4690		onUpdate: null,        // callback method for every time the element is updated
4691		onComplete: null       // callback method for when the element finishes updating
4692	};
4693
4694	function formatter(value, settings) {
4695		return value.toFixed(settings.decimals);
4696	}
4697}(jQuery));
4698
4699
4700
4701
4702/** BROWSER DETECT
4703	Add browser to html class
4704 **************************************************************** **/
4705(function($) {
4706	$.extend({
4707
4708		browserDetect: function() {
4709
4710			var u = navigator.userAgent,
4711				ua = u.toLowerCase(),
4712				is = function (t) {
4713					return ua.indexOf(t) > -1;
4714				},
4715				g = 'gecko',
4716				w = 'webkit',
4717				s = 'safari',
4718				o = 'opera',
4719				h = document.documentElement,
4720				b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + parseFloat(navigator.appVersion.split("MSIE")[1])) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.jQuery1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js'];
4721
4722			c = b.join(' ');
4723			h.className += ' ' + c;
4724
4725			var isIE11 = !(window.ActiveXObject) && "ActiveXObject" in window;
4726
4727			if(isIE11) {
4728				jQuery('html').removeClass('gecko').addClass('ie ie11');
4729				return;
4730			}
4731
4732		}
4733
4734	});
4735})(jQuery);
4736
4737 
4738
4739/** Appear
4740	https://github.com/bas2k/jquery.appear/
4741 **************************************************************** **/
4742(function(a){a.fn.appear=function(d,b){var c=a.extend({data:undefined,one:true,accX:0,accY:0},b);return this.each(function(){var g=a(this);g.appeared=false;if(!d){g.trigger("appear",c.data);return}var f=a(window);var e=function(){if(!g.is(":visible")){g.appeared=false;return}var r=f.scrollLeft();var q=f.scrollTop();var l=g.offset();var s=l.left;var p=l.top;var i=c.accX;var t=c.accY;var k=g.height();var j=f.height();var n=g.width();var m=f.width();if(p+k+t>=q&&p<=q+j+t&&s+n+i>=r&&s<=r+m+i){if(!g.appeared){g.trigger("appear",c.data)}}else{g.appeared=false}};var h=function(){g.appeared=true;if(c.one){f.unbind("scroll",e);var j=a.inArray(e,a.fn.appear.checks);if(j>=0){a.fn.appear.checks.splice(j,1)}}d.apply(this,arguments)};if(c.one){g.one("appear",c.data,h)}else{g.bind("appear",c.data,h)}f.scroll(e);a.fn.appear.checks.push(e);(e)()})};a.extend(a.fn.appear,{checks:[],timeout:null,checkAll:function(){var b=a.fn.appear.checks.length;if(b>0){while(b--){(a.fn.appear.checks[b])()}}},run:function(){if(a.fn.appear.timeout){clearTimeout(a.fn.appear.timeout)}a.fn.appear.timeout=setTimeout(a.fn.appear.checkAll,20)}});a.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(c,d){var b=a.fn[d];if(b){a.fn[d]=function(){var e=b.apply(this,arguments);a.fn.appear.run();return e}}})})(jQuery);
4743
4744/** Parallax
4745	http://www.ianlunn.co.uk/plugins/jquery-parallax/
4746 **************************************************************** **/
4747!function(n){n.fn.parallax=function(n,t,e){function o(){var o=jQuery(window).scrollTop();r=e?function(n){return n.outerHeight(!0)}:function(n){return n.height()},i.each(function(){var e=jQuery(this),i=e.offset().top,h=r(e);
vendor: 4,977 bytes, lines 4747-4758
4747if(!(o>i+h||i>o+window.height)){var l=Math.round((u-o)*t);e.css("backgroundPosition",n+" "+l+"px")}})}var r,u,i=jQuery(this);(arguments.length<1||null===n)&&(n="50%"),(arguments.length<2||null===t)&&(t=.1),(arguments.length<3||null===e)&&(e=!0),i.each(function(){u=i.offset().top,u<window.height&&(u=0)}),jQuery(window).bind("scroll",o).resize(o),o()}}(jQuery);
4748
4749
4750/** jQuery Easing v1.3
4751	http://gsgd.co.uk/sandbox/jquery/easing/
4752 **************************************************************** **/
4753jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
4754
4755/** WOW - v1.0.3 - 2015-01-14
4756	http://mynameismatthieu.com/WOW/
4757 **************************************************************** **/
4758(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]}
vendor: 4,547 bytes, line 4758
4758,a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationNameCache=new c}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addedNodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.doSync(c));return f}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=""+a.className+" "+this.config.animateClass,null!=this.config.callback?this.config.callback(a):void 0},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a}
4758,e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charAt(0).toUpperCase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getPropertyCSSValue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getPropertyCSSValue("-"+f+"-"+b);return c},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this);
4759
4760/** Modernizr 3.3.1
4761	http://modernizr.com/download/#-csstransforms3d-csstransitions-video-touch-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
4762 **************************************************************** **/
4763!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,a,s;for(var l in b)if(b.hasOwnProperty(l)){if(e=[],t=b[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)a=e[i],s=a.split("."),1===s.length?Modernizr[s[0]]=o:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=o),C.push((o?"":"no-")+s.join("-"))}}function i(e){var t=w.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),S?w.className.baseVal=t:w.className=t)}function a(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):S?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function s(e,t){if("object"==typeof e)for(var n in e)N(e,n)&&s(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2==r.length&&(o=o[r[1]]),"undefined"!=typeof o)return Modernizr;t="function"==typeof t?t():t,1==r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),i([(t&&0!=t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function c(e,t){return!!~(""+e).indexOf(t)}function u(){var e=t.body;return e||(e=a(S?"svg":"body"),e.fake=!0),e}function f(e,n,r,o){var i,s,l,c,f="modernizr",d=a("div"),p=u();if(parseInt(r,10))for(;r--;)l=a("div"),l.id=o?o[r]:f+(r+1),d.appendChild(l);return i=a("style"),i.type="text/css",i.id="s"+f,(p.fake?p:d).appendChild(i),p.appendChild(d),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),d.id=f,p.fake&&(p.style.background="",p.style.overflow="hidden",c=w.style.overflow,w.style.overflow="hidden",
4763w.appendChild(p)),s=n(d,e),p.fake?(p.parentNode.removeChild(p),w.style.overflow=c,w.offsetHeight):d.parentNode.removeChild(d),!!s}function d(e,t){return function(){return e.apply(t,arguments)}}function p(e,t,n){var o;for(var i in e)if(e[i]in t)return n===!1?e[i]:(o=t[e[i]],r(o,"function")?d(o,n||t):o);return!1}function m(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function h(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(m(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+m(t[o])+":"+r+")");return i=i.join(" or "),f("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function v(e,t,o,i){function s(){f&&(delete A.style,delete A.modElem)}if(i=r(i,"undefined")?!1:i,!r(o,"undefined")){var u=h(e,o);if(!r(u,"undefined"))return u}for(var f,d,p,m,v,g=["modernizr","tspan","samp"];!A.style&&g.length;)f=!0,A.modElem=a(g.shift()),A.style=A.modElem.style;for(p=e.length,d=0;p>d;d++)if(m=e[d],v=A.style[m],c(m,"-")&&(m=l(m)),A.style[m]!==n){if(i||r(o,"undefined"))return s(),"pfx"==t?m:!0;try{A.style[m]=o}catch(y){}if(A.style[m]!=v)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t,n,o,i){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+z.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?v(s,t,o,i):(s=(e+" "+T.join(a+" ")+a).split(" "),p(s,t,n))}function y(e,t,r){return g(e,n,n,t,r)}var C=[],b=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=E,Modernizr=new Modernizr;var _=E._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];E._prefixes=_;var w=t.documentElement,S="svg"===w.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,c(t)}function i(e){var t=y[e[v]];return t||(t={},g++,e[v]=g,y[g]=t),t}function a(e,n,r){if(n||(n=t),f)return n.createElement(e);r||(r=i(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():h.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||m.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function s(e,n){if(e||(e=t),f)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)o.createElement(s[a]);return o}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function c(e){e||(e=t);var r=i(e);return!C.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),f||l(e,r),e}var u,f,d="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,h=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",g=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",u="hidden"in e,f=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,f=!0}}();
4763var C={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:d,shivCSS:p.shivCSS!==!1,supportsUnknownElements:f,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:c,createElement:a,createDocumentFragment:s,addElements:o};e.html5=C,c(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var x="Moz O ms Webkit",T=E._config.usePrefixes?x.toLowerCase().split(" "):[];E._domPrefixes=T;var P=function(){function e(e,t){var o;return e?(t&&"string"!=typeof t||(t=a(t||"div")),e="on"+e,o=e in t,!o&&r&&(t.setAttribute||(t=a("div")),t.setAttribute(e,""),o="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),o):!1}var r=!("onblur"in t.documentElement);return e}();E.hasEvent=P,Modernizr.addTest("video",function(){var e=a("video"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t});var N;!function(){var e={}.hasOwnProperty;N=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){E.addTest=s});var j="CSS"in e&&"supports"in e.CSS,k="supportsCSS"in e;Modernizr.addTest("supports",j||k);var z=E._config.usePrefixes?x.split(" "):[];E._cssomPrefixes=z;var F=function(t){var r,o=_.length,i=e.CSSRule;if("undefined"==typeof i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in i)return"@"+t;for(var a=0;o>a;a++){var s=_[a],l=s.toUpperCase()+"_"+r;if(l in i)return"@-"+s.toLowerCase()+"-"+t}return!1};E.atRule=F;var L=E.testStyles=f,$={elem:a("modernizr")};Modernizr._q.push(function(){delete $.elem});var A={style:$.elem.style};Modernizr._q.unshift(function(){delete A.style});E.testProp=function(e,t,r){return v([e],n,t,r)};E.testAllProps=g;E.prefixed=function(e,t,n){return 0===e.indexOf("@")?F(e):(-1!=e.indexOf("-")&&(e=l(e)),t?g(e,t,n):g(e,"pfx"))};E.testAllProps=y,Modernizr.addTest("csstransitions",y("transition","all",!0)),Modernizr.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in w.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",L(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),o(),i(C),delete E.addTest,delete E.addAsyncTest;for(var M=0;M<Modernizr._q.length;M++)Modernizr._q[M]();e.Modernizr=Modernizr}(window,document);

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.