PageSourceSearch

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

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

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.