jQuery(document).ready(function($){ cart_improvement_functions(); cart_dropdown_improvement(); track_ajax_add_to_cart(); if(jQuery.fn.avia_sc_slider){ jQuery(".shop_slider_yes ul").avia_sc_slider({appendControlls:false, group:true, slide:'.product', arrowControll: true, autorotationInterval:'parent'}); } jQuery('body.single-product').on('click', '.single-product-main-image .avia-wc-30-product-gallery-lightbox', function(e){ e.preventDefault(); var clicked=$(this), container=clicked.parents('.single-product-main-image'); var img=container.find('.flex-active-slide a.lightbox-added').eq(0); if(img.length==0){ img=container.find('a.lightbox-added').eq(0); } img.trigger('click'); }); product_add_to_cart_click(); function avia_apply_quant_btn(){ jQuery(".quantity input[type=number]").each(function(){ var number=$(this), max=parseFloat(number.attr('max')), min=parseFloat(number.attr('min')), step=parseInt(number.attr('step'), 10), newNum=jQuery(jQuery('
').append(number.clone(true)).html().replace('number','text')).insertAfter(number); number.remove(); setTimeout(function(){ if(newNum.next('.plus').length===0){ var minus=jQuery('').insertBefore(newNum), plus=jQuery('').insertAfter(newNum); minus.on('click', function(){ var the_val=parseInt(newNum.val(), 10) - step; the_val=the_val < 0 ? 0:the_val; the_val=the_val < min ? min:the_val; newNum.val(the_val).trigger("change"); }); plus.on('click', function(){ var the_val=parseInt(newNum.val(), 10) + step; the_val=the_val > max ? max:the_val; newNum.val(the_val).trigger("change"); }); }},10); }); } avia_apply_quant_btn(); $(document).on('updated_cart_totals', avia_apply_quant_btn); setTimeout(first_load_amount, 10); $('body').on('added_to_cart', update_cart_dropdown); $('body').on('wc_fragments_refreshed', avia_cart_dropdown_changed); jQuery('.avia_mobile .sort-param').on('touchstart', function(){}); }); function avia_cart_dropdown_changed(){ var the_html=jQuery('html'), cart=jQuery('body').is('.woocommerce-cart'), cart_counter=jQuery('.cart_dropdown .av-cart-counter'), menu_cart=jQuery('.cart_dropdown'), counter=0; if(! cart){ return; } menu_cart.find('.cart_list li .quantity').each(function(){ counter +=parseInt(jQuery(this).text(),10); }); if(counter===0){ cart_counter.removeClass('av-active-counter').text(counter); setTimeout(function(){ the_html.removeClass('html_visible_cart'); }, 200); } else if((cart_counter.length > 0)&&(counter > 0)){ setTimeout(function(){ cart_counter.addClass('av-active-counter').text(counter); the_html.addClass('html_visible_cart'); }, 10); } return; } function update_cart_dropdown(event){ var the_html=jQuery('html'), menu_cart=jQuery('.cart_dropdown'), cart_counter=jQuery('.cart_dropdown .av-cart-counter'), empty=menu_cart.find('.empty'), msg_success=menu_cart.data('success'), product=jQuery.extend({name:"Product", price:"", image:""}, avia_clicked_product), counter=0; if((empty.length > 0)&&('undefined'!==typeof event)){ the_html.addClass('html_visible_cart'); } if(typeof event!=='undefined'){ var header=jQuery('.html_header_sticky #header_main .cart_dropdown_first, .html_header_sidebar #header_main .cart_dropdown_first'), oldTemplates=jQuery('.added_to_cart_notification').trigger('avia_hide'), template=jQuery("Please set a mobile device fallback image for this video in your wordpress backend
').appendTo(appendTo); } if(options&&options.bg_slider){ current.data('img-url', fallback); if(fallback_link!=""){ if(appendTo.is('a')){ appendTo.attr('href', fallback_link); }else{ appendTo.find('a').remove(); appendTo.replaceWith(function(){ var cur_slide=$(this); return $("").attr({'data-rel': cur_slide.data('rel'), 'class': cur_slide.attr('class'), 'href': fallback_link}).append($(this).contents()); }); appendTo=current.find('.avia-slide-wrap'); } if($.fn.avia_activate_lightbox){ current.parents('#main').avia_activate_lightbox(); }} }else{ var image=''; var lightbox=false; if('string'==typeof fallback_link&&fallback_link.trim()!=''){ if(appendTo.is('a')){ appendTo.attr('href', fallback_link); }else{ var rel=fallback_link.match(/\.(jpg|jpeg|gif|png)$/i)!=null ? ' rel="lightbox" ':''; image='' + image + ''; } lightbox=true; } current.find('.avia-slide-wrap').append(image); if(lightbox&&$.fn.avia_activate_lightbox){ current.parents('#main').avia_activate_lightbox(); }} }); }}, _bgPreloadImages:function(callback){ this._getImageURLS(); this._preloadSingle(0, function(){ this._kickOff(); this._preloadNext(1); }); }, _getImageURLS: function(){ var _self=this; this.$slides.each(function(i){ _self.imageUrls[i]=[]; _self.imageUrls[i]['url']=$(this).data("img-url"); if(typeof _self.imageUrls[i]['url']=='string'){ _self.imageUrls[i]['status']=false; }else{ _self.imageUrls[i]['status']=true; }}); }, _preloadSingle: function(key, callback){ var _self=this, objImage=new Image(); if(typeof _self.imageUrls[key]['url']=='string'){ $(objImage).bind('load error', function(){ _self.imageUrls[key]['status']=true; _self.$slides.eq(key).css('background-image','url(' + _self.imageUrls[key]['url'] + ')'); if(typeof callback=='function') callback.apply(_self, [objImage, key]); }); if(_self.imageUrls[key]['url']!=""){ objImage.src=_self.imageUrls[key]['url']; }else{ $(objImage).trigger('error'); }}else{ if(typeof callback=='function') callback.apply(_self, [objImage, key]); }}, _preloadNext: function(key){ if(typeof this.imageUrls[key]!="undefined"){ this._preloadSingle(key, function(){ this._preloadNext(key + 1); }); }}, _bindEvents: function(){ var self=this, win=$(window); this.$slider.on('click','.next-slide', $.proxy(this.next, this)); this.$slider.on('click','.prev-slide', $.proxy(this.previous, this)); this.$slider.on('click','.goto-slide', $.proxy(this.go2, this)); if(this.options.hoverpause){ this.$slider.on('mouseenter', $.proxy(this.pause, this)); this.$slider.on('mouseleave', $.proxy(this.resume, this)); } if(this.options.stopinfiniteloop&&this.options.autoplay){ if(this.options.stopinfiniteloop=='last'){ this.$slider.on('avia_slider_last_slide', $.proxy(this._stopSlideshow, this)); } else if(this.options.stopinfiniteloop=='first'){ this.$slider.on('avia_slider_first_slide', $.proxy(this._stopSlideshow, this)); }} if(this.options.carousel==='yes'){ win.on('debouncedresize', $.proxy(this._buildCarousel, this)); }else{ win.on('debouncedresize.aviaSlider', $.proxy(this._setSize, this)); } if(!this.isMobile){ this.$slider.avia_keyboard_controls(); }else{ this.$slider.avia_swipe_trigger(); } self._attach_video_events(); }, _kickOff: function(){ var self=this, first_slide=self.$slides.eq(0), video=first_slide.data('video-ratio'); self._bindEvents(); this.$slider.removeClass('av-default-height-applied'); if(video){ self._setSize(true); }else{ if(this.options.keep_pading!=true){ self.$sliderUl.css('padding',0); self.$win.trigger('av-height-change'); }} self._setCenter(); if(this.options.carousel==='no'){ first_slide.css({visibility:'visible', opacity:0}).avia_animate({opacity:1}, function(){ var current=$(this).addClass('active-slide'); if(self.permaCaption.length){ self.permaCaption.addClass('active-slide'); }}); } if(self.options.autoplay){ self._startSlideshow(); } if(self.options.carousel==='yes'){ self._buildCarousel(); } self.$slider.trigger('_kickOff'); }, _buildCarousel:function(){ var self=this, stageWidth=this.$slider.outerWidth(), slidesWidth=parseInt(stageWidth / this.options.carouselSlidesToShow), windowWidth=window.innerWidth||$(window).width(); if(this.options.carouselResponsive && this.options.carouselResponsive.length && this.options.carouselResponsive!==null){ for (var breakpoint in this.options.carouselResponsive){ var breakpointValue=this.options.carouselResponsive[breakpoint]['breakpoint']; var newSlidesToShow=this.options.carouselResponsive[breakpoint]['settings']['carouselSlidesToShow']; if(breakpointValue >=windowWidth){ slidesWidth=parseInt(stageWidth / newSlidesToShow); this.options.carouselSlidesToShow=newSlidesToShow; }} } this.slideWidthCarousel=slidesWidth; this.$slides.each(function(i){ $(this).width(slidesWidth); }); var slideTrackWidth=slidesWidth * this.itemsCount; this.$sliderUl.width(slideTrackWidth).css('transform', 'translateX(0px)'); if(this.options.carouselSlidesToShow >=this.itemsCount){ this.$slider.find('.av-timeline-nav').hide(); }}, _navigate:function(dir, pos){ if(this.isAnimating||this.itemsCount < 2 ||!this.$slider.is(":visible")){ return false; } this.isAnimating=true; this.prev=this.current; if(pos!==undefined){ this.current=pos; dir=this.current > this.prev ? 'next':'prev'; } else if(dir==='next'){ this.current=this.current < this.itemsCount - 1 ? this.current + 1:0; if(this.current===0&&this.options.autoplay_stopper==1&&this.options.autoplay){ this.isAnimating=false; this.current=this.prev; this._stopSlideshow(); return false; }} else if(dir==='prev'){ this.current=this.current > 0 ? this.current - 1:this.itemsCount - 1; } this.gotoButtons.removeClass('active').eq(this.current).addClass('active'); if(this.options.carousel==='no'){ this._setSize(); } if(this.options.bg_slider==true){ if(this.imageUrls[this.current]['status']==true){ this['_' + this.options.animation].call(this, dir); }else{ this.loader.show(); this._preloadSingle(this.current, function(){ this['_' + this.options.animation].call(this, dir); this.loader.hide(); }); }}else{ this['_' + this.options.animation].call(this, dir); } if(this.current==0){ this.loopCount++; this.$slider.trigger('avia_slider_first_slide'); } else if(this.current==this.itemsCount - 1){ this.$slider.trigger('avia_slider_last_slide'); }else{ this.$slider.trigger('avia_slider_navigate_slide'); }}, _setSize: function(instant){ if(this.options.bg_slider==true) return; var self=this, slide=this.$slides.eq(this.current), img=slide.find('img'), current=Math.floor(this.$sliderUl.height()), ratio=slide.data('video-ratio'), setTo=ratio ? this.$sliderUl.width() / ratio:Math.floor(slide.height()), video_height=slide.data('video-height'), video_toppos=slide.data('video-toppos'); this.$sliderUl.height(current).css('padding',0); if(setTo!=current){ if(instant==true){ this.$sliderUl.css({height:setTo}); this.$win.trigger('av-height-change'); }else{ this.$sliderUl.avia_animate({height:setTo}, function(){ self.$win.trigger('av-height-change'); }); }} this._setCenter(); if(video_height&&video_height!="set"){ slide.find('iframe, embed, video, object, .av_youtube_frame').css({height: video_height + '%', top: video_toppos + '%'}); slide.data('video-height','set'); }}, _setCenter: function(){ var slide=this.$slides.eq(this.current), img=slide.find('img'), min_width=parseInt(img.css('min-width'),10), slide_width=slide.width(), caption=slide.find('.av-slideshow-caption'), css_left=((slide_width - min_width) / 2); if(caption.length){ if(caption.is('.caption_left')){ css_left=((slide_width - min_width) / 1.5); } else if(caption.is('.caption_right')){ css_left=((slide_width - min_width) / 2.5); }} if(slide_width >=min_width){ css_left=0; } img.css({left:css_left}); }, _carouselmove:function(){ var offset=this.slideWidthCarousel*this.currentCarousel; this.$sliderUl.css('transform', 'translateX(-'+offset+'px)'); }, _carouselslide: function(dir){ if(dir==='next'){ if(this.options.carouselSlidesToShow + this.currentCarousel < this.itemsCount){ this.currentCarousel++; this._carouselmove(); }} else if(dir==='prev'){ if(this.currentCarousel > 0){ this.currentCarousel--; this._carouselmove(); }} this.isAnimating=false; }, _slide: function(dir){ var dynamic=false, modifier=dynamic==true ? 2:1, sliderWidth=this.$slider.width(), direction=dir==='next' ? -1:1, property=this.browserPrefix + 'transform', reset={}, transition={}, transition2={}, trans_val=(sliderWidth * direction * -1), trans_val2=(sliderWidth * direction) / modifier; if(this.cssActive){ property=this.browserPrefix + 'transform'; if(this.css3DActive){ reset[property]="translate3d(" + trans_val + "px, 0, 0)"; transition[property]="translate3d(" + trans_val2 + "px, 0, 0)"; transition2[property]="translate3d(0,0,0)"; }else{ reset[property]="translate(" + trans_val + "px,0)"; transition[property]="translate(" + trans_val2 + "px,0)"; transition2[property]="translate(0,0)"; }}else{ reset.left=trans_val; transition.left=trans_val2; transition2.left=0; } if(dynamic){ transition['z-index']="1"; transition2['z-index']="2"; } this._slide_animate(reset, transition, transition2); }, _slide_up: function(dir){ var dynamic=true, modifier=dynamic==true ? 2:1, sliderHeight=this.$slider.height(), direction=dir==='next' ? -1:1, property=this.browserPrefix + 'transform', reset={}, transition={}, transition2={}, trans_val=(sliderHeight * direction * -1), trans_val2=(sliderHeight * direction) / modifier; if(this.cssActive){ property=this.browserPrefix + 'transform'; if(this.css3DActive){ reset[property]="translate3d(0," + trans_val + "px, 0)"; transition[property]="translate3d(0," + trans_val2 + "px, 0)"; transition2[property]="translate3d(0,0,0)"; }else{ reset[property]="translate(0," + trans_val + "px)"; transition[property]="translate(0," + trans_val2 + "px)"; transition2[property]="translate(0,0)"; }}else{ reset.top=trans_val; transition.top=trans_val2; transition2.top=0; } if(dynamic){ transition['z-index']="1"; transition2['z-index']="2"; } this._slide_animate(reset, transition, transition2); }, _slide_animate: function(reset , transition , transition2){ var self=this, displaySlide=this.$slides.eq(this.current), hideSlide=this.$slides.eq(this.prev); hideSlide.trigger('pause'); if(!displaySlide.data('disableAutoplay')){ if(displaySlide.hasClass('av-video-lazyload')&&!displaySlide.hasClass('av-video-lazyload-complete')){ displaySlide.find('.av-click-to-play-overlay').trigger('click'); }else{ displaySlide.trigger('play'); }} displaySlide.css({visibility:'visible', zIndex:4, opacity:1, left:0, top:0}); displaySlide.css(reset); hideSlide.avia_animate(transition, this.options.transitionSpeed, this.options.easing); var after_slide=function(){ self.isAnimating=false; displaySlide.addClass('active-slide'); hideSlide.css({visibility:'hidden'}).removeClass('active-slide'); self.$slider.trigger('avia-transition-done'); } if(self.options.show_slide_delay > 0){ setTimeout(function(){ displaySlide.avia_animate(transition2, self.options.transitionSpeed, self.options.easing, after_slide); },self.options.show_slide_delay); }else{ displaySlide.avia_animate(transition2, self.options.transitionSpeed, self.options.easing, after_slide); }}, _fade: function(){ var self=this, displaySlide=this.$slides.eq(this.current), hideSlide=this.$slides.eq(this.prev), properties={visibility:'visible', zIndex:3, opacity:0}, fadeCallback=function(){ self.isAnimating=false; displaySlide.addClass('active-slide'); hideSlide.css({visibility:'hidden', zIndex:2}).removeClass('active-slide'); self.$slider.trigger('avia-transition-done'); }; hideSlide.trigger('pause'); if(!displaySlide.data('disableAutoplay')){ if(displaySlide.hasClass('av-video-lazyload')&&!displaySlide.hasClass('av-video-lazyload-complete')){ displaySlide.find('.av-click-to-play-overlay').trigger('click'); }else{ displaySlide.trigger('play'); }} if(self.options.fullfade==true){ hideSlide.avia_animate({opacity:0}, 200, 'linear', function(){ displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed, 'linear',fadeCallback); }); }else{ displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed/2, 'linear', function(){ hideSlide.avia_animate({opacity:0}, 200, 'linear', fadeCallback); }); }}, _attach_video_events: function(){ var self=this, $html=$('html'); self.$slides.each(function(i){ var currentSlide=$(this), caption=currentSlide.find('.caption_fullwidth, .av-click-overlay'), mejs=currentSlide.find('.mejs-mediaelement'), lazyload=currentSlide.hasClass('av-video-lazyload') ? true:false; if(currentSlide.data('avia_video_events')!=true){ currentSlide.data('avia_video_events', true); currentSlide.on('av-video-events-bound', { slide: currentSlide, wrap: mejs , iteration: i , self: self, lazyload: lazyload }, onReady); currentSlide.on('av-video-ended', { slide: currentSlide , self: self}, onFinish); currentSlide.on('av-video-play-executed', function(){ setTimeout(function(){ self.pause() }, 100); }); caption.on('click', { slide: currentSlide }, toggle); if(currentSlide.is('.av-video-events-bound')) currentSlide.trigger('av-video-events-bound'); if(lazyload&&i===0&&!currentSlide.data('disableAutoplay')){ currentSlide.find('.av-click-to-play-overlay').trigger('click'); }} }); function onReady(event){ if(event.data.iteration===0){ event.data.wrap.css('opacity',0); if(!event.data.self.isMobile&&!event.data.slide.data('disableAutoplay')){ event.data.slide.trigger('play'); } setTimeout(function(){ event.data.wrap.avia_animate({opacity:1}, 400); }, 50); } else if($html.is('.avia-msie')&&!event.data.slide.is('.av-video-service-html5')){ if(!event.data.slide.data('disableAutoplay')) event.data.slide.trigger('play'); } if(event.data.slide.is('.av-video-service-html5')&&event.data.iteration!==0){ event.data.slide.trigger('pause'); } if(event.data.lazyload){ event.data.slide.addClass('av-video-lazyload-complete'); event.data.slide.trigger('play'); }} function onFinish(event){ if(!event.data.slide.is('.av-single-slide')&&!event.data.slide.is('.av-loop-video')){ event.data.slide.trigger('reset'); self._navigate('next'); self.resume(); } if(event.data.slide.is('.av-loop-video')&&event.data.slide.is('.av-video-service-html5')){ if($html.is('.avia-safari-8')){ setTimeout(function(){ event.data.slide.trigger('play'); },1); }} } function toggle(event){ if(event.target.tagName!="A"){ event.data.slide.trigger('toggle'); }} }, _timer: function(callback, delay, first){ var self=this, start, remaining=delay; self.timerId=0; this.pause=function(){ window.clearTimeout(self.timerId); remaining -=new Date() - start; }; this.resume=function(){ start=new Date(); self.timerId=window.setTimeout(callback, remaining); }; this.destroy=function(){ window.clearTimeout(self.timerId); }; this.resume(true); }, _startSlideshow: function(){ var self=this; this.isPlaying=true; this.slideshow=new this._timer(function(){ self._navigate('next'); if(self.options.autoplay){ self._startSlideshow(); }}, (this.options.interval * 1000)); }, _stopSlideshow: function(){ if(this.options.autoplay){ this.slideshow.destroy(); this.isPlaying=false; this.options.autoplay=false; }}, next:function(e){ e.preventDefault(); this._stopSlideshow(); this._navigate('next'); }, previous:function(e){ e.preventDefault(); this._stopSlideshow(); this._navigate('prev'); }, go2:function(pos){ if(isNaN(pos)){ pos.preventDefault(); pos=pos.currentTarget.hash.replace('#',''); } pos -=1; if(pos===this.current||pos >=this.itemsCount||pos < 0){ return false; } this._stopSlideshow(); this._navigate(false, pos); }, play:function(){ if(!this.isPlaying){ this.isPlaying=true; this._navigate('next'); this.options.autoplay=true; this._startSlideshow(); }}, pause:function(){ if(this.isPlaying){ this.slideshow.pause(); }}, resume:function(){ if(this.isPlaying){ this.slideshow.resume(); }}, destroy:function(callback){ this.slideshow.destroy(callback); }} $.fn.aviaSlider=function(options){ return this.each(function(){ var self=$.data(this, 'aviaSlider'); if(!self){ self=$.data(this, 'aviaSlider', new $.AviaSlider(options, this)); }}); }})(jQuery); (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.avia_sc_gallery=function(options){ return this.each(function(){ var gallery=$(this), images=gallery.find('img'), big_prev=gallery.find('.avia-gallery-big'); gallery.on('avia_start_animation', function(){ images.each(function(i){ var image=$(this); setTimeout(function(){ image.addClass('avia_start_animation') }, (i * 110)); }); }); if(gallery.hasClass('deactivate_avia_lazyload')) gallery.trigger('avia_start_animation'); if(big_prev.length){ gallery.on('mouseenter','.avia-gallery-thumb a', function(){ var _self=this; big_prev.attr('data-onclick', _self.getAttribute("data-onclick")); big_prev.height(big_prev.height()); big_prev.attr('href', _self.href) var newImg=_self.getAttribute("data-prev-img"), oldImg=big_prev.find('img'), oldImgSrc=oldImg.attr('src'); if(newImg!=oldImgSrc){ var next_img=new Image(); next_img.src=newImg; var $next=$(next_img); if(big_prev.hasClass('avia-gallery-big-no-crop-thumb')){ $next.css({'height':big_prev.height(),'width':'auto'}); } big_prev.stop().animate({opacity:0}, function(){ $next.insertAfter(oldImg); oldImg.remove(); big_prev.animate({opacity:1}); big_prev.attr('title',$(_self).attr('title')); }); }}); big_prev.on('click', function(){ var imagelink=gallery.find('.avia-gallery-thumb a').eq(this.getAttribute("data-onclick") - 1); if(imagelink&&!imagelink.hasClass('aviaopeninbrowser')){ imagelink.trigger('click'); } else if(imagelink){ var imgurl=imagelink.attr("href"); if(imagelink.hasClass('aviablank')&&imgurl!=''){ window.open(imgurl, '_blank'); } else if(imgurl!=''){ window.open(imgurl, '_self'); }} return false; }); $(window).on("debouncedresize", function(){ big_prev.height('auto'); }); }}); }}(jQuery)); (function($){ "use strict"; $.fn.avia_hor_gallery=function(options){ var defaults = { slide_container:'.av-horizontal-gallery-inner', slide_element:'.av-horizontal-gallery-slider', slide_content:'.av-horizontal-gallery-wrap', active:'av-active-gal-item', prev:'.av-horizontal-gallery-prev', next:'.av-horizontal-gallery-next' }; var options=$.extend(defaults, options); var win=$(window), browserPrefix=$.avia_utilities.supports('transition'), cssActive=this.browserPrefix!==false ? true:false, isMobile=$.avia_utilities.isMobile, transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false, transition={}; return this.each(function(){ var container=$(this), slide_container=container.find(options.slide_container), slide_element=container.find(options.slide_element), slide_content=container.find(options.slide_content), prev=container.find(options.prev), next=container.find(options.next), imgs=container.find('img'), all_elements_width=0, currentIndex=false, initial=container.data('av-initial'), set_up=function(init){ var sl_height=(slide_container.width() / 100) * slide_container.data('av-height'); slide_container.css({'padding':0}).height(sl_height); imgs.css('display','inline-block'); setTimeout(function(){ imgs.css('display','block'); }, 10); all_elements_width=0; slide_content.each(function(){ all_elements_width +=$(this).outerWidth(true); }); slide_element.css('min-width' , all_elements_width); if(currentIndex!==false){ change_active(currentIndex); }}, change_active=function(index){ var current=slide_element.find(options.slide_content).eq(index), viewport=slide_container.width(), modifier=container.data('av-enlarge') > 1&¤tIndex==index ? container.data('av-enlarge'):1, outerWidth=current.outerWidth(true) * modifier, margin_right=parseInt(current.css('margin-right') , 10) / 2, left_pos=viewport < all_elements_width ? (current.position().left * - 1) - (outerWidth / 2) + (viewport / 2): 0; left_pos=left_pos + margin_right; if(left_pos + all_elements_width < viewport) left_pos=(all_elements_width - viewport - parseInt(current.css('margin-right'),10)) * -1; if(left_pos > 0) left_pos=0; slide_element.css('left',left_pos); slide_container.find("." +options.active).removeClass(options.active); current.addClass(options.active); currentIndex=index; }; $.avia_utilities.preload({container: container , global_callback: function(){ set_up('init'); win.on('debouncedresize', set_up); if(initial) change_active(initial - 1); setTimeout(function(){ container.addClass('av-horizontal-gallery-animated'); },10); }}); slide_element.avia_swipe_trigger({prev:options.prev, next:options.next}); slide_content.on('click', function(e){ var current=$(this); var index=slide_content.index(current); if(currentIndex===index){ if(container.data('av-enlarge') > 1&&!$(e.target).is('a')){ } return; } change_active(index); }); prev.on('click', function(e){ if(currentIndex===false) currentIndex=1; var index=currentIndex - 1; if(index < 0) index=0; change_active(index); }); next.on('click', function(e){ if(currentIndex===false) currentIndex=-1; var index=currentIndex + 1; if(index > slide_content.length - 1) index=slide_content.length - 1; change_active(index); }); if(!isMobile){ container.avia_keyboard_controls({ 37: options.prev, 39: options.next }); }else{ container.avia_swipe_trigger({next: options.next, prev: options.prev}); }}); };}(jQuery)); (function($){ "use strict"; $.AviaTextRotator=function(options, slider){ this.$win=$(window); this.$slider=$(slider); this.$inner=this.$slider.find('.av-rotator-text'); this.$slides=this.$inner.find('.av-rotator-text-single'); this.$current=this.$slides.eq(0); this.open=0; this.count=this.$slides.length; if($.avia_utilities.supported.transition===undefined){ $.avia_utilities.supported.transition=$.avia_utilities.supports('transition'); } this.browserPrefix=$.avia_utilities.supported.transition; this.cssActive=this.browserPrefix!==false ? true:false; this.property=this.browserPrefix + 'transform', this._init(options); } $.AviaTextRotator.prototype = { _init: function(options){ var _self=this; if(this.count <=1) return; _self.options=$.extend({}, options, this.$slider.data()); _self.$inner.addClass('av-rotation-active'); _self._autoplay(); if(_self.options.animation=="typewriter"){ _self.$slider.addClass('av-caret av-blinking-caret'); }}, _autoplay: function(){ var _self=this; _self.autoplay=setTimeout(function(){ _self.open=_self.open===false ? 0:_self.open + 1; if(_self.open >=_self.count) _self.open=0; if(_self.options.animation!="typewriter"){ _self._move({}, _self.open); _self._autoplay(); }else{ _self._typewriter(); }}, _self.options.interval * 1000) }, _typewriter: function(event){ var _self=this; _self.$current.css('background-color', _self.$current.css('color')); _self.$slider.removeClass('av-caret av-blinking-caret').addClass('av-marked-text'); setTimeout(function(){ _self.$slider.addClass('av-caret av-blinking-caret').removeClass('av-marked-text'); _self.$current.data('av_typewriter_text', _self.$current.html()); _self.$current.css('background-color', 'transparent'); _self.$current.html(""); }, 800); setTimeout(function(){ _self.$slider.removeClass('av-blinking-caret'); _self.$next=_self.$slides.eq(_self.open); var content=_self.$next.data('av_typewriter_text')||_self.$next.html(); _self.$current.css({display:'none'}); _self.$next.css({display:'inline'}); _self.$next.html(""); var i=0; var speed=50; function typeWriter(){ if(i < content.length){ _self.$next[0].innerHTML +=content.charAt(i); i++; setTimeout(typeWriter, speed + Math.floor(Math.random() * 100)); }else{ _self.$slider.addClass('av-caret av-blinking-caret'); _self.$current=_self.$slides.eq(_self.open); _self._autoplay(); }} typeWriter(); }, 1500); }, _move: function(event){ var _self=this, modifier=30 * _self.options.animation, fade_out={opacity:0}, fade_start={display:'inline-block', opacity:0}, fade_in={opacity:1}; this.$next=_self.$slides.eq(this.open); if(this.cssActive){ fade_out[_self.property]="translate(0px," + modifier +"px)"; fade_start[_self.property]="translate(0px," + (modifier * -1) +"px)"; fade_in[_self.property]="translate(0px,0px)"; }else{ fade_out['top']=modifier; fade_start['top']=(modifier * -1); fade_in['top']=0; } _self.$current.avia_animate(fade_out, function(){ _self.$current.css({display:'none'}); _self.$next.css(fade_start).avia_animate(fade_in, function(){ _self.$current=_self.$slides.eq(_self.open); }); }); }}; $.fn.avia_textrotator=function(options){ return this.each(function(){ var active=$.data(this, 'AviaTextRotator'); if(!active){ $.data(this, 'AviaTextRotator', 1); new $.AviaTextRotator(options, this); }}); }}(jQuery)); (function($){ "use strict"; $(window).on('load', function (e){ $('.avia-icongrid-flipbox').avia_sc_icongrid(); }); $.fn.avia_sc_icongrid=function(options){ return this.each(function(){ var container=$(this), icongrid_id='#' + $(this).attr('id'), methods; methods = { buildIconGrid: function (){ this.setMinHeight($(icongrid_id + ' li article')); this.createFlipBackground($(icongrid_id + ' li')); }, setMinHeight: function (els){ if(els.length < 2) return; var elsHeights=new Array(); els.css('min-height', '0').each(function (i){ var current=$(this); var currentHeight=current.outerHeight(true); elsHeights.push(currentHeight); }); var largest=Math.max.apply(null, elsHeights); els.css('min-height', largest); }, createFlipBackground: function(els){ els.each(function(index,element){ var back=$(this).find('.avia-icongrid-content'); if(back.length > 0){ if($(this).find('.avia-icongrid-flipback').length <=0){ var flipback=back.clone().addClass('avia-icongrid-flipback').removeClass('avia-icongrid-content'); back.after(flipback); }} }); }}; methods.buildIconGrid(); $(window).on('resize', function(){ methods.buildIconGrid(); }); }); }}(jQuery)); (function($){ "use strict"; $.fn.avia_sc_iconlist=function(options){ return this.each(function(){ var iconlist=$(this), elements=iconlist.find('>li'); iconlist.on('avia_start_animation', function(){ elements.each(function(i){ var element=$(this); setTimeout(function(){ element.addClass('avia_start_animation') }, (i * 350)); }); }); }); }}(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(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,o){var n,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,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}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=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(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||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n