PageSourceSearch

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

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

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.