PageSourceSearch

https://dottorati.uniroma2.it/assets/js/scripts.js

js uniroma2.it collected 2026-09-24 08:29:40 UTC 144,422 bytes, 4,206 lines download raw bytes

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

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.