PageSourceSearch

https://amphibiousmedics.com/assets/js/scripts.js?v=1.5.1.0

js amphibiousmedics.com collected 2026-10-07 15:36:42 UTC 118,179 bytes, 3,664 lines download raw bytes

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

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.