PageSourceSearch

https://yabda-project.eu/site/js/scripts.js

js yabda-project.eu collected 2026-10-08 20:35:08 UTC 127,401 bytes, 4,293 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.