PageSourceSearch

https://www.webads.it/wp-content/themes/enfold/js/avia.js?ver=3

js webads.it collected 2026-10-06 19:10:33 UTC 114,446 bytes, 2,189 lines download raw bytes

1(function($)
2{	
3    "use strict";
4	
5	//fix back forward cache issue: http://stackoverflow.com/questions/11979156/mobile-safari-back-button
6    $(window).bind("pageshow", function(event) {
7	    if (event.originalEvent.persisted) {
8	     avia_site_preloader();
9	    }
10	});
11	
12    $(document).ready(function()
13    {	    
14	    
15        var aviabodyclasses = AviaBrowserDetection('html');
16
17		$.avia_utilities = $.avia_utilities || {};
18		if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement)
19    	{
20    		$.avia_utilities.isMobile =  true;
21    	}
22    	else
23    	{
24    		$.avia_utilities.isMobile =  false;
25    	}
26
27    	
28        //check if user uses IE7 - if yes don't execute the function or the menu will break
29        if(aviabodyclasses.indexOf("avia-msie-7") == -1) avia_responsive_menu();
30
31        // decreases header size when user scrolls down
32        avia_header_size();
33        
34        // set sidebar main menu option
35        avia_sidebar_menu();
36        
37        //activates the sticky submenu
38		avia_sticky_submenu();        
39		
40		//activates the sticky submenu
41		avia_hamburger_menu();
42
43        //show scroll top button
44        avia_scroll_top_fade();
45        
46        //site preloader script
47        avia_site_preloader();
48        
49        //creates search tooltip
50        new $.AviaTooltip({"class": 'avia-search-tooltip',data: 'avia-search-tooltip', event:'click', position:'bottom', scope: "body", attach:'element'});
51
52        //creates relate posts tooltip
53        new $.AviaTooltip({"class": 'avia-related-tooltip', data: 'avia-related-tooltip', scope: ".related_posts, .av-share-box", attach:'element', delay:0});
54
55        //creates ajax search
56        new $.AviaAjaxSearch({scope:'#header'});
57
58		// actiavte portfolio sorting
59		if($.fn.avia_iso_sort)
60		$('.grid-sort-container').avia_iso_sort();
61
62		//activates the mega menu javascript
63		if($.fn.aviaMegamenu)
64		$(".main_menu .menu").aviaMegamenu({modify_position:true});
65		
66
67		
68		
69		$.avia_utilities.avia_ajax_call();
70		
71		
72    });
73
74	$.avia_utilities = $.avia_utilities || {};
75	
76	$.avia_utilities.avia_ajax_call = function(container)
77	{
78		if(typeof container == 'undefined'){ container = 'body';};
79		
80		
81		$('a.avianolink').on('click', function(e){ e.preventDefault(); });
82        $('a.aviablank').attr('target', '_blank');
83
84        //activates the prettyphoto lightbox
85        $(container).avia_activate_lightbox();
86        
87        //scrollspy for main menu. must be located before smoothscrolling
88		if($.fn.avia_scrollspy)
89		{
90			if(container == 'body')
91			{
92				$('body').avia_scrollspy({target:'.main_menu .menu li > a'});
93			}
94			else
95			{
96				$('body').avia_scrollspy('refresh');
97			}
98		}
99
100		//smooth scrooling
101		if($.fn.avia_smoothscroll)
102		$('a[href*="#"]', container).avia_smoothscroll(container);
103
104		avia_small_fixes(container);
105
106		avia_hover_effect(container);
107
108		avia_iframe_fix(container);
109
110		//activate html5 video player
111		if($.fn.avia_html5_activation && $.fn.mediaelementplayer)
112		$(".avia_video, .avia_audio", container).avia_html5_activation({ratio:'16:9'});
113
114	}
115	
116	// -------------------------------------------------------------------------------------------
117	// Error log helper
118	// -------------------------------------------------------------------------------------------
119	
120	$.avia_utilities.log = function(text, type, extra)
121	{
122		if(typeof console == 'undefined'){return;} if(typeof type == 'undefined'){type = "log"} type = "AVIA-" + type.toUpperCase(); 
123		console.log("["+type+"] "+text); if(typeof extra != 'undefined') console.log(extra); 
124	}
125
126
127
128	// -------------------------------------------------------------------------------------------
129	// modified SCROLLSPY by bootstrap
130	// -------------------------------------------------------------------------------------------
131
132	
133	  function AviaScrollSpy(element, options)
134	  {
135	  	var self = this;
136	  
137		    var process = $.proxy(self.process, self)
138		      , refresh = $.proxy(self.refresh, self)
139		      , $element = $(element).is('body') ? $(window) : $(element)
140		      , href
141		    self.$body = $('body')
142		    self.$win = $(window)
143		    self.options = $.extend({}, $.fn.avia_scrollspy.defaults, options)
144		    self.selector = (self.options.target
145		      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
146		      || '')
147		    
148		   	self.activation_true = false;
149		   	
150		    if(self.$body.find(self.selector + "[href*='#']").length)
151		    {
152		    	self.$scrollElement = $element.on('scroll.scroll-spy.data-api', process);
153		    	self.$win.on('av-height-change', refresh);
154		    	self.$body.on('av_resize_finished', refresh);
155		    	self.activation_true = true;
156		    	self.checkFirst();
157		    	
158		    	setTimeout(function()
159	  			{
160		    		self.refresh()
161		    		self.process()
162		    		
163		    	},100);
164		    }
165	    
166	  }
167	
168	  AviaScrollSpy.prototype = {
169	
170	      constructor: AviaScrollSpy
171		, checkFirst: function () {
172		
173			var current = window.location.href.split('#')[0],
174				matching_link = this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top');
175		}
176	    , refresh: function () {
177	    
178	    if(!this.activation_true) return;
179	    
180	        var self = this
181	          , $targets
182	
183	        this.offsets = $([])
184	        this.targets = $([])
185	
186	        $targets = this.$body
187	          .find(this.selector)
188	          .map(function () {
189	            var $el = $(this)
190	              , href = $el.data('target') || $el.attr('href')
191	              , hash = this.hash
192	              , hash = hash.replace(/\//g, "")
193	              , $href = /^#\w/.test(hash) && $(hash)
194	             
195	            return ( $href
196	              && $href.length
197	              && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
198	          })
199	          .sort(function (a, b) { return a[0] - b[0] })
200	          .each(function () {
201	            self.offsets.push(this[0])
202	            self.targets.push(this[1])
203	          })
204	          
205	      }
206	
207	    , process: function () {
208	    	
209	    	if(!this.offsets) return;
210	    	if(isNaN(this.options.offset)) this.options.offset = 0;
211	    	
212	        var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
213	          , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
214	          , maxScroll = scrollHeight - this.$scrollElement.height()
215	          , offsets = this.offsets
216	          , targets = this.targets
217	          , activeTarget = this.activeTarget
218	          , i
219
220	        if (scrollTop >= maxScroll) {
221	          return activeTarget != (i = targets.last()[0])
222	            && this.activate ( i )
223	        }
224			
225	        for (i = offsets.length; i--;) {
226	          activeTarget != targets[i]
227	            && scrollTop >= offsets[i]
228	            && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
229	            && this.activate( targets[i] )
230	        }
231	      }
232	
233	    , activate: function (target) {
234	        var active
235	          , selector
236	
237	        this.activeTarget = target
238	
239	        $(this.selector)
240	          .parent('.' + this.options.applyClass)
241	          .removeClass(this.options.applyClass)
242	
243	        selector = this.selector
244	          + '[data-target="' + target + '"],'
245	          + this.selector + '[href="' + target + '"]'
246	
247	
248	
249	        active = $(selector)
250	          .parent('li')
251	          .addClass(this.options.applyClass)
252			  
253	        if (active.parent('.sub-menu').length)  {
254	          active = active.closest('li.dropdown_ul_available').addClass(this.options.applyClass)
255	        }
256	
257	        active.trigger('activate')
258	      }
259	
260	  }
261	
262	
263	 /* AviaScrollSpy PLUGIN DEFINITION
264	  * =========================== */
265	
266	  $.fn.avia_scrollspy = function (option) {
267	    return this.each(function () {
268	      var $this = $(this)
269	        , data = $this.data('scrollspy')
270	        , options = typeof option == 'object' && option
271	      if (!data) $this.data('scrollspy', (data = new AviaScrollSpy(this, options)))
272	      if (typeof option == 'string') data[option]()
273	    })
274	  }
275	
276	  $.fn.avia_scrollspy.Constructor = AviaScrollSpy
277	
278	  $.fn.avia_scrollspy.calc_offset = function()
279	  {
280		  var 	offset_1 = (parseInt($('.html_header_sticky #main').data('scroll-offset'), 10)) || 0,
281		  		offset_2 = ($(".html_header_sticky:not(.html_top_nav_header) #header_main_alternate").outerHeight()) || 0,
282		  		offset_3 = ($(".html_header_sticky.html_header_unstick_top_disabled #header_meta").outerHeight()) || 0,
283		  		offset_4 =  1,
284		  		offset_5 = parseInt($('html').css('margin-top'),10) || 0,
285		  		offset_6 = parseInt($('.av-frame-top ').outerHeight(),10) || 0;
286		  
287		  return offset_1 + offset_2 + offset_3 + offset_4 + offset_5 + offset_6;
288	  }
289	
290	  $.fn.avia_scrollspy.defaults = 
291	  {
292	    offset: $.fn.avia_scrollspy.calc_offset(),
293	    applyClass: 'current-menu-item'
294	  }
295	  
296
297	function avia_site_preloader()
298	{
299		var win = $(window), preloader_active = $('html.av-preloader-active'), pre_wrap;
300		
301		if( preloader_active.length )
302		{	
303			var hide = function()
304			{
305				pre_wrap.avia_animate({opacity:0}
305, function()
306	    		{
307	    			preloader_active.removeClass('av-preloader-active');
308	    		});
309			};
310			
311			
312			pre_wrap = $('.av-siteloader-wrap');
313			setTimeout(function()
314			{
315				$.avia_utilities.preload({container: preloader_active, global_callback: hide });
316				
317				//fallback
318				setTimeout(function()
319				{
320					if(preloader_active.is('.av-preloader-active')) 
321					{ 
322						hide(); 
323						$.avia_utilities.log('Hide Preloader (Fallback)');
324					}
325				
326				},4000);
327				
328				if( pre_wrap.is('.av-transition-enabled') )
329				{
330					var comp = new RegExp(location.host), 
331						exclude = " .no-transition, .mfp-iframe, .lightbox-added, .grid-links-ajax a, #menu-item-search a";
332					
333					preloader_active.on('click', 'a:not('+exclude+')',function(e)
334					{	
335						if(!e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
336						{	
337							var link = this; 
338							if(comp.test(link.href) && link.href.split('#')[0] != location.href.split('#')[0] && link.target == "")
339							{
340								if(link.href.indexOf('mailto:') == -1 && link.href.indexOf('add-to-cart=') == -1 )
341								{
342							       	e.preventDefault();
343							       	preloader_active.addClass('av-preloader-active av-preloader-reactive');
344									pre_wrap.avia_animate({opacity:1}, function()
345									{
346										window.location = link.href;
347									});
348								}
349							}
350						}
351					});
352				}
353				
354				
355			}, 500);
356		}
357	}
358
359
360    // -------------------------------------------------------------------------------------------
361    // detect browser and add class to body
362    // -------------------------------------------------------------------------------------------
363
364    function AviaBrowserDetection(outputClassElement)
365    {
366        if(typeof($.browser) !== 'undefined')
367        {
368            var bodyclass = '', version = $.browser.version ? parseInt($.browser.version) : "";
369
370            if($.browser.msie){
371                bodyclass += 'avia-msie';
372            }else if($.browser.webkit){
373                bodyclass += 'avia-webkit';
374            }else if($.browser.mozilla)
375            {
376                bodyclass += 'avia-mozilla';
377            }
378
379            if($.browser.version) bodyclass += ' ' + bodyclass + '-' + version + ' ';
380            if($.browser.name)    bodyclass += ' avia-' + $.browser.name + ' avia-' +$.browser.name +'-' + version + ' ';
381
382            if($.browser.ipad){
383                bodyclass += ' avia-ipad ';
384            }else if($.browser.iphone){
385                bodyclass += ' avia-iphone ';
386            }else if($.browser.android){
387                bodyclass += ' avia-android ';
388            }else if($.browser.win){
389                bodyclass += ' avia-windows ';
390            }else if($.browser.mac){
391                bodyclass += ' avia-mac ';
392            }else if($.browser.linux){
393                bodyclass += ' avia-linux ';
394            }
395        }
396
397        if(outputClassElement) $(outputClassElement).addClass(bodyclass)
398        
399        return bodyclass;
400    }
401
402
403
404    // -------------------------------------------------------------------------------------------
405	// responsive menu function
406	// -------------------------------------------------------------------------------------------
407
408    function avia_responsive_menu()
409    {
410    	var $html = $('html'), win = $(window), header = $('.responsive #header');
411
412    	if(!header.length) return;
413
414    	var menu 			  	= header.find('.main_menu ul:eq(0)'),
415	    	first_level_items 	= menu.find('>li').length,
416	    	container			= $('#wrap_all'),
417    		show_menu_btn		= $('#advanced_menu_toggle'),
418    		hide_menu_btn		= $('#advanced_menu_hide'),
419    		mobile_advanced 	= menu.clone().attr({id:"mobile-advanced", "class":""}),
420    		sub_hidden			= $html.is('.html_header_mobile_behavior'),
421			insert_menu 		= function()
422			{	
423				if(first_level_items == 0) 
424				{
425					show_menu_btn.remove();
426				}
427				else
428				{
429					var after_menu = $('#header .logo');
430					if(after_menu.length == 0) after_menu = "#main .logo:eq(0)";
431					show_menu_btn.insertAfter(after_menu);
432					mobile_advanced.find('.noMobile').remove();
433					mobile_advanced.prependTo(container);
434					hide_menu_btn.prependTo(container);
435				}
436			},
437			set_height = function()
438			{
439				var height = mobile_advanced.outerHeight(true), win_h  = win.height();
440				
441				if(height < win_h) height = win_h;
442				container.css({'height':height});
443				
444				mobile_advanced.css({position:'absolute', 'min-height':win_h});
445			},
446			hide_menu = function()
447			{	
448				container.removeClass('show_mobile_menu');
449				setTimeout(function(){ 
450					container.css({'height':"auto", 'overflow':'hidden', 'minHeight':0}); 
451					mobile_advanced.css({display:'none'});
452				},600);
453				return false;
454			},
455			autohide = function()
456			{
457				if(container.is('.show_mobile_menu') && hide_menu_btn.css('display') == 'none'){ hide_menu(); }
458			},
459			show_menu = function()
460			{
461				if(container.is('.show_mobile_menu'))
462				{
463					hide_menu();
464				}
465				else
466				{
467					win.scrollTop(0);
468					mobile_advanced.css({display:'block'});
469					setTimeout(function(){container.addClass('show_mobile_menu'); },10);
470					set_height();
471				}
472				return false;
473			};
474		
475		$html.on('click', '#mobile-advanced li a, #mobile-advanced .mega_menu_title', function()
476		{
477			var current = $(this);
478			
479			//if submenu items are hidden do the toggle
480			if(sub_hidden)
481			{
482				var list_item = current.siblings('ul, .avia_mega_div');
483				if ( current.siblings('ul').children('.avia_mega_text_block').length && current.siblings('ul').children('li').length == 1 ) { list_item = ''; }
484				if(list_item.length)
485				{
486					if(list_item.hasClass('visible_sublist'))
487					{
488						list_item.removeClass('visible_sublist');
489					}
490					else
491					{
492						list_item.addClass('visible_sublist');
493					}
494					set_height();
495					return false;
496				}
497			}
498			
499			//when clicked on anchor link remove the menu so the body can scroll to the anchor
500			if(current.filter('[href*="#"]').length)
501			{
502				container.removeClass('show_mobile_menu');
503				container.css({'height':"auto"});
504			}
505			
506		});
507		
508
509		show_menu_btn.click(show_menu);
510		hide_menu_btn.click(hide_menu);
511		win.on( 'debouncedresize',  autohide );
512		insert_menu();
513    }
514
515
516    // -------------------------------------------------------------------------------------------
517	// html 5 videos
518	// -------------------------------------------------------------------------------------------
519    $.fn.avia_html5_activation = function(options)
520	{	
521		var defaults =
522		{
523			ratio: '16:9'
524		};
525
526		var options  = $.extend(defaults, options),
527			isMobile = $.avia_utilities.isMobile;
528		
529		// if(isMobile) return;
530		
531		this.each(function()
532		{
533		var fv 			= $(this),
534	      	id_to_apply = '#' + fv.attr('id'),
535	      	posterImg 	= fv.attr('poster');
536		
537
538		fv.mediaelementplayer({
539		    // if the <video width> is not specified, this is the default
540		    defaultVideoWidth: 480,
541		    // if the <video height> is not specified, this is the default
542		    defaultVideoHeight: 270,
543		    // if set, overrides <video width>
544		    videoWidth: -1,
545		    // if set, overrides <video height>
546		    videoHeight: -1,
547		    // width of audio player
548		    audioWidth: 400,
549		    // height of audio player
550		    audioHeight: 30,
551		    // initial volume when the player starts
552		    startVolume: 0.8,
553		    // useful for <audio> player loops
554		    loop: false,
555		    // enables Flash and Silverlight to resize to content size
556		    enableAutosize: false,
557		    // the order of controls you want on the control bar (and other plugins below)
558		    features: ['playpause','progress','current','duration','tracks','volume'],
559		    // Hide controls when playing and mouse is not over the video
560		    alwaysShowControls: false,
561		    // force iPad's native controls
562		    iPadUseNativeControls: false,
563		    // force iPhone's native controls
564		    iPhoneUseNativeControls: false,
565		    // force Android's native controls
566		    AndroidUseNativeControls: false,
567		    // forces the hour marker (##:00:00)
568		    alwaysShowHours: false,
569		    // show framecount in timecode (##:00:00:00)
570		    showTimecodeFrameCount: false,
571		    // used when showTimecodeFrameCount is set to true
572		    framesPerSecond: 25,
573		    // turns keyboard support on and off for this instance
574		    enableKeyboard: true,
575		    // when this player starts, it will pause other players
576		    pauseOtherPlayers: false,
577		    poster: posterImg,
578		    success: function (mediaElement, domObject) { 
579         	
580				setTimeout(function()
581				{
582					if (mediaElement.pluginType == 'flash') 
583					{	
584						mediaElement.addEventListener('canplay', function() { fv.trigger('av-mediajs-loaded'); }, false);
585					}
586					else
587					{
588				        fv.trigger('av-mediajs-loaded').addClass('av-mediajs-loaded');
589					}
590				         
591				     mediaElement.addEventListener('ended', function() {  fv.trigger('av-mediajs-ended'); }, false);  
592				     
593				},10);
594		         
595		    },
596		    // fires when a problem is detected
597		    error: function () { 
598		
599		    },
600		    
601		    // array of keyboard commands
602		    keyActions: []
603			});
604				
605			});
606		}
607
608
609
610 	// -------------------------------------------------------------------------------------------
611	// hover effect for images
612	// -------------------------------------------------------------------------------------------
613    function avia_hover_effect(container)
614    {
615    	//hover overlay for mobile device doesnt really make sense. in addition it often slows down the click event
616    	if($.avia_utilities.isMobile) return;
617    
618		var overlay = "", cssTrans = $.avia_utilities.supports('transition');
619		
620		if(container == 'body')
621    	{
622    		var elements = $('#main a img').parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .avia-layerslider a, .noHover, .noHover a, .av-logo-container .logo a').add('#main .avia-hover-fx');
623    	}
624    	else
625    	{
626    		var elements = $('a img', container).parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .avia-layerslider a, .noHover, .noHover a, .av-logo-container .logo a').add('.avia-hover-fx', container);
627    	}
628
629	   elements.each(function(e)
630       {
631            var link = $(this), 
632            	current = link.find('img:first');
633
634            if(current.hasClass('alignleft')) link.addClass('alignleft').css({float:'left', margin:0, padding:0});
635            if(current.hasClass('alignright')) link.addClass('alignright').css({float:'right', margin:0, padding:0});
636            if(current.hasClass('aligncenter')) link.addClass('aligncenter').css({float:'none','text-align':'center', margin:0, padding:0});
637
638            if(current.hasClass('alignnone'))
639            {
640               link.addClass('alignnone').css({margin:0, padding:0});;
641               if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'inline-block'}); }
642            }
643            
644            if(!link.css('position') || link.css('position') == 'static') { link.css({position:'relative', overflow:'hidden'}); }
645            
646            var url		 	= link.attr('href'),
647				span_class	= "overlay-type-video",
648				opa			= link.data('opacity') || 0.7,
649				overlay_offset = 5,
650				overlay 	= link.find('.image-overlay');
651            	
652            	if(url)
653				{
654					if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image";
655					if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern";
656				}
657				
658				if(!overlay.length)
659				{
660					overlay = $("<span class='image-overlay "+span_class+"'><span class='image-overlay-inside'></span></span>").appendTo(link);
661				}
662            	
663            	link.on('mouseenter', function(e)
664				{
665					var current = link.find('img:first'),
666						_self	= current.get(0),
667						outerH 	= current.outerHeight(),
668						outerW 	= current.outerWidth(),
669						pos		= current.position(),
670						linkCss = link.css('display'),
671						overlay = link.find('.image-overlay');
672					
673					if(outerH > 100)
674					{
675						
676						if(!overlay.length)
677						{
678							overlay = $("<span class='image-overlay "+span_class+"'><span class='image-overlay-inside'></span></span>").appendTo(link);
679							
680						}
681						//can be wrapped into if !overlay.length statement if chrome fixes fade in problem
682						if(link.height() == 0) { link.addClass(_self.className); _self.className = ""; }
683						if(!linkCss || linkCss == 'inline') { link.css({display:'block'}); }
684						//end wrap
685						
686						overlay.css({left:(pos.left - overlay_offset) + parseInt(current.css("margin-left"),10), top:pos.top + parseInt(current.css("margin-top"),10)})
687							   .css({overflow:'hidden',display:'block','height':outerH,'width':(outerW + (2*overlay_offset))});
688							   
689						if(cssTrans === false ) overlay.stop().animate({opacity:opa}, 400);
690					}
691					else
692					{
693						overlay.css({display:"none"});
694					}
695		
696				}).on('mouseleave', elements, function(){
697		
698					if(overlay.length)
699					{
700						if(cssTrans === false ) overlay.stop().animate({opacity:0}
700, 400);
701					}
702				});
703        });
704    }
705
706
707
708
709
710
711
712
713// -------------------------------------------------------------------------------------------
714// Smooth scrooling when clicking on anchor links
715// todo: maybe use https://github.com/ryanburnette/scrollToBySpeed/blob/master/src/scrolltobyspeed.jquery.js in the future
716// -------------------------------------------------------------------------------------------
717
718	(function($)
719	{
720		$.fn.avia_smoothscroll = function(apply_to_container)
721		{
722			if(!this.length) return;
723				
724			var the_win = $(window),
725				$header = $('#header'),
726				$main 	= $('.html_header_top.html_header_sticky #main').not('.page-template-template-blank-php #main'),
727				$meta 	= $('.html_header_top.html_header_unstick_top_disabled #header_meta'),
728				$alt  	= $('.html_header_top:not(.html_top_nav_header) #header_main_alternate'),
729				shrink	= $('.html_header_top.html_header_shrinking').length,
730				frame	= $('.av-frame-top'),
731				fixedMainPadding = 0,
732				isMobile = $.avia_utilities.isMobile,
733				sticky_sub = $('.sticky_placeholder:first'), 
734				calc_main_padding= function()
735				{
736					if($header.css('position') == "fixed")
737					{
738						var tempPadding  		= parseInt($main.data('scroll-offset'),10) || 0,
739							non_shrinking		= parseInt($meta.outerHeight(),10) || 0,
740							non_shrinking2		= parseInt($alt.outerHeight(),10) || 0; 
741						
742						if(tempPadding > 0 && shrink) 
743						{
744							tempPadding = (tempPadding / 2 ) + non_shrinking + non_shrinking2;
745						}
746						else
747						{
748							tempPadding = tempPadding + non_shrinking + non_shrinking2;
749						}
750						
751						tempPadding += parseInt($('html').css('margin-top'),10);
752						fixedMainPadding = tempPadding; 
753					}
754					else
755					{
756						fixedMainPadding = parseInt($('html').css('margin-top'),10);
757					}
758					
759					if(frame.length){
760						fixedMainPadding += frame.height();
761					}
762					
763				};
764			
765			if(isMobile) shrink = false;
766			
767			calc_main_padding();
768			the_win.on("debouncedresize av-height-change",  calc_main_padding);
769
770			var hash = window.location.hash.replace(/\//g, "");
771			
772			//if a scroll event occurs at pageload and an anchor is set and a coresponding element exists apply the offset to the event
773			if (fixedMainPadding > 0 && hash && apply_to_container == 'body' && hash.charAt(1) != "!" && hash.indexOf("=") === -1)
774			{
775				var scroll_to_el = $(hash), modifier = 0;
776				
777				if(scroll_to_el.length)
778				{
779					the_win.on('scroll.avia_first_scroll', function()
780					{	
781						setTimeout(function(){ //small delay so other scripts can perform necessary resizing
782							if(sticky_sub.length && scroll_to_el.offset().top > sticky_sub.offset().top) { modifier = sticky_sub.outerHeight() - 3; }
783							the_win.off('scroll.avia_first_scroll').scrollTop( scroll_to_el.offset().top - fixedMainPadding - modifier);
784						},10); 
785				    });
786			    }
787			}
788			
789			return this.each(function()
790			{
791				$(this).click(function(e) {
792
793				   var newHash  = this.hash.replace(/\//g, ""),
794				   	   clicked  = $(this),
795				   	   data		= clicked.data();
796					
797				   if(newHash != '' && newHash != '#' && newHash != '#prev' && newHash != '#next' && !clicked.is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll'))
798				   {
799					   var container = "", originHash = "";
800					   
801					   if("#next-section" == newHash)
802					   {
803					   		originHash  = newHash;
804					   		container   = clicked.parents('.container_wrap:eq(0)').nextAll('.container_wrap:eq(0)');
805					   		newHash		= '#' + container.attr('id') ;
806					   }
807					   else
808					   {
809					   		container = $(this.hash.replace(/\//g, ""));
810					   }
811					   
812					   
813
814						if(container.length)
815						{
816							var cur_offset = the_win.scrollTop(),
817								container_offset = container.offset().top,
818								target =  container_offset - fixedMainPadding,
819								hash = window.location.hash,
820								hash = hash.replace(/\//g, ""),
821								oldLocation=window.location.href.replace(hash, ''),
822								newLocation=this,
823								duration= data.duration || 1200,
824								easing= data.easing || 'easeInOutQuint';
825							
826							if(sticky_sub.length && container_offset > sticky_sub.offset().top) { target -= sticky_sub.outerHeight() - 3;}
827							
828							// make sure it's the same location
829							if(oldLocation+newHash==newLocation || originHash)
830							{
831								if(cur_offset != target) // if current pos and target are the same dont scroll
832								{
833									if(!(cur_offset == 0 && target <= 0 )) // if we are at the top dont tr
833y to scroll to top or above
834									{
835										// animate to target and set the hash to the window.location after the animation
836										$('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {
837										
838											// add new hash to the browser location
839											//window.location.href=newLocation;
840											if(window.history.replaceState)
841											window.history.replaceState("", "", newHash);
842										});
843									}
844								}
845								// cancel default click action
846								e.preventDefault();
847							}
848						}
849					}
850				});
851			});
852		};
853	})(jQuery);
854
855
856	// -------------------------------------------------------------------------------------------
857	// iframe fix for firefox and ie so they get proper z index
858	// -------------------------------------------------------------------------------------------
859	function avia_iframe_fix(container)
860	{
861		var iframe 	= jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame)', container),
862			youtubeEmbed = jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame) object, iframe[src*="youtube.com"]:not(.av_youtube_frame) embed', container).attr('wmode','opaque');
863
864			iframe.each(function()
865			{
866				var current = jQuery(this),
867					src 	= current.attr('src');
868
869				if(src)
870				{
871					if(src.indexOf('?') !== -1)
872					{
873						src += "&wmode=opaque";
874					}
875					else
876					{
877						src += "?wmode=opaque";
878					}
879
880					current.attr('src', src);
881				}
882			});
883	}
884
885	// -------------------------------------------------------------------------------------------
886	// small js fixes for pixel perfection :)
887	// -------------------------------------------------------------------------------------------
888	function avia_small_fixes(container)
889	{
890		if(!container) container = document;
891
892		//make sure that iframes do resize correctly. uses css padding bottom iframe trick
893		var win		= jQuery(window),
894			iframes = jQuery('.avia-iframe-wrap iframe:not(.avia-slideshow iframe):not( iframe.no_resize):not(.avia-video iframe)', container),
895			adjust_iframes = function()
896			{
897				iframes.each(function(){
898
899					var iframe = jQuery(this), parent = iframe.parent(), proportions = 56.25;
900
901					if(this.width && this.height)
902					{
903						proportions = (100/ this.width) * this.height;
904						parent.css({"padding-bottom":proportions+"%"});
905					}
906				});
907			};
908
909			adjust_iframes();
910
911	}
912
913	// -------------------------------------------------------------------------------------------
914	// Ligthbox activation
915	// -------------------------------------------------------------------------------------------
916
917	(function($)
918	{
919		$.fn.avia_activate_lightbox = function(variables)
920		{
921			
922			var defaults = {
923				groups			:	['.avia-slideshow', '.avia-gallery', '.av-instagram-pics', '.portfolio-preview-image', '.portfolio-preview-content', '.isotope', '.post-entry', '.sidebar', '#main', '.main_menu'], 
924				autolinkElements:   'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
925				videoElements	: 	'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
926				exclude			:	'.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]',
927			},
928			
929			options = $.extend({}, defaults, variables),
930			
931			av_popup = {
932				type: 				'image',
933				mainClass: 			'avia-popup mfp-zoom-in',
934				tLoading: 			'',
935				tClose: 			'',
936				removalDelay: 		300, //delay removal by X to allow out-animation
937				closeBtnInside: 	true,
938				closeOnContentClick:false,
939				midClick: 			true,
940				fixedContentPos: 	false, // allows scrolling when lightbox is open but also removes any jumping because of scrollbar removal
941				
942				image: {
943				    titleSrc: function(item){
944					    var title = item.el.attr('title');
945					    if(!title) title = item.el.find('img').attr('title');
946					    if(!title) title = item.el.parent().next('.wp-caption-text').html();
947					    if(typeof title == "undefined") return "";
948					    return title;
949					}
950				},
951				
952				gallery: {
953					// delegate: 	options.autolinkElements,
954					tPrev:		'',
955					tNext:		'',
956					tCounter:	'%curr% / %total%',
957					enabled:	true,
958					preload:	[1,1] // Will preload 1 - before current, and 1 after the current image
959				},
960
961				callbacks: 
962				{
963					beforeOpen: function()
964					{
965						//add custom css class for different styling
966						if( this.st.el && this.st.el.data('fixed-content') )
967						{
968							this.fixedContentPos = true;
969						}
970					},
971					
972					
973					open: function()
974					{
975						//overwrite default prev + next function. Add timeout for css3 crossfade animation
976						$.magnificPopup.instance.next = function() {
977							var self = this;
978							self.wrap.removeClass('mfp-image-loaded');
979							setTimeout(function() { $.magnificPopup.proto.next.call(self); }, 120);
980						}
981						$.magnificPopup.instance.prev = function() {
982							var self = this;
983							self.wrap.removeClass('mfp-image-loaded');
984							setTimeout(function() { $.magnificPopup.proto.prev.call(self); }, 120);
985						}
986						
987						//add custom css class for different styling
988						if( this.st.el && this.st.el.data('av-extra-class') )
989						{
990							this.wrap.addClass( this.currItem.el.data('av-extra-class') );
991						}
992						
993						
994					},
995					imageLoadComplete: function() 
996					{	
997						var self = this;
998						setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16);
999					},
1000					change: function() {
1001					    
1002					    if( this.currItem.el )
1003					    {	
1004						    var current = this.currItem.el;
1005						    
1006						    this.content.find( '.av-extra-modal-content, .av-extra-modal-markup' ).remove();
1007						    
1008						    if( current.data('av-extra-content') )
1009						    {
1010							    var extra = current.data('av-extra-content');
1011							    this.content.append( "<div class='av-extra-modal-content'>" + extra + "</div>" );
1012						    }
1013						    
1014						    if( current.data('av-extra-markup') )
1015						    {
1016							    var markup = current.data('av-extra-markup');
1017							    this.wrap.append( "<div class='av-extra-modal-markup'>" + markup + "</div>"  );
1018						    }
1019					    }
1020					},
1021				}
1022			},
1023			
1024			active = !$('html').is('.av-custom-lightbox');
1025			
1026			if(!active) return this;
1027			
1028			return this.each(function()
1029			{
1030				var container	= $(this),
1031					videos		= $(options.videoElements, this).not(options.exclude).addClass('mfp-iframe'), /*necessary class for the correct lightbox markup*/
1032					ajaxed		= !container.is('body') && !container.is('.ajax_slide');
1033					
1034					for (var i = 0; i < options.groups.length; i++) 
1035					{
1036						container.find(options.groups[i]).each(function() 
1037						{ 
1038							var links = $(options.autolinkElements, this);
1039						
1040							if(ajaxed) links.removeClass('lightbox-added');
1041							links.not(options.exclude).addClass('lightbox-added').magnificPopup(av_popup);
1042						});
1043					}
1044				
1045			});
1046		}
1047	})(jQuery);
1048
1049
1050
1051// -------------------------------------------------------------------------------------------
1052// Avia Menu
1053// -------------------------------------------------------------------------------------------
1054
1055(function($)
1056{
1057	$.fn.aviaMegamenu = function(variables)
1058	{
1059		var defaults =
1060		{
1061			modify_position:true,
1062			delay:300
1063		};
1064
1065		var options = $.extend(defaults, variables),
1066		win			= $(window),
1067		width_select= $('html').is('.html_header_sidebar') ? "#main" : "#header",
1068		the_main	= $(width_select + ' .container:first'),
1069		css_block	= $("<style type='text/css' id='av-browser-width-mm'></style>").appendTo('head:first'),
1070		calc_dimensions = function()
1071		{	
1072			var css			= "",
1073				w_12 		= Math.round( the_main.width() );
1074				
1075			css += " #header .three.units{width:"	+ ( w_12 * 0.25)+	"px;}";
1076			css += " #header .six.units{width:"		+ ( w_12 * 0.50)+	"px;}";
1077			css += " #header .nine.units{width:"	+ ( w_12 * 0.75)+	"px;}";
1078			css += " #header .twelve.units{width:"	+( w_12 )		+	"px;}";
1079			
1080			//ie8 needs different insert method
1081			try{
1082				css_block.text(css); 
1083			}
1084			catch(err){
1085				css_block.remove();
1086				css_block = $("<style type='text/css' id='av-browser-width-mm'>"+css+"</style>").appendTo('head:first');
1087			}
1088			
1089		};
1090		
1091		if($('.avia_mega_div').length > 0)
1092		{
1093			win.on( 'debouncedresize', calc_dimensions);
1094			calc_dimensions();
1095		}	
1096
1097		return this.each(function()
1098		{
1099			var the_html	= $('html:first'),
1100				main		= $('#main .container:first'),
1101				left_menu	= the_html.filter('.html_menu_left, .html_logo_center').length,
1102				isMobile 	= $.avia_utilities.isMobile,
1103				menu = $(this),
1104				menuItems = menu.find(">li:not(.ignore_menu)"),
1105				megaItems = menuItems.find(">div").parent().css({overflow:'hidden'}),
1106				menuActive = menu.find('>.current-menu-item>a, >.current_page_item>a'),
1107				dropdownItems = menuItems.find(">ul").parent(),
1108				parentContainer = menu.parent(),
1109				mainMenuParent = menu.parents('.main_menu').eq(0),
1110				parentContainerWidth = parentContainer.width(),
1111				delayCheck = {},
1112				mega_open = [];
1113				
1114
1115			if(!menuActive.length){ menu.find('.current-menu-ancestor:eq(0) a:eq(0), .current_page_ancestor:eq(0) a:eq(0)').parent().addClass('active-parent-item')}
1116			if(!the_html.is('.html_header_top')) { options.modify_position = false; }
1117			
1118			
1119			menuItems.on('click' ,'a', function()
1120			{
1121				if(this.href == window.location.href + "#" || this.href == window.location.href + "/#")
1122				return false;
1123			});
1124
1125			menuItems.each(function()
1126			{
1127				var item = $(this),
1128					pos = item.position(),
1129					megaDiv = item.find("div:first").css({opacity:0, display:"none"}),
1130					normalDropdown = "";
1131
1132				//check if we got a mega menu
1133				if(!megaDiv.length)
1134				{
1135					normalDropdown = item.find(">ul").css({display:"none"});
1136				}
1137
1138				//if we got a mega menu or dropdown menu add the arrow beside the menu item
1139				if(megaDiv.length || normalDropdown.length)
1140				{
1141					var link = item.addClass('dropdown_ul_available').find('>a');
1142					link.append('<span class="dropdown_available"></span>');
1143
1144					//is a mega menu main item doesnt have a link to click use the default cursor
1145					if(typeof link.attr('href') != 'string' || link.attr('href') == "#"){ link.css('cursor','default').click(function(){return false;}); }
1146				}
1147
1148
1149				//correct position of mega menus
1150				if(options.modify_position && megaDiv.length)
1151				{	
1152					item.on('mouseenter', function(){ calc_offset(item, pos, megaDiv, parentContainerWidth) });
1153				}
1154
1155
1156
1157			});
1158			
1159			
1160			function calc_offset(item, pos, megaDiv, parentContainerWidth)
1161			{	
1162				pos = item.position();
1163				
1164				if(!left_menu)
1165					{
1166						if(pos.left + megaDiv.width() < parentContainerWidth)
1167						{
1168							megaDiv.css({right: -megaDiv.outerWidth() + item.outerWidth()  });
1169							//item.css({position:'static'});
1170						}
1171						else if(pos.left + megaDiv.width() > parentContainerWidth)
1172						{
1173							megaDiv.css({right: -mainMenuParent.outerWidth() + (pos.left + item.outerWidth() ) });
1174						}
1175					}
1176					else
1177					{
1178						if(megaDiv.width() > pos.left + item.outerWidth())
1179						{
1180							megaDiv.css({left: (pos.left* -1)});
1181						}
1182						else if(pos.left + megaDiv.width() > parentContainerWidth)
1183						{
1184							megaDiv.css({left: (megaDiv.width() - pos.left) * -1 });
1185						}
1186					}
1187			}
1188
1189			function megaDivShow(i)
1190			{
1191				if(delayCheck[i] == true)
1192				{
1193					var item = megaItems.filter(':eq('+i+')').css({overflow:'visible'}).find("div:first"),
1194						link = megaItems.filter(':eq('+i+')').find("a:first");
1195						mega_open["check"+i] = true;
1196
1197						item.stop().css('display','block').animate({opacity:1},300);
1198
1199						if(item.length)
1200						{
1201							link.addClass('open-mega-a');
1202						}
1203				}
1204			}
1205
1206			function megaDivHide (i)
1207			{
1208				if(delayCheck[i] == false)
1209				{
1210					megaItems.filter(':eq('+i+')').find(">a").removeClass('open-mega-a');
1211
1212					var listItem = megaItems.filter(':eq('+i+')'),
1213						item = listItem.find("div:first");
1214
1215
1216					item.stop().css('display','block').animate({opacity:0}
1216,300, function()
1217					{
1218						$(this).css('display','none');
1219						listItem.css({overflow:'hidden'});
1220						mega_open["check"+i] = false;
1221					});
1222				}
1223			}
1224
1225			if(isMobile)
1226			{
1227				megaItems.each(function(i){
1228
1229					$(this).bind('click', function()
1230					{
1231						if(mega_open["check"+i] != true) return false;
1232					});
1233				});
1234			}
1235
1236
1237			//bind event for mega menu
1238			megaItems.each(function(i){
1239
1240				$(this).hover(
1241
1242					function()
1243					{
1244						delayCheck[i] = true;
1245						setTimeout(function(){megaDivShow(i); },options.delay);
1246					},
1247
1248					function()
1249					{
1250						delayCheck[i] = false;
1251						setTimeout(function(){megaDivHide(i); },options.delay);
1252					}
1253				);
1254			});
1255
1256
1257			// bind events for dropdown menu
1258			dropdownItems.find('li').addBack().each(function()
1259			{
1260				var currentItem = $(this),
1261					sublist = currentItem.find('ul:first'),
1262					showList = false;
1263
1264				if(sublist.length)
1265				{
1266					sublist.css({display:'block', opacity:0, visibility:'hidden'});
1267					var currentLink = currentItem.find('>a');
1268
1269					currentLink.bind('mouseenter', function()
1270					{
1271						sublist.stop().css({visibility:'visible'}).animate({opacity:1});
1272					});
1273
1274					currentItem.bind('mouseleave', function()
1275					{
1276						sublist.stop().animate({opacity:0}
1276, function()
1277						{
1278							sublist.css({visibility:'hidden'});
1279						});
1280					});
1281
1282				}
1283
1284			});
1285
1286		});
1287	};
1288})(jQuery);
1289
1290
1291
1292
1293// -------------------------------------------------------------------------------------------
1294//Portfolio sorting
1295// -------------------------------------------------------------------------------------------
1296
1297    $.fn.avia_iso_sort = function(options)
1298	{
1299		return this.each(function()
1300		{
1301			var the_body		= $('body'),
1302				container		= $(this),
1303				portfolio_id	= container.data('portfolio-id'),
1304				parentContainer	= container.parents('.entry-content-wrapper, .avia-fullwidth-portfolio'),
1305				filter			= parentContainer.find('.sort_width_container[data-portfolio-id="' + portfolio_id + '"]').find('#js_sort_items').css({visibility:"visible", opacity:0}),
1306				links			= filter.find('a'),
1307				imgParent		= container.find('.grid-image'),
1308				isoActive		= false,
1309				items			= $('.post-entry', container);
1310
1311			function applyIso()
1312			{
1313				container.addClass('isotope_activated').isotope({
1314					layoutMode : 'fitRows', itemSelector : '.flex_column'
1315				});
1316				
1317				container.isotope( 'on', 'layoutComplete', function()
1318				{
1319					container.css({overflow:'visible'});
1320					the_body.trigger('av_resize_finished');
1321				}); 
1322				
1323				isoActive = true;
1324				setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
1325			};
1326
1327			links.bind('click',function()
1328			{
1329				var current		= $(this),
1330			  		selector	= current.data('filter'),
1331			  		linktext	= current.html(),
1332			  		activeCat	= parentContainer.find('.av-current-sort-title');
1333
1334			  		if(activeCat.length) activeCat.html(linktext);
1335			  		
1336					links.removeClass('active_sort');
1337					current.addClass('active_sort');
1338					container.attr('id', 'grid_id_'+selector);
1339
1340					parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
1341					//container.css({overflow:'hidden'})
1342					container.isotope({ layoutMode : 'fitRows', itemSelector : '.flex_column' , filter: '.'+selector});
1343
1344					return false;
1345			});
1346
1347			// update columnWidth on window resize
1348			$(window).on( 'debouncedresize', function()
1349			{
1350			  	applyIso();
1351			});
1352
1353			$.avia_utilities.preload({container: container, single_callback:  function()
1354				{
1355					filter.animate({opacity:1}, 400); applyIso();
1356
1357					//call a second time to for the initial resizing
1358					setTimeout(function(){ applyIso(); });
1359
1360					imgParent.css({height:'auto'}).each(function(i)
1361					{
1362						var currentLink = $(this);
1363
1364						setTimeout(function()
1365						{
1366							currentLink.animate({opacity:1},1500);
1367						}, (100 * i));
1368					});
1369				}
1370			});
1371
1372		});
1373	};
1374
1375	
1376	
1377	
1378	function avia_sticky_submenu()
1379	{
1380		var win 		= $(window),
1381			html 		= $('html:first'),
1382			header  	= $('.html_header_top.html_header_sticky #header'),
1383			html_margin = parseInt( $('html:first').css('margin-top'), 10),
1384			setWitdth	= $('.html_header_sidebar #main, .boxed #main'),
1385			menus		= $('.av-submenu-container'),
1386			bordermod	= html.is('.html_minimal_header') ? 0 : 1,
1387			fixed_frame	= $('.av-frame-top').height(),
1388			calc_margin	= function()
1389			{
1390				html_margin = parseInt( html.css('margin-top'), 10);
1391				if(!$('.mobile_menu_toggle:visible').length)
1392				{
1393					$('.av-open-submenu').removeClass('av-open-submenu');
1394				}
1395			},
1396			calc_values	= function()
1397			{
1398				var content_width = setWitdth.width();
1399				html_margin = parseInt( html.css('margin-top'), 10);
1400				menus.width(content_width);
1401				
1402			},
1403			check 		= function(placeholder, no_timeout)
1404			{
1405				var menu_pos	= this.offset().top,
1406					top_pos 	= placeholder.offset().top,
1407					scrolled	= win.scrollTop(),
1408					modifier 	= html_margin, fixed = false;
1409										
1410					if(header.length) 
1411					{
1412						modifier += header.outerHeight() + parseInt( header.css('margin-top'), 10);
1413					}	
1414					
1415					if(fixed_frame)
1416					{
1417						modifier += fixed_frame;
1418					}
1419					
1420					if(scrolled + modifier > top_pos)
1421					{
1422						if(!fixed)
1423						{
1424							this.css({top: modifier - bordermod, position: 'fixed'}); fixed = true
1425						}
1426					}
1427					else
1428					{
1429						this.css({top: 'auto', position: 'absolute'}); fixed = false
1430					}
1431					
1432			},
1433			toggle = function(e)
1434			{
1435				e.preventDefault();
1436				
1437				var clicked = $(this), 
1438					menu 	= clicked.siblings('.av-subnav-menu');
1439				
1440					if(menu.hasClass('av-open-submenu'))
1441					{
1442						menu.removeClass('av-open-submenu');
1443					}
1444					else
1445					{
1446						menu.addClass('av-open-submenu');
1447					}
1448			};
1449		
1450		win.on("debouncedresize av-height-change",  calc_margin ); calc_margin();
1451			
1452		if(setWitdth.length)
1453		{
1454			win.on("debouncedresize av-height-change",  calc_values );
1455			calc_values();
1456		}
1457		
1458		$(".av-sticky-submenu").each(function()
1459		{	
1460			 var menu  = $(this), placeholder = menu.next('.sticky_placeholder'), mobile_button = menu.find('.mobile_menu_toggle');
1461			 win.on( 'scroll',  function(){ window.requestAnimationFrame( $.proxy( check, menu, placeholder) )} );
1462			 
1463			 if(mobile_button.length)
1464			 {
1465			 	mobile_button.on( 'click',  toggle );
1466			 }
1467			 
1468			 
1469		});
1470		
1471		html.on('click', '.av-submenu-hidden .av-open-submenu li a', function()
1472		{
1473			var current = $(this);
1474			
1475			var list_item = current.siblings('ul, .avia_mega_div');
1476			if(list_item.length)
1477			{
1478				if(list_item.hasClass('av-visible-sublist'))
1479				{
1480				    list_item.removeClass('av-visible-sublist');
1481				}
1482				else
1483				{
1484				    list_item.addClass('av-visible-sublist');
1485				}
1486				return false;
1487			}
1488		});
1489		
1490		$('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function()
1491		{
1492			var current = $(this);
1493			var list_item = current.siblings('ul');
1494			if(list_item.length)
1495			{
1496				if(list_item.hasClass('av-visible-mobile-sublist'))
1497				{
1498				    
1499				}
1500				else
1501				{
1502					$('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist');
1503				    list_item.addClass('av-visible-mobile-sublist');
1504				    return false;
1505				}
1506				
1507			}
1508		});
1509		
1510		
1511		
1512	}
1513	
1514	
1515	
1516	function avia_sidebar_menu()
1517	{
1518		var win				= $(window),
1519			main			= $('#main'),
1520			sb_header		= $('.html_header_sidebar #header_main'),
1521            sidebar			= $('.html_header_sidebar #header.av_conditional_sticky');
1522            
1523        if(!sb_header.length) return;
1524        // main.css({"min-height":sb_header.outerHeight()});
1525		
1526	
1527            
1528        if(!sidebar.length) return;
1529        
1530        var innerSidebar	= $('#header_main'),
1531       	 	wrap			= $('#wrap_all'),
1532       	 	fixed_frame		= $('.av-frame-top').height() * 2,
1533       	 	subtract 		= parseInt($('html').css('margin-top'), 10),
1534            calc_values 	= function()
1535            {	
1536            	if(innerSidebar.outerHeight() + fixed_frame < win.height()) 
1537				{ 	
1538					sidebar.addClass('av_always_sticky'); 
1539				}
1540				else
1541				{
1542					sidebar.removeClass('av_always_sticky'); 
1543				}
1544				
1545				wrap.css({'min-height': win.height() - subtract});
1546            };
1547        
1548        calc_values(); 
1549        win.on("debouncedresize av-height-change",  calc_values);
1550	}
1551	
1552	function av_change_class($element, change_method, class_name)
1553	{	
1554		if($element[0].classList)
1555		{
1556			if(change_method == "add") 
1557			{
1558				$element[0].classList.add(class_name);
1559			}
1560			else
1561			{
1562				$element[0].classList.remove(class_name);
1563			}
1564		}
1565		else
1566		{
1567			if(change_method == "add") 
1568			{
1569				$element.addClass(class_name);
1570			}
1571			else
1572			{
1573				$element.removeClass(class_name);
1574			}
1575		}
1576	}
1577	
1578
1579
1580    //check if the browser supports element rotation
1581    function avia_header_size()
1582    {
1583        var win				= $(window),
1584            header          = $('.html_header_top.html_header_sticky #header'),
1585            unsticktop		= $('.av_header_unstick_top');
1586            
1587        if(!header.length && !unsticktop.length) return;
1588        
1589        var logo            = $('#header_main .container .logo img, #header_main .container .logo a'),
1590            elements        = $('#header_main .container:not(#header_main_alternate>.container), #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a, #header_main_alternate a), #header_main #menu-item-shop .cart_dropdown_link'),
1591            el_height       = $(elements).filter(':first').height(),
1592            isMobile        = $.avia_utilities.isMobile,
1593            scroll_top		= $('#scroll-top-link'),
1594            transparent 	= header.is('.av_header_transparency'),
1595            shrinking		= header.is('.av_header_shrinking'),
1596            topbar_height	= header.find('#header_meta').outerHeight(),
1597            set_height      = function()
1598            {	
1599                var st = win.scrollTop(), newH = 0, st_real = st;
1600				
1601				if(unsticktop) st -= topbar_height; 
1602				if(st < 0) st = 0;
1603				
1604				if(shrinking && !isMobile)
1605                {
1606	                if(st < el_height/2)
1607	                {
1608	                    newH = el_height - st;
1609	                    if(st <= 0){
1610							newH = el_height;
1611					    }
1612	                    
1613	                    av_change_class(header, 'remove', 'header-scrolled');
1614	                    //header.removeClass('header-scrolled');
1615	                }
1616	                else
1617	                {
1618	                    newH = el_height/2;
1619	                    //header.addClass('header-scrolled');
1620	                    av_change_class(header, 'add', 'header-scrolled');
1621	                }
1622	                
1623	                if(st - 30 < el_height)
1624	                {
1625	                    av_change_class(header, 'remove', 'header-scrolled-full');
1626	                }
1627	                else
1628	                {
1629	                    av_change_class(header, 'add', 'header-scrolled-full');
1630	                }
1631	                
1632	                
1633	                elements.css({'height': newH + 'px', 'lineHeight': newH + 'px'});
1634                	logo.css({'maxHeight': newH + 'px'});
1635                }
1636                
1637                if(unsticktop.length)
1638            	{
1639                	if( st <= 0)
1640                	{
1641	                	if(st_real <= 0) st_real = 0;
1642                		unsticktop.css({"margin-top":"-"+st_real+"px"});
1643					}
1644					else
1645					{
1646                		unsticktop.css({"margin-top":"-"+topbar_height+"px"});
1647					}
1648            	}
1649                
1650                if(transparent)
1651                {	
1652                	if(st > 50)
1653                	{	
1654                		//header.removeClass('av_header_transparency');
1655                		av_change_class(header, 'remove', 'av_header_transparency');
1656                	}
1657                	else
1658                	{
1659                		//header.addClass('av_header_transparency');
1660                		av_change_class(header, 'add', 'av_header_transparency');
1661                	}
1662                }
1663
1664               
1665            }
1666
1667            if($('body').is('.avia_deactivate_menu_resize')) shrinking = false;
1668            
1669            if(!transparent && !shrinking && !unsticktop.length) return;
1670            
1671			win.on( 'debouncedresize',  function(){ el_height = $(elements).attr('style',"").filter(':first').height(); set_height(); } );
1672            win.on( 'scroll',  function(){ window.requestAnimationFrame( set_height )} );
1673            set_height();
1674    }
1675
1676
1677   function avia_scroll_top_fade()
1678   {
1679   		 var win 		= $(window),
1680   		 	 timeo = false,
1681   		 	 scroll_top = $('#scroll-top-link'),
1682   		 	 set_status = function()
1683             {
1684             	var st = win.scrollTop();
1685
1686             	if(st < 500)
1687             	{
1688             		scroll_top.removeClass('avia_pop_class');
1689             	}
1690             	else if(!scroll_top.is('.avia_pop_class'))
1691             	{
1692             		scroll_top.addClass('avia_pop_class');
1693             	}
1694             };
1695
1696   		 win.on( 'scroll',  function(){ window.requestAnimationFrame( set_status )} );
1697         set_status();
1698	}
1699	
1700	function avia_hamburger_menu()
1701	{
1702		var menu		= $('#avia-menu'),
1703			burger_wrap = $('.av-burger-menu-main a'),
1704			burger 		= burger_wrap.find('.av-hamburger'),
1705			htmlEL  	= $('.html_burger_menu'),
1706			overlay		= $('<div class="av-burger-overlay"></div>'),
1707			inner_overlay = $('<div class="av-burger-overlay-inner"></div>').appendTo(overlay),
1708			bgColor 	  = $('<div class="av-burger-overlay-bg"></div>').appendTo(overlay),
1709			animating 	  = false,
1710			first_level	  = {};
1711			
1712		burger_wrap.click(function(e)
1713		{
1714			if(animating) return;
1715			
1716			animating = true;
1717			
1718			if(!burger.is(".av-inserted-main-menu"))
1719			{
1720				var new_menu = menu.clone();
1721				new_menu.find('.menu-item-avia-special').remove();
1722				new_menu.find('ul').attr('style','');
1723				new_menu.attr({id:'av-burger-menu-ul', class:''}).appendTo(inner_overlay);
1724				
1725				new_menu.find('li').hover(function () {
1726			        $(this).children("ul.sub-menu").slideDown('fast');
1727			    }, function () {
1728			        $(this).children("ul.sub-menu").slideUp('fast');
1729			    });
1730				
1731				
1732				burger.addClass("av-inserted-main-menu");
1733				overlay.appendTo('.avia-menu');
1734				
1735				if($.fn.avia_smoothscroll)
1736				$('a[href*="#"]', overlay).avia_smoothscroll(overlay);
1737				$('a[href*="#"]', overlay).click(function(){ burger_wrap.trigger('click'); })
1738				
1739				first_level = overlay.find('#av-burger-menu-ul > li');
1740				console.log(first_level);
1741			}
1742			
1743			if(burger.is(".is-active"))
1744			{
1745				burger.removeClass("is-active");
1746				overlay.avia_animate({opacity:0}
1746, function()
1747	    		{
1748	    			overlay.css({display:'none'});
1749					htmlEL.removeClass("av-burger-overlay-active");
1750					animating = false;
1751	    		});
1752			}
1753			else
1754			{
1755				first_level.removeClass('av-active-burger-items');
1756				
1757				burger.addClass("is-active");
1758				htmlEL.addClass("av-burger-overlay-active");
1759				overlay.css({display:'block'}).avia_animate({opacity:1}, function()
1760				{ 
1761					animating = false; 
1762				});
1763				
1764				first_level.each(function(i)
1765				{
1766					var _self = $(this);
1767					setTimeout(function()
1768					{
1769						_self.addClass('av-active-burger-items');	
1770					}, (i + 1) * 125)
1771				});
1772				
1773				
1774				
1775			}
1776			
1777			e.preventDefault();
1778		});
1779	}
1780
1781
1782
1783
1784	$.AviaAjaxSearch  =  function(options)
1785	{
1786	   var defaults = {
1787            delay: 300,                //delay in ms until the user stops typing.
1788            minChars: 3,               //dont start searching before we got at least that much characters
1789            scope: 'body'
1790
1791        }
1792
1793        this.options = $.extend({}, defaults, options);
1794        this.scope   = $(this.options.scope);
1795        this.timer   = false;
1796        this.lastVal = "";
1797		
1798        this.bind_events();
1799	}
1800
1801
1802	$.AviaAjaxSearch.prototype =
1803    {
1804        bind_events: function()
1805        {
1806            this.scope.on('keyup', '#s:not(".av_disable_ajax_search #s")' , $.proxy( this.try_search, this));
1807        },
1808
1809        try_search: function(e)
1810        {
1811            clearTimeout(this.timer);
1812
1813            //only execute search if chars are at least "minChars" and search differs from last one
1814            if(e.currentTarget.value.length >= this.options.minChars && this.lastVal != $.trim(e.currentTarget.value))
1815            {
1816                //wait at least "delay" miliseconds to execute ajax. if user types again during that time dont execute
1817                this.timer = setTimeout($.proxy( this.do_search, this, e), this.options.delay);
1818            }
1819        },
1820
1821        do_search: function(e)
1822        {
1823            var obj          = this,
1824                currentField = $(e.currentTarget).attr( "autocomplete", "off" ),
1825                form         = currentField.parents('form:eq(0)'),
1826                results      = form.find('.ajax_search_response'),
1827                loading      = $('<div class="ajax_load"><span class="ajax_load_inner"></span></div>'),
1828                action 		 = form.attr('action'),
1829                values       = form.serialize();
1830                values      += '&action=avia_ajax_search';
1831
1832           	//check if the form got get parameters applied and also apply them
1833           	if(action.indexOf('?') != -1)
1834           	{
1835           		action  = action.split('?');
1836           		values += "&" + action[1];
1837           	}
1838
1839            if(!results.length) results = $('<div class="ajax_search_response"></div>').appendTo(form);
1840
1841            //return if we already hit a no result and user is still typing
1842            if(results.find('.ajax_not_found').length && e.currentTarget.value.indexOf(this.lastVal) != -1) return;
1843
1844            this.lastVal = e.currentTarget.value;
1845
1846            $.ajax({
1847				url: avia_framework_globals.ajaxurl,
1848				type: "POST",
1849				data:values,
1850				beforeSend: function()
1851				{
1852					loading.insertAfter(currentField);
1853				},
1854				success: function(response)
1855				{
1856				    if(response == 0) response = "";
1857                    results.html(response);
1858				},
1859				complete: function()
1860				{
1861				    loading.remove();
1862				}
1863			});
1864        }
1865    }
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876	$.AviaTooltip  =  function(options)
1877	{
1878	   var defaults = {
1879            delay: 1500,                //delay in ms until the tooltip appears
1880            delayOut: 300,             	//delay in ms when instant showing should stop
1881            delayHide: 0,             	//delay hiding of tooltip in ms
1882            "class": "avia-tooltip",   	//tooltip classname for css styling and alignment
1883            scope: "body",             	//area the tooltip should be applied to
1884            data:  "avia-tooltip",     	//data attribute that contains the tooltip text
1885            attach:"body",          	//either attach the tooltip to the "mouse" or to the "element" // todo: implement mouse, make sure that it doesnt overlap with screen borders
1886            event: 'mouseenter',       	//mousenter and leave or click and leave
1887            position:'top',             //top or bottom
1888            extraClass:'avia-tooltip-class', //extra class that is defined by a tooltip element data attribute
1889            permanent: false 			// always display the tooltip?
1890            
1891        }
1892		
1893        this.options = $.extend({}, defaults, options);
1894        this.body    = $('body');
1895        this.scope   = $(this.options.scope);
1896        this.tooltip = $('<div class="'+this.options['class']+' avia-tt"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></div>');
1897        this.inner   = $('<div class="inner_tooltip"></div>').prependTo(this.tooltip);
1898        this.open    = false;
1899        this.timer   = false;
1900        this.active  = false;
1901		
1902        this.bind_events();
1903	}
1904
1905	$.AviaTooltip.openTTs = [];
1906    $.AviaTooltip.prototype =
1907    {
1908        bind_events: function()
1909        {
1910	        var perma_tooltips		= '.av-permanent-tooltip [data-'+this.options.data+']',
1911	        	default_tooltips	= '[data-'+this.options.data+']:not( .av-permanent-tooltip [data-'+this.options.data+'])';
1912	        
1913	        this.scope.on('av_permanent_show', perma_tooltips, $.proxy( this.display_tooltip, this) );
1914	        $(perma_tooltips).addClass('av-perma-tooltip').trigger('av_permanent_show');
1915	        
1916	        
1917	        
1918			this.scope.on(this.options.event + ' mouseleave', default_tooltips, $.proxy( this.start_countdown, this) );
1919	        
1920            if(this.options.event != 'click')
1921            {
1922                this.scope.on('mouseleave', default_tooltips, $.proxy( this.hide_tooltip, this) );
1923            }
1924            else
1925            {
1926                this.body.on('mousedown', $.proxy( this.hide_tooltip, this) );
1927            }	
1928				       
1929        },
1930
1931        start_countdown: function(e)
1932        {
1933            clearTimeout(this.timer);
1934
1935            if(e.type == this.options.event)
1936            {
1937                var delay = this.options.event == 'click' ? 0 : this.open ? 0 : this.options.delay;
1938
1939                this.timer = setTimeout($.proxy( this.display_tooltip, this, e), delay);
1940            }
1941            else if(e.type == 'mouseleave')
1942            {
1943                this.timer = setTimeout($.proxy( this.stop_instant_open, this, e), this.options.delayOut);
1944            }
1945            e.preventDefault();
1946        },
1947
1948        reset_countdown: function(e)
1949        {
1950            clearTimeout(this.timer);
1951            this.timer = false;
1952        },
1953
1954        display_tooltip: function(e)
1955        {
1956            var target 		= this.options.event == "click" ? e.target : e.currentTarget,
1957            	element 	= $(target),
1958                text    	= element.data(this.options.data),
1959                newTip  	= element.data('avia-created-tooltip'),
1960            	extraClass 	= element.data('avia-tooltip-class'),
1961                attach  	= this.options.attach == 'element' ? element : this.body,
1962                offset  	= this.options.attach == 'element' ? element.position() : element.offset(),
1963                position	= element.data('avia-tooltip-position'),
1964                align		= element.data('avia-tooltip-alignment'),
1965                force_append= false;
1966           
1967            text = $.trim(text);
1968            
1969            if(element.is('.av-perma-tooltip'))
1970            {
1971	            offset = {top:0, left:0 };
1972	        	attach = element;
1973				force_append = true;
1974            }
1975            
1976			if(text == "") return;
1977			if(position == "" || typeof position == 'undefined') position = this.options.position;
1978			if(align == "" || typeof align == 'undefined') align = 'center';
1979			
1980			if(typeof newTip != 'undefined')
1981			{
1982				newTip = $.AviaTooltip.openTTs[newTip];
1983			}
1984			else
1985			{
1986				this.inner.html(text); 
1987				newTip = this.tooltip.clone();
1988				
1989				if(this.options.attach == 'element' && force_append !== true)
1990				{
1991					newTip.insertAfter(attach);
1992				}
1993				else
1994				{
1995					newTip.appendTo(attach);
1996				}
1997                
1998                if(extraClass != "") newTip.addClass(extraClass);
1999			}
2000			
2001            this.open = true;
2002            this.active = newTip;
2003
2004            if((newTip.is(':animated:visible') && e.type == 'click') || element.is('.'+this.options['class']) || element.parents('.'+this.options['class']).length != 0) return;
2005
2006
2007            var animate1 = {}, animate2	= {}, pos1 = "", pos2 = "";
2008			
2009			if(position == "top" || position == "bottom")
2010			{
2011				switch(align)
2012				{
2013					case "left": pos2 = offset.left; break;
2014					case "right": pos2 = offset.left + element.outerWidth() - newTip.outerWidth();  break;
2015					default: pos2 = (offset.left + (element.outerWidth() / 2)) - (newTip.outerWidth() / 2); break;
2016				}	
2017			}
2018			else
2019			{
2020				switch(align)
2021				{
2022					case "top": pos1 = offset.top; break;
2023					case "bottom": pos1 = offset.top + element.outerHeight() - newTip.outerHeight();  break;
2024					default: pos1 = (offset.top + (element.outerHeight() / 2)) - (newTip.outerHeight() / 2); break;
2025				}	
2026			}
2027	
2028			switch(position)
2029			{
2030				case "top": 
2031				pos1 = offset.top - newTip.outerHeight();
2032                animate1 = {top: pos1 - 10, left: pos2};
2033                animate2 = {top: pos1};
2034				break;
2035				case "bottom": 	
2036				pos1 = offset.top + element.outerHeight();
2037				animate1 = {top: pos1 + 10, left: pos2};
2038				animate2 = {top: pos1};
2039				break;
2040				case "left": 
2041				pos2 = offset.left  - newTip.outerWidth();
2042				animate1 = {top: pos1, left: pos2 -10};
2043            	animate2 = {left: pos2};	
2044				break;
2045				case "right": 	
2046				pos2 = offset.left + element.outerWidth();
2047				animate1 = {top: pos1, left: pos2 + 10};
2048            	animate2 = {left: pos2};	
2049				break;
2050			}
2051			
2052			animate1['display'] = "block";
2053			animate1['opacity'] = 0;
2054			animate2['opacity'] = 1;
2055			
2056
2057            newTip.css(animate1).stop().animate(animate2,200);
2058            newTip.find('input, textarea').focus();
2059            $.AviaTooltip.openTTs.push(newTip);
2060            element.data('avia-created-tooltip', $.AviaTooltip.openTTs.length - 1);
2061
2062        },
2063
2064        hide_tooltip: function(e)
2065        {
2066            var element 	= $(e.currentTarget) , newTip, animateTo, 
2067            	position	= element.data('avia-tooltip-position'),
2068                align		= element.data('avia-tooltip-alignment');
2069                
2070            if(position == "" || typeof position == 'undefined') position = this.options.position;
2071			if(align == "" || typeof align == 'undefined') align = 'center';
2072
2073            if(this.options.event == 'click')
2074            {
2075                element = $(e.target);
2076
2077                if(!element.is('.'+this.options['class']) && element.parents('.'+this.options['class']).length == 0)
2078                {
2079                    if(this.active.length) { newTip = this.active; this.active = false;}
2080                }
2081            }
2082            else
2083            {
2084                newTip = element.data('avia-created-tooltip');
2085                newTip = typeof newTip != 'undefined' ? $.AviaTooltip.openTTs[newTip] : false;
2086            }
2087
2088            if(newTip)
2089            {
2090            	var animate = {opacity:0};
2091            	
2092            	switch(position)
2093            	{
2094            		case "top": 	
2095						animate['top'] = parseInt(newTip.css('top'),10) - 10;	
2096					break;
2097					case "bottom": 	
2098						animate['top'] = parseInt(newTip.css('top'),10) + 10;	
2099					break;
2100					case "left": 	
2101						animate['left'] = parseInt(newTip.css('left'), 10) - 10;
2102					break;
2103					case "right": 	
2104						animate['left'] = parseInt(newTip.css('left'), 10) + 10;
2105					break;
2106            	}
2107            	
2108                newTip.animate(animate, 200, function()
2109                {
2110                    newTip.css({display:'none'});
2111                });
2112            }
2113        },
2114
2115        stop_instant_open: function(e)
2116        {
2117            this.open = false;
2118        }
2119    }
2120
2121
2122})( jQuery );
2123
2124
2125
2126
2127
2128
2129/*!
2130 * Isotope PACKAGED v2.0.0
2131 * Filter & sort magical layouts
2132 * http://isotope.metafizzy.co
2133 */
2134
2135(function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i
2135),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function o(t){function o(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var o=r(t);if("none"===o.display)return i();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var h=n.isBorderBox=!(!p||!o[p]||"border-box"!==o[p]),f=0,c=s.length;c>f;f++){var d=s[f],l=o[d];l=a(t,l);var y=parseFloat(l);n[d]=isNaN(y)?0:y}var m=n.paddingLeft+n.paddingRight,g=n.paddingTop+n.paddingBottom,v=n.marginLeft+n.marginRight,_=n.marginTop+n.marginBottom,I=n.borderLeftWidth+n.borderRightWidth,L=n.borderTopWidth+n.borderBottomWidth,z=h&&u,S=e(o.width);S!==!1&&(n.width=S+(z?0:m+I));var b=e(o.height);return b!==!1&&(n.height=b+(z?0:g+L)),n.innerWidth=n.width-(m+I),n.innerHeight=n.height-(g+L),n.outerWidth=n.width+v,n.outerHeight=n.height+_,n}}function a(t,e){if(n||-1===e.indexOf("%"))return e;var i=t.style,o=i.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=o,s&&(r.left=s),e}var u,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var o=r(t);u=200===e(o.width),i.removeChild(t)}}(),o}var n=t.getComputedStyle,r=n?function(t){return n(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("get-style-property")):t.getSize=o(t.getStyleProperty)}(window),function(t,e){function i(t,e){return t[a](e)}function o(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){o(t);for(var i=t.parentNode.querySelectorAll(e),n=0,r=i.length;r>n;n++)if(i[n]===t)return!0;return!1}function r(t,e){return o(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,o=t.length;o>i;i++){var n=t[i],r=n+"MatchesSelector";if(e[r])return r}}();if(a){var u=document.createElement("div"),p=i(u,"div");s=p?i:r}else s=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],d=["transform","transition","transitionDuration","transitionProperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var o=d[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=l[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};
2135e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];
2135if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=d(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,d,l,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=d(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):c(o)&&(i=o),this[t]=i?d(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.
2135concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=d(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=d(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,c=i[s],d=c.getAttribute(n);try{f=d&&JSON.parse(d)}catch(l){u&&u.error("Error parsing "+n+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var y=new o(c,f);p&&p.data(c,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}return e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;
2135return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0},e.prototype._getItemLayoutPosition=function(t){t.getSize(),0!==this.x&&t.size.outerWidth+this.x>this.isotope.size.innerWidth&&(this.x=0,this.y=this.maxY);var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=t.size.outerWidth,e},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];
2135if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var c=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=u,c.LayoutMode=h,c.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},c.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},c.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e},c.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},c.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},c.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},c.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},c.prototype._init=c.prototype.arrange,c.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},c.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},c.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},c.prototype.updateSortData=function(t){this._getSorters(),t=o(t);var e=this.getItems(t);e=e.length?e:this.items,this._updateItemsSortData(e)
2136},c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window);
2137
2138
2139/*!
vendor: 4,310 bytes, lines 2140-2145
2140Waypoints - 3.1.1
2141Copyright © 2011-2015 Caleb Troughton
2142Licensed under the MIT license.
2143https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
2144*/
2145!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}}
2145,e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var n in t){var r=t[n];for(var s in this.waypoints[n]){var a,l,h,p,u,c=this.waypoints[n][s],d=c.options.offset,f=c.triggerPoint,w=0,y=null==f;c.element!==c.element.window&&(w=c.adapter.offset()[r.offsetProp]),"function"==typeof d?d=d.apply(c):"string"==typeof d&&(d=parseFloat(d),c.options.offset.indexOf("%")>-1&&(d=Math.ceil(r.contextDimension*d/100))),a=r.contextScroll-r.contextOffset,c.triggerPoint=w+a-d,l=f<r.oldScroll,h=c.triggerPoint>=r.oldScroll,p=l&&h,u=!l&&!h,!y&&p?(c.queueTrigger(r.backward),o[c.group.id]=c.group):!y&&u?(c.queueTrigger(r.forward),o[c.group.id]=c.group):y&&r.oldScroll>=c.triggerPoint&&(c.queueTrigger(r.forward),o[c.group.id]=c.group)}}for(var g in o)o[g].flushTriggers();return this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
2146
2147
2148/*
2149 * jQuery Browser Plugin 0.0.6
2150 * https://github.com/gabceb/jquery-browser-plugin
2151 *
2152 * Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
2153 * http://jquery.org/license
2154 *
2155 * Modifications Copyright 2014 Gabriel Cebrian
2156 * https://github.com/gabceb
2157 *
2158 * Released under the MIT license
2159 */
2160 !function(a,b){"use strict";var c,d;if(a.uaMatch=function(a){a=a.toLowerCase();var b=/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(iphone)/.exec(a)||/(android)/.exec(a)||/(windows phone)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/i.exec(a)||[];return{browser:b[3]||b[1]||"",version:b[2]||"0",platform:c[0]||""}},c=a.uaMatch(b.navigator.userAgent),d={},c.browser&&(d[c.browser]=!0,d.version=c.version,d.versionNumber=parseInt(c.version)),c.platform&&(d[c.platform]=!0),(d.android||d.ipad||d.iphone||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv){var e="msie";c.browser=e,d[e]=!0}if(d.opr){var f="opera";c.browser=f,d[f]=!0}if(d.safari&&d.android){var g="android";c.browser=g,d[g]=!0}d.name=c.browser,d.platform=c.platform,a.browser=d}(jQuery,window);
2161 
2162/*Vimeo Frogaloop API for videos*/
2163var Froogaloop=function(){function e(a){return new e.fn.init(a)}function g(a,c,b){if(!b.contentWindow.postMessage)return!1;a=JSON.stringify({method:a,value:c});
2163b.contentWindow.postMessage(a,h)}function l(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(e){}"ready"!=b||k||(k=!0);if(!/^https?:\/\/player.vimeo.com/.test(a.origin))return!1;"*"===h&&(h=a.origin);a=c.value;var m=c.data,f=""===f?null:c.player_id;c=f?d[f][b]:d[b];b=[];if(!c)return!1;void 0!==a&&b.push(a);m&&b.push(m);f&&b.push(f);
2164return 0<b.length?c.apply(null,b):c.call()}function n(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},k=!1,h="*";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;return this},api:function(a,c){if(!this.element||!a)return!1;var b=this.element,d=""!==b.id?b.id:null,e=c&&c.constructor&&c.call&&c.apply?null:c,f=c&&c.constructor&&c.call&&c.apply?c:null;f&&n(a,f,d);g(a,e,b);return this},addEvent:function(a,c){if(!this.element)return!1;
2165var b=this.element,d=""!==b.id?b.id:null;n(a,c,d);"ready"!=a?g("addEventListener",a,b):"ready"==a&&k&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b=""!==c.id?c.id:null;a:{if(b&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&g("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",l,!1):window.attachEvent("onmessage",l);return window.Froogaloop=
2166window.$f=e}();
2167
2168
2169// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
2170// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel. can be removed if IE9 is no longer supported or all parallax scripts are gone MIT license
2171(function(){var lastTime=0;var vendors=['ms','moz','webkit','o'];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame']}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(id){clearTimeout(id)}}());
2172
2173jQuery.expr[':'].regex = function(elem, index, match) {
2174    var matchParams = match[3].split(','),
2175        validLabels = /^(data|css):/,
2176        attr = {
2177            method: matchParams[0].match(validLabels) ? 
2178                        matchParams[0].split(':')[0] : 'attr',
2179            property: matchParams.shift().replace(validLabels,'')
2180        },
2181        regexFlags = 'ig',
2182        regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
2183    return regex.test(jQuery(elem)[attr.method](attr.property));
2184}
2185
2186
2187
2188
2189

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.