PageSourceSearch

https://ieverymath.com/assets/js/scripts.js

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