(function($) {"use strict";$(document).ready(function() {$.avia_utilities=$.avia_utilities||{};if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&'ontouchstart'in document.documentElement) {$.avia_utilities.isMobile=true;} else {$.avia_utilities.isMobile=false;} if($.fn.avia_mobile_fixed) $('.avia-bg-style-fixed').avia_mobile_fixed();if($.fn.avia_parallax) $('.av-parallax').avia_parallax();if($.fn.avia_browser_height) $('.av-minimum-height, .avia-fullscreen-slider, .av-cell-min-height').avia_browser_height();if($.fn.avia_video_section) $('.av-section-with-video-bg').avia_video_section();new $.AviaTooltip({'class':"avia-tooltip",data:"avia-tooltip",delay:0,scope:"body"});new $.AviaTooltip({'class':"avia-tooltip avia-icon-tooltip",data:"avia-icon-tooltip",delay:0,scope:"body"});activate_shortcode_scripts();$('.avia-layerslider').layer_slider_height_helper();$('.grid-links-ajax').avia_portfolio_preview();if($.fn.avia_masonry) $('.av-masonry').avia_masonry();if($.fn.aviaccordion) $('.aviaccordion').aviaccordion();if($.fn.avia_textrotator) $('.av-rotator-container').avia_textrotator();if($.fn.avia_sc_tab_section) {$('.av-tab-section-container').avia_sc_tab_section();} if($.fn.avia_hor_gallery) {$('.av-horizontal-gallery').avia_hor_gallery();} if($.fn.avia_delayed_animation_in_container) {$('.av-animation-delay-container').avia_delayed_animation_in_container();}});function activate_waypoints(container) {if($.fn.avia_waypoints) {if(typeof container=='undefined'){container='body';};$('.avia_animate_when_visible',container).avia_waypoints();$('.avia_animate_when_almost_visible',container).avia_waypoints({offset:'80%'});if(container=='body')container='.avia_desktop body';$('.av-animated-generic',container).avia_waypoints({offset:'95%'});}} function activate_shortcode_scripts(container) {if(typeof container=='undefined'){container='body';} if($.fn.avia_ajax_form) {$('.avia_ajax_form:not( .avia-disable-default-ajax )',container).avia_ajax_form();} activate_waypoints(container);if($.fn.aviaVideoApi) {$('.avia-slideshow iframe[src*="youtube.com"], .av_youtube_frame, .avia-slideshow iframe[src*="vimeo.com"], .avia-slideshow video').aviaVideoApi({},'li');} if($.fn.avia_sc_toggle) {$('.togglecontainer',container).avia_sc_toggle();} if($.fn.avia_sc_tabs) {$('.top_tab',container).avia_sc_tabs();$('.sidebar_tab',container).avia_sc_tabs({sidebar:true});} if($.fn.avia_sc_gallery) {$('.avia-gallery',container).avia_sc_gallery();} if($.fn.avia_sc_animated_number) {$('.avia-animated-number',container).avia_sc_animated_number();} if($.fn.avia_sc_animation_delayed) {$('.av_font_icon',container).avia_sc_animation_delayed({delay:100});$('.avia-image-container',container).avia_sc_animation_delayed({delay:100});$('.av-hotspot-image-container',container).avia_sc_animation_delayed({delay:100});$('.av-animated-generic',container).avia_sc_animation_delayed({delay:100});} if($.fn.avia_sc_iconlist) {$('.avia-icon-list.av-iconlist-big',container).avia_sc_iconlist();} if($.fn.avia_sc_progressbar) {$('.avia-progress-bar-container',container).avia_sc_progressbar();} if($.fn.avia_sc_testimonial) {$('.avia-testimonial-wrapper',container).avia_sc_testimonial();} $('.avia-slideshow.av_fullscreen',container).aviaFullscreenSlider();$('.avia-slideshow:not(.av_fullscreen)',container).aviaSlider();$('.avia-content-slider-active',container).aviaSlider({wrapElement:'.avia-content-slider-inner',slideElement:'.slide-entry-wrap',fullfade:true});$('.avia-slider-testimonials',container).aviaSlider({wrapElement:'.avia-testimonial-row',slideElement:'.avia-testimonial',fullfade:true});if($.fn.aviaMaps) {$('.avia-google-map-container',container).aviaMaps();} if($.fn.aviaMagazine) {$('.av-magazine-tabs-active',container).aviaMagazine();} if($.fn.aviaHotspots) {$('.av-hotspot-image-container',container).aviaHotspots();} if($.fn.aviaCountdown) {$('.av-countdown-timer',container).aviaCountdown();}} (function($) {"use strict";var _units=['weeks','days','hours','minutes','seconds'],_second=1000,_minute=_second*60,_hour=_minute*60,_day=_hour*24,_week=_day*7,ticker=function(_self) {var _time={},_now=new Date(),_timestamp=_self.end-_now;if(_timestamp<=0) {clearInterval(_self.countdown);return;} _self.time.weeks=Math.floor(_timestamp/_week);_self.time.days=Math.floor((_timestamp%_week)/_day);_self.time.hours=Math.floor((_timestamp%_day)/_hour);_self.time.minutes=Math.floor((_timestamp%_hour)/_minute);_self.time.seconds=Math.floor((_timestamp%_minute)/_second);switch(_self.data.maximum) {case 1:_self.time.seconds=Math.floor(_timestamp/_second);break;case 2:_self.time.minutes=Math.floor(_timestamp/_minute);break;case 3:_self.time.hours=Math.floor(_timestamp/_hour);break;case 4:_self.time.days=Math.floor(_timestamp/_day);break;} for(var i in _self.time) {if(typeof _self.update[i]=="object") {if(_self.firstrun||_self.oldtime[i]!=_self.time[i]) {var labelkey=(_self.time[i]===1)?"single":"multi";_self.update[i].time_container.text(_self.time[i]);_self.update[i].label_container.text(_self.update[i][labelkey]);}}} if(_self.firstrun)_self.container.addClass('av-countdown-active') _self.oldtime=$.extend({},_self.time);_self.firstrun=false;};$.fn.aviaCountdown=function(options) {if(!this.length)return;return this.each(function() {var _self={};_self.update={};_self.time={};_self.oldtime={};_self.firstrun=true;_self.container=$(this);_self.data=_self.container.data();_self.end=new Date(_self.data.year,_self.data.month,_self.data.day,_self.data.hour,_self.data.minute);for(var i in _units) {_self.update[_units[i]]={time_container:_self.container.find('.av-countdown-'+_units[i]+' .av-countdown-time'),label_container:_self.container.find('.av-countdown-'+_units[i]+' .av-countdown-time-label'),};if(_self.update[_units[i]].label_container.length) {_self.update[_units[i]].single=_self.update[_units[i]].label_container.data('label');_self.update[_units[i]].multi=_self.update[_units[i]].label_container.data('label-multi');}} ticker(_self);_self.countdown=setInterval(function(){ticker(_self);},1000);});}}(jQuery));(function($) {"use strict";$.fn.aviaHotspots=function(options) {if(!this.length)return;return this.each(function() {var _self={};_self.container=$(this);_self.hotspots=_self.container.find('.av-image-hotspot');_self.container.on('avia_start_animation',function() {setTimeout(function() {_self.hotspots.each(function(i) {var current=$(this);setTimeout(function(){current.addClass('av-display-hotspot');},300*i);});},400);});});}}(jQuery));(function($) {"use strict";var animating=false,methods={switchMag:function(clicked,_self) {var current=$(clicked) if(current.is('.active_sort')||animating)return;var filter=current.data('filter'),oldContainer=_self.container.filter(':visible'),newContainer=_self.container.filter('.'+filter);animating=true;_self.sort_buttons.removeClass('active_sort');current.addClass('active_sort');_self.magazine.height(_self.magazine.outerHeight());oldContainer.avia_animate({opacity:0},200,function() {oldContainer.css({display:'none'});newContainer.css({opacity:0,display:'block'}).avia_animate({opacity:1},150,function() {_self.magazine.avia_animate({height:(newContainer.outerHeight()+_self.sort_bar.outerHeight())},150,function() {_self.magazine.height('auto');animating=false;});});});}};$.fn.aviaMagazine=function(options) {if(!this.length)return;return this.each(function() {var _self={};_self.magazine=$(this),_self.sort_buttons=_self.magazine.find('.av-magazine-sort a');_self.container=_self.magazine.find('.av-magazine-group');_self.sort_bar=_self.magazine.find('.av-magazine-top-bar');_self.sort_buttons.on('click',function(e){e.preventDefault();methods.switchMag(this,_self);});});}}(jQuery));(function($) {"use strict";$.AviaMapsAPI=function(options,container) {if(typeof window.av_google_map=='undefined') {$.avia_utilities.log('Map creation stopped, var av_google_map not found');return} this.container=container;this.$container=$(container);this.$body=$('body');this.$mapid=this.$container.data('mapid')-1;this.$data=window.av_google_map[this.$mapid];this.retina=window.devicePixelRatio>1;this._init(options);} $.AviaMapsAPI.apiFiles={loading:false,finished:false,src:'https://maps.googleapis.com/maps/api/js?v=3.27&callback=aviaOnGoogleMapsLoaded'} $.AviaMapsAPI.prototype={_init:function() {this._bind_execution();this._getAPI();},_getAPI:function() {if((typeof window.google=='undefined'||typeof window.google.maps=='undefined')&&$.AviaMapsAPI.apiFiles.loading==false) {$.AviaMapsAPI.apiFiles.loading=true;var script=document.createElement('script');script.type='text/javascript';script.src=$.AviaMapsAPI.apiFiles.src;if(avia_framework_globals.gmap_api!='undefined'&&avia_framework_globals.gmap_api!="") {script.src+="&key="+avia_framework_globals.gmap_api;} document.body.appendChild(script);} else if((typeof window.google!='undefined'&&typeof window.google.maps!='undefined')||$.AviaMapsAPI.apiFiles.loading==false) {this._applyMap();}},_bind_execution:function() {this.$body.on('av-google-maps-api-loaded',$.proxy(this._applyMap,this));},_applyMap:function() {if(typeof this.map!='undefined')return;if(!this.$data.marker||!this.$data.marker[0]||!this.$data.marker[0].long||!this.$data.marker[0].long) {$.avia_utilities.log('Latitude or Longitude missing','map-error');return;} var _self=this,mobile_drag=$.avia_utilities.isMobile?this.$data.mobile_drag_control:true,zoomValue=this.$data.zoom=="auto"?10:this.$data.zoom;this.mapVars={mapMaker:false,mapTypeControl:false,backgroundColor:'transparent',streetViewControl:false,panControl:this.$data.pan_control,zoomControl:this.$data.zoom_control,gestureHandling:'cooperative',scrollwheel:false,zoom:zoomValue,mapTypeId:google.maps.MapTypeId.ROADMAP,center:new google.maps.LatLng(this.$data.marker[0].lat,this.$data.marker[0].long),styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]};this.map=new google.maps.Map(this.container,this.mapVars);this._applyMapStyle();if(this.$data.zoom=="auto") {this._setAutoZoom();} google.maps.event.addListenerOnce(this.map,'tilesloaded',function(){_self._addMarkers();});},_setAutoZoom:function() {var bounds=new google.maps.LatLngBounds();for(var key in this.$data.marker) {bounds.extend(new google.maps.LatLng(this.$data.marker[key].lat,this.$data.marker[key].long));} this.map.fitBounds(bounds);},_applyMapStyle:function() {var stylers=[],style=[],mapType,style_color="";if(this.$data.hue!="")stylers.push({hue:this.$data.hue});if(this.$data.saturation!="")stylers.push({saturation:this.$data.saturation});if(stylers.length) {style=[{featureType:"all",elementType:"all",stylers:stylers},{featureType:"poi",stylers:[{visibility:"off"}]}];if(this.$data.saturation=="fill") {style_color=this.$data.hue|| "#242424";var c=style_color.substring(1);var rgb=parseInt(c,16);var r=(rgb>>16)&0xff;var g=(rgb>>8)&0xff;var b=(rgb>>0)&0xff;var luma=0.2126*r+0.7152*g+0.0722*b;var lightness=1;var street_light=2;if(luma>60){lightness=-1;street_light=3;} if(luma>220){lightness=-2;street_light=-2;} style=[{"featureType":"all","elementType":"all","stylers":[{"color":style_color},{"lightness":0}]},{"featureType":"all","elementType":"labels.text.fill","stylers":[{"color":style_color},{"lightness":(25*street_light)}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":style_color},{"lightness":3}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":style_color},{"lightness":30}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":style_color},{"lightness":30},{"weight":1.2}]},{"featureType":"landscape","elementType":"geometry","stylers":[{visibility:'simplified'},{"color":style_color},{"lightness":3}]},{"featureType":"poi","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":style_color},{"lightness":-3}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":style_color},{"lightness":2},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":style_color},{"lightness":-3}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":style_color},{"lightness":-3}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":style_color},{"lightness":-3}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":style_color},{"lightness":-20}]}];} mapType=new google.maps.StyledMapType(style,{name:"av_map_style"});this.map.mapTypes.set('av_styled_map',mapType);this.map.setMapTypeId('av_styled_map');}},_addMarkers:function() {for(var key in this.$data.marker) {var _self=this;(function(key,_self) {setTimeout(function() {var marker="";if(!_self.$data.marker[key]||!_self.$data.marker[key].long||!_self.$data.marker[key].long) {$.avia_utilities.log('Latitude or Longitude for single marker missing','map-error');return;} _self.$data.LatLng=new google.maps.LatLng(_self.$data.marker[key].lat,_self.$data.marker[key].long);var markerArgs={flat:false,position:_self.$data.LatLng,animation:google.maps.Animation.BOUNCE,map:_self.map,title:_self.$data.marker[key].address,optimized:false};if(_self.$data.marker[key].icon&&_self.$data.marker[key].imagesize) {var size=_self.$data.marker[key].imagesize,half="",full="";if(_self.retina&&size>40)size=40;half=new google.maps.Point(size/2,size);full=new google.maps.Size(size,size);markerArgs.icon=new google.maps.MarkerImage(_self.$data.marker[key].icon,null,null,half,full);} marker=new google.maps.Marker(markerArgs);setTimeout(function(){marker.setAnimation(null);_self._infoWindow(_self.map,marker,_self.$data.marker[key]);},500);},200*(parseInt(key,10)+1));}(key,_self));}},_infoWindow:function(map,marker,data) {var info=$.trim(data.content);if(info!="") {var infowindow=new google.maps.InfoWindow({content:info});google.maps.event.addListener(marker,'click',function(){infowindow.open(map,marker);});if(data.tooltip_display)infowindow.open(map,marker);}}} $.fn.aviaMaps=function(options) {return this.each(function() {var self=$.data(this,'aviaMapsApi');if(!self) {self=$.data(this,'aviaMapsApi',new $.AviaMapsAPI(options,this));}});}})(jQuery);window.aviaOnGoogleMapsLoaded=function(){$('body').trigger('av-google-maps-api-loaded');$.AviaMapsAPI.apiFiles.finished=true;};(function($) {"use strict";$.AviaVideoAPI=function(options,video,option_container) {this.$video=$(video);this.$option_container=option_container?$(option_container):this.$video;this.isMobile=$.avia_utilities.isMobile;this.fallback=this.isMobile?this.$option_container.is('.av-mobile-fallback-image'):false;if(this.fallback)return;this._init(options);} $.AviaVideoAPI.defaults={loop:false,mute:false,controls:false,events:'play pause mute unmute loop toggle reset unload'};$.AviaVideoAPI.apiFiles={youtube:{loaded:false,src:'https://www.youtube.com/iframe_api'}} $.AviaVideoAPI.prototype={_init:function(options) {this.options=this._setOptions(options);this.type=this._getPlayerType();this._setPlayer();this.eventsBound=false;this.playing=false;this.$option_container.addClass('av-video-paused');this.pp=$.avia_utilities.playpause(this.$option_container);},_setOptions:function(options) {var newOptions=$.extend(true,{},$.AviaVideoAPI.defaults,options),htmlData=this.$option_container.data(),i="";for(i in htmlData) {if(htmlData.hasOwnProperty(i)&&(typeof htmlData[i]==="string"||typeof htmlData[i]==="number"||typeof htmlData[i]==="boolean")) {newOptions[i]=htmlData[i];}} return newOptions;},_getPlayerType:function() {var vid_src=this.$video.get(0).src||this.$video.data('src');if(this.$video.is('video'))return'html5';if(this.$video.is('.av_youtube_frame'))return'youtube';if(vid_src.indexOf('vimeo.com')!=-1)return'vimeo';if(vid_src.indexOf('youtube.com')!=-1)return'youtube';},_setPlayer:function() {var _self=this;switch(this.type) {case"html5":this.player=this.$video.data('mediaelementplayer');this._playerReady();break;case"vimeo":this.player=Froogaloop(this.$video.get(0));this._playerReady();break;case"youtube":this._getAPI(this.type);$('body').on('av-youtube-iframe-api-loaded',function(){_self._playerReady();});break;}},_getAPI:function(api) {if($.AviaVideoAPI.apiFiles[api].loaded===false) {$.AviaVideoAPI.apiFiles[api].loaded=true;var tag=document.createElement('script'),first=document.getElementsByTagName('script')[0];tag.src=$.AviaVideoAPI.apiFiles[api].src;first.parentNode.insertBefore(tag,first);}},_playerReady:function() {var _self=this;this.$option_container.on('av-video-loaded',function(){_self._bindEvents();});switch(this.type) {case"html5":this.$video.on('av-mediajs-loaded',function(){_self.$option_container.trigger('av-video-loaded');});this.$video.on('av-mediajs-ended',function(){_self.$option_container.trigger('av-video-ended');});break;case"vimeo":_self.player.addEvent('ready',function(){_self.$option_container.trigger('av-video-loaded');_self.player.addEvent('finish',function(){_self.$option_container.trigger('av-video-ended');});});break;case"youtube":var params=_self.$video.data();if(_self._supports_video())params.html5=1;_self.player=new YT.Player(_self.$video.attr('id'),{videoId:params.videoid,height:_self.$video.attr('height'),width:_self.$video.attr('width'),playerVars:params,events:{'onReady':function(){_self.$option_container.trigger('av-video-loaded');},'onError':function(player){$.avia_utilities.log('YOUTUBE ERROR:','error',player);},'onStateChange':function(event){if(event.data===YT.PlayerState.ENDED) {var command=_self.options.loop!=false?'loop':'av-video-ended';_self.$option_container.trigger(command);}}}});break;} setTimeout(function() {if(_self.eventsBound==true||typeof _self.eventsBound=='undefined'||_self.type=='youtube'){return;} $.avia_utilities.log('Fallback Video Trigger "'+_self.type+'":','log',_self);_self.$option_container.trigger('av-video-loaded');},2000);},_bindEvents:function() {if(this.eventsBound==true||typeof this.eventsBound=='undefined') {return;} var _self=this,volume='unmute';this.eventsBound=true;this.$option_container.on(this.options.events,function(e) {_self.api(e.type);});if(!_self.isMobile) {if(this.options.mute!=false){volume="mute";} if(this.options.loop!=false){_self.api('loop');} _self.api(volume);} setTimeout(function() {_self.$option_container.trigger('av-video-events-bound').addClass('av-video-events-bound');},50);},_supports_video:function(){return!!document.createElement('video').canPlayType;},api:function(action) {if(this.isMobile&&!this.was_started())return;if(this.options.events.indexOf(action)===-1)return;this.$option_container.trigger('av-video-'+action+'-executed');if(typeof this['_'+this.type+'_'+action]=='function') {this['_'+this.type+'_'+action].call(this);} if(typeof this['_'+action]=='function') {this['_'+action].call(this);}},was_started:function() {if(!this.player)return false;switch(this.type) {case"html5":if(this.player.getCurrentTime()>0)return true;break;case"vimeo":if(this.player.api('getCurrentTime')>0)return true;break;case"youtube":if(this.player.getPlayerState()!==-1)return true;break;} return false;},_play:function() {this.playing=true;this.$option_container.addClass('av-video-playing').removeClass('av-video-paused');},_pause:function() {this.playing=false;this.$option_container.removeClass('av-video-playing').addClass('av-video-paused');},_loop:function() {this.options.loop=true;},_toggle:function() {var command=this.playing==true?'pause':'play';this.api(command);this.pp.set(command);},_vimeo_play:function() {this.player.api('play');},_vimeo_pause:function() {this.player.api('pause');},_vimeo_mute:function() {this.player.api('setVolume',0);},_vimeo_unmute:function() {this.player.api('setVolume',0.7);},_vimeo_loop:function() {},_vimeo_reset:function() {this.player.api('seekTo',0);},_vimeo_unload:function() {this.player.api('unload');},_youtube_play:function() {this.player.playVideo();},_youtube_pause:function() {this.player.pauseVideo()},_youtube_mute:function() {this.player.mute();},_youtube_unmute:function() {this.player.unMute();},_youtube_loop:function() {if(this.playing==true)this.player.seekTo(0);},_youtube_reset:function() {this.player.stopVideo();},_youtube_unload:function() {this.player.clearVideo();},_html5_play:function() {this.player.options.pauseOtherPlayers=false;this.player.play();},_html5_pause:function() {this.player.pause();},_html5_mute:function() {this.player.setMuted(true);},_html5_unmute:function() {this.player.setVolume(0.7);},_html5_loop:function() {this.player.options.loop=true;},_html5_reset:function() {this.player.setCurrentTime(0);},_html5_unload:function() {this._html5_pause();this._html5_reset();}} $.fn.aviaVideoApi=function(options,apply_to_parent) {return this.each(function() {var applyTo=this;if(apply_to_parent) {applyTo=$(this).parents(apply_to_parent).get(0);} var self=$.data(applyTo,'aviaVideoApi');if(!self) {self=$.data(applyTo,'aviaVideoApi',new $.AviaVideoAPI(options,this,applyTo));}});}})(jQuery);window.onYouTubeIframeAPIReady=function(){$('body').trigger('av-youtube-iframe-api-loaded');};$.fn.avia_masonry=function(options) {if(!this.length)return this;var the_body=$('body'),the_win=$(window),isMobile=$.avia_utilities.isMobile,loading=false,methods={masonry_filter:function() {var current=$(this),linktext=current.html(),selector=current.data('filter'),masonry=current.parents('.av-masonry:eq(0)'),container=masonry.find('.av-masonry-container:eq(0)'),links=masonry.find('.av-masonry-sort a'),activeCat=masonry.find('.av-current-sort-title');links.removeClass('active_sort');current.addClass('active_sort');container.attr('id','masonry_id_'+selector);if(activeCat.length)activeCat.html(linktext);methods.applyMasonry(container,selector,function() {container.css({overflow:'visible'});});return false;},applyMasonry:function(container,selector,callback) {var filters=selector?{filter:'.'+selector}:{};filters['layoutMode']='packery';filters['packery']={gutter:0};filters['percentPosition']=true;filters['itemSelector']="a.isotope-item";container.isotope(filters,function() {the_win.trigger('av-height-change');});if(typeof callback=='function') {setTimeout(callback,0);}},show_bricks:function(bricks,callback) {bricks.each(function(i) {var currentLink=$(this),browserPrefix=$.avia_utilities.supports('transition'),multiplier=isMobile?0:100;setTimeout(function() {if(browserPrefix===false) {currentLink.css({visibility:"visible",opacity:0}).animate({opacity:1},1500);} else {currentLink.addClass('av-masonry-item-loaded');} if(i==bricks.length-1&&typeof callback=='function') {callback.call();the_win.trigger('av-height-change');}},(multiplier*i));});},loadMore:function(e) {e.preventDefault();if(loading)return false;loading=true;var current=$(this),data=current.data(),masonry=current.parents('.av-masonry:eq(0)'),container=masonry.find('.av-masonry-container'),items=masonry.find('.av-masonry-entry'),loader=$.avia_utilities.loading(),finished=function(){loading=false;loader.hide();the_body.trigger('av_resize_finished');};if(!data.offset){data.offset=0;} data.offset+=data.items;data.action='avia_ajax_masonry_more';data.loaded=[];items.each(function(){var item_id=$(this).data('av-masonry-item');if(item_id)data.loaded.push(item_id);});$.ajax({url:avia_framework_globals.ajaxurl,type:"POST",data:data,beforeSend:function() {loader.show();},success:function(response) {if(response.indexOf("{av-masonry-loaded}")!==-1) {var response=response.split('{av-masonry-loaded}'),new_items=$(response.pop()).filter('.isotope-item');if(new_items.length>data.items) {new_items=new_items.not(':last');} else {current.addClass('av-masonry-no-more-items');} var load_container=$('
').append(new_items);$.avia_utilities.preload({container:load_container,single_callback:function() {var links=masonry.find('.av-masonry-sort a'),filter_container=masonry.find('.av-sort-by-term'),allowed_filters=filter_container.data("av-allowed-sort");filter_container.hide();loader.hide();container.isotope('insert',new_items);$.avia_utilities.avia_ajax_call(masonry);setTimeout(function(){methods.show_bricks(new_items,finished);},150);setTimeout(function(){the_win.trigger('av-height-change');},550);if(links) {$(links).each(function(filterlinkindex) {var filterlink=$(this),sort=filterlink.data('filter');if(new_items) {$(new_items).each(function(itemindex){var item=$(this);if(item.hasClass(sort)&&allowed_filters.indexOf(sort)!==-1) {var term_count=filterlink.find('.avia-term-count').text();filterlink.find('.avia-term-count').text(' '+(parseInt(term_count)+1)+' ');if(filterlink.hasClass('avia_hide_sort')) {filterlink.removeClass('avia_hide_sort').addClass('avia_show_sort');masonry.find('.av-masonry-sort .'+sort+'_sep').removeClass('avia_hide_sort').addClass('avia_show_sort');masonry.find('.av-masonry-sort .av-sort-by-term').removeClass('hidden');}}});}});} filter_container.fadeIn();}});} else {finished();}},error:finished,complete:function() {}});}};return this.each(function() {var masonry=$(this),container=masonry.find('.av-masonry-container'),bricks=masonry.find('.isotope-item'),filter=masonry.find('.av-masonry-sort').css({visibility:"visible",opacity:0}).on('click','a',methods.masonry_filter),load_more=masonry.find('.av-masonry-load-more').css({visibility:"visible",opacity:0});$.avia_utilities.preload({container:container,single_callback:function() {var start_animation=function() {filter.animate({opacity:1},400);if(container.outerHeight()+container.offset().top+$('#footer').outerHeight()>$(window).height()) {$('html').css({'overflow-y':'scroll'});} methods.applyMasonry(container,false,function() {masonry.addClass('avia_sortable_active');container.removeClass('av-js-disabled ');});methods.show_bricks(bricks,function() {load_more.css({opacity:1}).on('click',methods.loadMore);});};if(isMobile) {start_animation();} else {masonry.waypoint(start_animation,{offset:'80%'});} $(window).on('debouncedresize',function() {methods.applyMasonry(container,false,function() {masonry.addClass('avia_sortable_active');});});}});});};(function($) {"use strict";$.avia_utilities=$.avia_utilities||{};$.fn.avia_portfolio_preview=function(passed_options) {var win=$(window),the_body=$('body'),isMobile=$.avia_utilities.isMobile,defaults={open_in:'.portfolio-details-inner',easing:'easeOutQuint',timing:800,transition:'slide'},options=$.extend({},defaults,passed_options);return this.each(function() {var container=$(this),portfolio_id=container.data('portfolio-id'),target_wrap=$('.portfolio_preview_container[data-portfolio-id="'+portfolio_id+'"]'),target_container=target_wrap.find(options.open_in),items=container.find('.grid-entry'),content_retrieved={},is_open=false,animating=false,index_open=false,ajax_call=false,methods,controls,loader=$.avia_utilities.loading();methods={load_item:function(e) {e.preventDefault();var link=$(this),post_container=link.parents('.post-entry:eq(0)'),post_id="ID_"+post_container.data('ajax-id'),clickedIndex=items.index(post_container);if(post_id===is_open||animating==true) {return false;} animating=true;container.find('.active_portfolio_item').removeClass('active_portfolio_item');post_container.addClass('active_portfolio_item');loader.show();methods.ajax_get_contents(post_id,clickedIndex);},scroll_top:function() {setTimeout(function() {var target_offset=target_wrap.offset().top-175,window_offset=win.scrollTop();if(window_offset>target_offset||target_offset-window_offset>100) {$('html:not(:animated),body:not(:animated)').animate({scrollTop:target_offset},options.timing,options.easing);}},10);},attach_item:function(post_id) {content_retrieved[post_id]=$(content_retrieved[post_id]).appendTo(target_container);ajax_call=true;},remove_video:function() {var del=target_wrap.find('iframe, .avia-video').parents('.ajax_slide:not(.open_slide)');if(del.length>0) {del.remove();content_retrieved["ID_"+del.data('slideId')]=undefined;}},show_item:function(post_id,clickedIndex) {if(post_id===is_open) {return false;} animating=true;loader.hide();if(false===is_open) {target_wrap.addClass('open_container');content_retrieved[post_id].addClass('open_slide');methods.scroll_top();target_wrap.css({display:'none'}).slideDown(options.timing,options.easing,function() {if(ajax_call) {activate_shortcode_scripts(content_retrieved[post_id]);$.avia_utilities.avia_ajax_call(content_retrieved[post_id]);the_body.trigger('av_resize_finished');ajax_call=false;} methods.remove_video();the_body.trigger('av_resize_finished');});index_open=clickedIndex;is_open=post_id;animating=false;} else {methods.scroll_top();var initCSS={zIndex:3},easing=options.easing;if(index_open>clickedIndex){initCSS.left='-110%';} if(options.transition==='fade'){initCSS.left='0%';initCSS.opacity=0;easing='easeOutQuad';} target_container.height(target_container.height());content_retrieved[post_id].css(initCSS).avia_animate({'left':"0%",opacity:1},options.timing,easing);content_retrieved[is_open].avia_animate({opacity:0},options.timing,easing,function() {content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');content_retrieved[post_id].addClass('open_slide');target_container.avia_animate({height:content_retrieved[post_id].outerHeight()+2},options.timing/2,options.easing,function() {target_container.attr({'style':""});is_open=post_id;index_open=clickedIndex;animating=false;methods.remove_video();if(ajax_call) {the_body.trigger('av_resize_finished');activate_shortcode_scripts(content_retrieved[post_id]);$.avia_utilities.avia_ajax_call(content_retrieved[post_id]);ajax_call=false;}});});}},ajax_get_contents:function(post_id,clickedIndex) {if(content_retrieved[post_id]!==undefined) {methods.show_item(post_id,clickedIndex);return;} content_retrieved[post_id]=$('#avia-tmpl-portfolio-preview-'+post_id.replace(/ID_/,"")).html();content_retrieved[post_id]=content_retrieved[post_id].replace('/*','');methods.attach_item(post_id);$.avia_utilities.preload({container:content_retrieved[post_id],single_callback:function(){methods.show_item(post_id,clickedIndex);}});},add_controls:function() {controls=target_wrap.find('.ajax_controlls');target_wrap.avia_keyboard_controls({27:'.avia_close',37:'.ajax_previous',39:'.ajax_next'});items.each(function(){var current=$(this),overlay;current.addClass('no_combo').bind('click',function(event) {overlay=current.find('.slideshow_overlay');if(overlay.length) {event.stopPropagation();methods.load_item.apply(current.find('a:eq(0)'));return false;}});});},control_click:function() {var showItem,activeID=container.find('.active_portfolio_item').data('ajax-id'),active=container.find('.post-entry-'+activeID);switch(this.hash) {case'#next':showItem=active.nextAll('.post-entry:visible:eq(0)').find('a:eq(0)');if(!showItem.length){showItem=$('.post-entry:visible:eq(0)',container).find('a:eq(0)');} showItem.trigger('click');break;case'#prev':showItem=active.prevAll('.post-entry:visible:eq(0)').find('a:eq(0)');if(!showItem.length){showItem=$('.post-entry:visible:last',container).find('a:eq(0)');} showItem.trigger('click');break;case'#close':animating=true;target_wrap.slideUp(options.timing,options.easing,function() {container.find('.active_portfolio_item').removeClass('active_portfolio_item');content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');target_wrap.removeClass('open_container');animating=is_open=index_open=false;methods.remove_video();the_body.trigger('av_resize_finished');});break;} return false;},resize_reset:function() {if(is_open===false) {target_container.html('');content_retrieved=[];}}};methods.add_controls();container.on("click","a",methods.load_item);controls.on("click","a",methods.control_click);if(jQuery.support.leadingWhitespace){win.bind('debouncedresize',methods.resize_reset);}});};}(jQuery));$.AviaFullscreenSlider=function(options,slider) {this.$slider=$(slider);this.$inner=this.$slider.find('.avia-slideshow-inner');this.$innerLi=this.$inner.find('>li');this.$caption=this.$inner.find('.avia-slide-wrap .caption_container');this.$win=$(window);this.isMobile=$.avia_utilities.isMobile;this.property={};this.scrollPos="0";this.transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1?true:false;this.ticking=false;if($.avia_utilities.supported.transition===undefined) {$.avia_utilities.supported.transition=$.avia_utilities.supports('transition');} this._init(options);} $.AviaFullscreenSlider.defaults={height:100,subtract:'#wpadminbar, #header, #main>.title_container'};$.AviaFullscreenSlider.prototype={_init:function(options) {var _self=this;this.options=$.extend(true,{},$.AviaFullscreenSlider.defaults,options);if(this.$slider.data('slide_height'))this.options.height=this.$slider.data('slide_height');this.options.parallax_enabled=this.$slider.data('image_attachment')==""?true:false;this.$subtract=$(this.options.subtract);this._setSize();this.$win.on('debouncedresize',$.proxy(this._setSize,this));setTimeout(function() {if(!_self.isMobile&&_self.options.parallax_enabled) {_self.$win.on('scroll',$.proxy(_self._on_scroll,_self));}},100);this.$slider.aviaSlider({bg_slider:true});},_on_scroll:function(e) {var _self=this;if(!_self.ticking){_self.ticking=true;window.requestAnimationFrame($.proxy(_self._parallax_scroll,_self));}},_fetch_properties:function(slide_height) {this.property.offset=this.$slider.offset().top;this.property.wh=this.$win.height();this.property.height=slide_height||this.$slider.outerHeight();this._parallax_scroll();},_setSize:function() {if(!$.fn.avia_browser_height) {var viewport=this.$win.height(),slide_height=Math.ceil((viewport/100)*this.options.height);if(this.$subtract.length&&this.options.height==100) {this.$subtract.each(function() {slide_height-=this.offsetHeight-0.5;});} else {slide_height-=1;} this.$slider.height(slide_height).removeClass('av-default-height-applied');this.$inner.css('padding',0);} this._fetch_properties(slide_height);},_parallax_scroll:function(e) {if(this.isMobile||!this.options.parallax_enabled)return;var winTop=this.$win.scrollTop(),winBottom=winTop+this.property.wh,scrollPos="0",prop={},prop2={};if(this.property.offset