PageSourceSearch

https://www.cesecom.it/assets/js/scripts.js

js cesecom.it collected 2026-10-03 00:31:11 UTC 130,099 bytes, 4,223 lines download raw bytes

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

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