").append(jQuery.parseHTML(responseText)),
error=response.find('.av-form-error-container');
if(error.length){
form_sent=false;
form.prepend(error);
error.css({display:"none"}).slideDown(400, function(){
$('body').trigger('av_resize_finished');
});
send.button.removeClass('av-sending-button');
send.button.val(original_label);
}else{
if(redirect_to&&action!=redirect_to){
form.attr('action', redirect_to);
location.href=redirect_to;
}else{
var success_text=response.find(options.responseContainer + "_" + form_id);
responseContainer.html(success_text).removeClass('hidden').css({display:"block"});
form.slideUp(400, function(){
responseContainer.slideDown(400, function(){
$('body').trigger('av_resize_finished');
});
send.formElements.val('');
});
}}
},
error: function(){
},
complete: function(){
}});
}});
};})(jQuery);
(function($){
"use strict";
$.AviaSlider=function(options, slider){
var self=this;
this.$win=$(window);
this.$slider=$(slider);
this.isMobile=$.avia_utilities.isMobile;
this._prepareSlides(options);
$.avia_utilities.preload({container: this.$slider , single_callback: function(){ self._init(options); }});
};
$.AviaSlider.defaults={
interval:5,
autoplay:false,
stopinfiniteloop: false,
animation:'slide',
transitionSpeed:900,
easing:'easeInOutQuart',
wrapElement: '>ul',
slideElement: '>li',
hoverpause: false,
bg_slider: false,
show_slide_delay: 0,
fullfade: false,
carousel: 'no',
carouselSlidesToShow: 3,
carouselSlidesToScroll: 1,
carouselResponsive:new Array()
};
$.AviaSlider.prototype =
{
_init: function(options){
this.options=this._setOptions(options);
this.$sliderUl=this.$slider.find(this.options.wrapElement);
this.$slides=this.$sliderUl.find(this.options.slideElement);
this.gotoButtons=this.$slider.find('.avia-slideshow-dots a');
this.permaCaption=this.$slider.find('>.av-slideshow-caption');
this.itemsCount=this.$slides.length;
this.current=0;
this.currentCarousel=0;
this.slideWidthCarousel='240';
this.loopCount=0;
this.isAnimating=false;
this.browserPrefix=$.avia_utilities.supports('transition');
this.cssActive=this.browserPrefix!==false ? true:false;
this.css3DActive=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false;
if(this.options.bg_slider==true){
this.imageUrls=[];
this.loader=$.avia_utilities.loading(this.$slider);
this._bgPreloadImages();
}else{
this._kickOff();
}
if(this.options.carousel==='yes'){
this.options.animation='carouselslide';
}},
_setOptions: function(options){
var newOptions=$.extend(true, {}, $.AviaSlider.defaults, options),
htmlData=this.$slider.data();
for(var i in htmlData){
var key=('transition_speed'!=i) ? i :'transitionSpeed';
if(typeof htmlData[ i ]==="string"||typeof htmlData[ i ]==="number"||typeof htmlData[ i ]==="boolean"){
newOptions[ key ]=htmlData[ i ];
}}
return newOptions;
},
_prepareSlides: function(options){
if(this.isMobile){
var alter=this.$slider.find('.av-mobile-fallback-image');
alter.each(function(){
var current=$(this).removeClass('av-video-slide').data({'avia_video_events': true, 'video-ratio':0}),
fallback=current.data('mobile-img'),
fallback_link=current.data('fallback-link'),
appendTo=current.find('.avia-slide-wrap');
current.find('.av-click-overlay, .mejs-mediaelement, .mejs-container').remove();
if(!fallback){
$('
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).on('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'){
if(!this.isMobile){
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{
if(self.current===0){
hideSlide.avia_animate({opacity:0}, self.options.transitionSpeed/2, 'linear');
displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed/2, '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=['years','months','weeks','days','hours','minutes','seconds'],
_second=1000,
_minute=_second * 60,
_hour=_minute * 60,
_day=_hour * 24,
_week=_day * 7,
getDaysInMonth=function(month, year){
return new Date(year, month, 0).getDate();
},
splitStartDate=function(date){
var result={
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
hours: date.getHours(),
minutes: date.getMinutes(),
seconds: date.getSeconds()
};
return result;
},
getYears=function(start, endDate){
var diff=endDate.getFullYear() - start.year;
if(diff > 0){
var check=new Date(start.year + diff, start.month - 1, start.day, start.hours, start.minutes, start.seconds);
if(check > endDate){
diff --;
}}
return(diff >=0) ? diff:0;
},
getMonths=function(start, endDate){
var endMonth=endDate.getMonth() + 1;
var diff=endMonth - start.month;
if(diff < 0){
diff=12 - start.month + endMonth;
}
if(diff > 0){
var check=new Date(start.year, start.month - 1 + diff, start.day, start.hours, start.minutes, start.seconds);
if(check > endDate){
diff --;
}}
return(diff >=0) ? diff:0;
},
getDays=function(start, endDate){
var endDay=endDate.getDate();
var diff=endDay - start.day;
if(diff < 0){
diff=getDaysInMonth(start.month, start.year) - start.day + endDay;
}
if(diff > 0){
var check=new Date(start.year, start.month - 1, start.day + diff, start.hours, start.minutes, start.seconds);
if(check > endDate){
diff --;
}}
return(diff >=0) ? diff:0;
},
getBetween=function(startDate, endDate){
var start=splitStartDate(startDate),
result={
years: 0,
year_months: 0,
month_months: 0,
days: 0
};
result.years=getYears(start, endDate);
start.year +=result.years;
result.year_months=getMonths(start, endDate);
start.month +=result.year_months;
result.days=getDays(start, endDate);
start.day +=result.days;
result.month_months=result.years * 12 + result.year_months;
return result;
},
ticker=function(_self){
var tmLoc=new Date(),
_now=new Date(tmLoc.getTime() + tmLoc.getTimezoneOffset() * 60000),
_timestamp=_self.end - _now;
if(_timestamp <=0){
clearInterval(_self.countdown);
return;
}
_self.time.years=0;
_self.time.months=0;
_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);
var between=getBetween(_now, _self.end);
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;
case 6:
_self.time.days=between.days;
_self.time.months=between.month_months;
break;
case 7:
_self.time.days=between.days;
_self.time.months=between.year_months;
_self.time.years=between.years;
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);
if(_self.data.timezone!='0'){
_self.end=new Date(_self.end.getTime() - _self.data.timezone * 60000);
}
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");
var secure=imagelink.hasClass('custom_link') ? 'noopener,noreferrer':'';
if(imagelink.hasClass('aviablank')&&imgurl!=''){
window.open(imgurl, '_blank', secure);
}
else if(imgurl!=''){
window.open(imgurl, '_self', secure);
}}
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();
content=content.replace(/&/g, '&');
_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 flipbox=$(this),
icongrid_id='#' + $(this).attr('id'),
methods={},
flipbox_cards=$('.avia-icongrid-flipbox li');
flipbox_cards.on('touchend', function(e){
var current=$(this),
container=current.closest('.avia-icongrid-flipbox');
if(current.hasClass('avia-hover')){
container.find('li').removeClass('avia-hover');
}else{
container.find('li').removeClass('avia-hover');
current.addClass('avia-hover');
}
var links=current.find('a');
if(links.length > 0){
links.off('touchend.aviaIconGridLink').on('touchend.aviaIconGridLink', function(e){
e.preventDefault();
e.stopImmediatePropagation();
var link=$(this);
link.css('opacity', 0.5);
window.location.href=link.attr("href");
});
}
e.preventDefault();
e.stopImmediatePropagation();
});
if(flipbox.hasClass('avia_flip_force_close')){
$('body').on('touchend', function(e){
var flipboxes=$('.avia-icongrid-flipbox.avia_flip_force_close');
flipboxes.each(function(){
var flipbox=$(this);
flipbox.find('li').removeClass('avia-hover');
});
});
}
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.each(function (i){
var current=$(this),
filter=current.data('filter'),
entry=_self.container.filter('.' + filter);
if(entry.length==0||entry.html().trim()==''){
current.hide();
current.prev('span.text-sep').hide();
}});
_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
1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.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?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/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"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._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-layout/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 o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/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-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,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-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;na||ra?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=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.xa.x&&this.ya.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.yg&&(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=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=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=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;cc&&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};this.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 data.items){
new_items=new_items.not(new_items.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(){
setTimeout(function(){ the_win.trigger('debouncedresize'); }, 500);
}});
}};
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');
});
});
}});
});
};}(jQuery));
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$(function(){
$.avia_utilities=$.avia_utilities||{};
if($.avia_utilities.avia_sticky_submenu){
$.avia_utilities.avia_sticky_submenu();
}});
$.avia_utilities.avia_sticky_submenu=function(){
var win=$(window),
html=$('html').first(),
header=$('.html_header_top.html_header_sticky #header'),
html_margin=parseInt($('html').first().css('margin-top'), 10),
setWitdth=$('.html_header_sidebar #main, .boxed #main'),
menus=$('.av-submenu-container'),
bordermod=html.is('.html_minimal_header') ? 0:1,
fixed_frame=$('.av-frame-top').height(),
burger_menu=$('.av-burger-menu-main'),
calc_margin=function(){
html_margin=parseInt(html.css('margin-top'), 10);
if(!$('.mobile_menu_toggle:visible').length){
$('.av-open-submenu').removeClass('av-open-submenu');
}
menus.filter('.av-sticky-submenu').each(function(){
$(this).next('.sticky_placeholder').height($(this).height());
});
},
calc_values=function(){
var content_width=setWitdth.width();
html_margin=parseInt(html.css('margin-top'), 10);
menus.width(content_width);
},
check=function(placeholder, no_timeout){
var menu_pos=this.offset().top,
top_pos=placeholder.offset().top,
scrolled=win.scrollTop(),
modifier=html_margin,
fixed=false;
if(burger_menu.is(":visible")){
this.css({top: 'auto', position: 'absolute'});fixed=false;
return;
}
if(header.length){
modifier +=header.outerHeight() + parseInt(header.css('margin-top'), 10);
}
if(fixed_frame){
modifier +=fixed_frame;
}
if(scrolled + modifier > top_pos){
if(!fixed){
this.css({top: modifier - bordermod, position: 'fixed'});fixed=true;
}}else{
this.css({top: 'auto', position: 'absolute'});fixed=false;
}},
toggle=function(e){
e.preventDefault();
var clicked=$(this),
menu=clicked.siblings('.av-subnav-menu');
if(menu.hasClass('av-open-submenu')){
menu.removeClass('av-open-submenu');
}else{
menu.addClass('av-open-submenu');
}};
win.on("debouncedresize av-height-change", calc_margin); calc_margin();
if(setWitdth.length){
win.on("debouncedresize av-height-change", calc_values);
calc_values();
}
menus.each(function(){
var menu=$(this), sticky=menu.filter('.av-sticky-submenu'), placeholder=menu.next('.sticky_placeholder'), mobile_button=menu.find('.mobile_menu_toggle');
if(sticky.length) win.on('scroll debouncedresize', function(){ window.requestAnimationFrame($.proxy(check, sticky, placeholder)); });
if(mobile_button.length){
mobile_button.on('click', toggle);
}});
html.on('click', '.av-submenu-hidden .av-open-submenu li a', function(){
var current=$(this);
var list_item=current.siblings('ul, .avia_mega_div');
if(list_item.length){
if(list_item.hasClass('av-visible-sublist')){
list_item.removeClass('av-visible-sublist');
}else{
list_item.addClass('av-visible-sublist');
}
return false;
}});
$('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function(){
var current=$(this);
var list_item=current.siblings('ul');
if(list_item.length){
if(list_item.hasClass('av-visible-mobile-sublist')){
}else{
$('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist');
list_item.addClass('av-visible-mobile-sublist');
return false;
}}
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_messagebox=function (options){
"use strict";
return this.each(function (){
var container=$(this),
close_btn=container.find('.av_message_close'),
mbox_ID=container.attr('id'),
aviaSetCookie=function(CookieName,CookieValue,CookieDays){
var expires="";
if(CookieDays){
var date=new Date();
date.setTime(date.getTime() +(CookieDays*24*60*60*1000));
expires="; expires=" + date.toGMTString();
}
document.cookie=CookieName + "=" + CookieValue + expires + "; path=/; samesite=strict";
},
aviaGetCookie=function(CookieName){
var docCookiesStr=CookieName + "=";
var docCookiesArr=document.cookie.split(';');
for(var i=0; i < docCookiesArr.length; i++){
var thisCookie=docCookiesArr[i];
while(thisCookie.charAt(0)==' '){
thisCookie=thisCookie.substring(1,thisCookie.length);
}
if(thisCookie.indexOf(docCookiesStr)==0){
var cookieContents=container.attr('data-contents');
var savedContents=thisCookie.substring(docCookiesStr.length, thisCookie.length);
if(savedContents==cookieContents){
return savedContents;
}}
}
return null;
};
if(! aviaGetCookie(mbox_ID)){
container.removeClass('messagebox-hidden');
}
close_btn.on('click', function(){
var cookieContents=container.attr('data-contents');
var cookieLifetime="";
if(container.hasClass('messagebox-session_cookie')){
cookieLifetime="";
}
else if(container.hasClass('messagebox-custom_cookie')){
cookieLifetime=parseInt(container.attr('data-cookielifetime'));
}
aviaSetCookie(mbox_ID, cookieContents, cookieLifetime);
container.addClass('messagebox-hidden');
});
});
};
$('.avia_message_box').avia_sc_messagebox();
}(jQuery));
(function($){
$.fn.avia_sc_animated_number=function(options){
if(!this.length) return;
if(this.is('.avia_sc_animated_number_active')) return;
this.addClass('avia_sc_animated_number_active');
var simple_upcount=(options&&options.simple_up) ? true:false,
start_timer=(options&&options.start_timer) ? options.start_timer:300,
format_number=function(number, number_format, final_number){
var prepend='',
addZeros=final_number.toString().length - number.toString().length;
for(var i=addZeros; i > 0; i--){
prepend +='0';
}
number=(simple_upcount) ? number.toString():prepend + number.toString();
if(''==number_format){
return number;
}
return number.split(/(?=(?:...)*$)/).join(number_format);
},
start_count=function(element, countTo, increment, current, fakeCountTo, number_format){
var newCount=current + increment,
final='';
if(newCount >=fakeCountTo){
final=format_number(countTo, number_format, countTo);
element.text(final);
}else{
final=format_number(newCount, number_format, countTo);
element.text(final);
window.requestAnimationFrame(function(){ start_count(element, countTo, increment, newCount, fakeCountTo, number_format); });
}};
return this.each(function(){
var number_container=$(this),
elements=number_container.find('.__av-single-number'),
countTimer=number_container.data('timer')||3000;
elements.each(function(i){
var element=$(this),
text=element.text();
if(window.addEventListener) element.text(text.replace(/./g, "0"));
});
number_container.addClass('number_prepared').on('avia_start_animation', function(){
if(number_container.is('.avia_animation_done')) return;
number_container.addClass('avia_animation_done');
elements.each(function(i){
var element=$(this),
countTo=element.data('number'),
fakeCountTo=countTo,
current=parseInt(element.text(),10),
zeroOnly=/^0+$/.test(countTo),
increment=0,
number_format='';
if('undefined'!=typeof element.data('start_from')){
current=element.data('start_from');
}
if('undefined'!=typeof element.data('number_format')){
number_format=element.data('number_format');
}
if(zeroOnly&&countTo!==0){
fakeCountTo=countTo.replace(/0/g, '9');
}
increment=Math.round(fakeCountTo * 32 / countTimer);
if(increment==0||increment % 10==0) increment +=1;
setTimeout(function(){ start_count(element, countTo, increment, current, fakeCountTo, number_format);}, start_timer);
});
});
if(options&&options.instant_start==true){
number_container.trigger('avia_start_animation');
}});
};})(jQuery);
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$.fn.avia_iso_sort=function(options){
return this.each(function(){
var the_body=$('body'),
container=$(this),
portfolio_id=container.data('portfolio-id'),
parentContainer=container.closest('.av-portfolio-grid-sorting-container, .entry-content-wrapper, .avia-fullwidth-portfolio'),
filter=parentContainer.find('.sort_width_container[data-portfolio-id="' + portfolio_id + '"]').find('#js_sort_items').css({visibility:"visible", opacity:0}),
links=filter.find('a'),
imgParent=container.find('.grid-image'),
isoActive=false,
items=$('.post-entry', container),
is_originLeft=the_body.hasClass('rtl') ? false:true;
function applyIso(){
container.addClass('isotope_activated').isotope({
layoutMode:'fitRows', itemSelector:'.flex_column', originLeft: is_originLeft
});
container.isotope('on', 'layoutComplete', function(){
container.css({overflow:'visible'});
the_body.trigger('av_resize_finished');
});
isoActive=true;
setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
};
links.on('click',function(){
var current=$(this),
selector=current.data('filter'),
linktext=current.html(),
activeCat=parentContainer.find('.av-current-sort-title');
if(activeCat.length) activeCat.html(linktext);
links.removeClass('active_sort');
current.addClass('active_sort');
container.attr('id', 'grid_id_'+selector);
parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
container.isotope({ layoutMode:'fitRows', itemSelector:'.flex_column' , filter: '.'+selector, originLeft: is_originLeft });
return false;
});
$(window).on('debouncedresize', function(){
applyIso();
});
$.avia_utilities.preload({container: container, single_callback: function(){
filter.animate({opacity:1}, 400); applyIso();
setTimeout(function(){ applyIso(); });
imgParent.css({height:'auto'}).each(function(i){
var currentLink=$(this);
setTimeout(function(){
currentLink.animate({opacity:1},1500);
}, (100 * i));
});
}});
});
};
$.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' // 'fade' or '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){
$.avia_utilities.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');
$.avia_utilities.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;
}
var template=$('#avia-tmpl-portfolio-preview-' + post_id.replace(/ID_/,""));
if(template.length==0){
setTimeout(function(){ methods.ajax_get_contents(post_id, clickedIndex); return; }, 500);
}
content_retrieved[post_id]=template.html();
content_retrieved[post_id]=content_retrieved[post_id].replace('','').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').on('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', container).eq(0).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', container).last().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);
win.on('debouncedresize', methods.resize_reset);
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_progressbar=function(options){
return this.each(function(){
var container=$(this), elements=container.find('.avia-progress-bar');
container.on('avia_start_animation', function(){
elements.each(function(i){
var element=$(this);
setTimeout(function(){
element.find('.progress').addClass('avia_start_animation');
element.find('.progressbar-percent').avia_sc_animated_number({
instant_start:true, simple_up:true, start_timer: 10
});
}, (i * 250));
});
});
});
};}(jQuery));
(function($){
"use strict";
$.AviaVideoAPI=function(options, video, option_container){
this.videoElement=video;
this.$video=$(video);
this.$option_container=option_container ? $(option_container):this.$video;
this.load_btn=this.$option_container.find('.av-click-to-play-overlay');
this.video_wrapper=this.$video.parents('ul').eq(0);
this.lazy_load=this.video_wrapper.hasClass('av-show-video-on-click') ? true:false;
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.players =
{
}
$.AviaVideoAPI.prototype =
{
_init: function(options){
this.options=this._setOptions(options);
this.type=this._getPlayerType();
this.player=false;
this._bind_player();
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';
},
_bind_player: function(){
var _self=this;
var cookie_check=$('html').hasClass('av-cookies-needs-opt-in')||$('html').hasClass('av-cookies-can-opt-out');
var allow_continue=true;
var silent_accept_cookie=$('html').hasClass('av-cookies-user-silent-accept');
var self_hosted='html5'==this.type;
if(cookie_check&&! silent_accept_cookie&&! self_hosted){
if(! document.cookie.match(/aviaCookieConsent/)||$('html').hasClass('av-cookies-session-refused')){
allow_continue=false;
}else{
if(! document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){
allow_continue=false;
}
else if(! document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){
allow_continue=false;
}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){
allow_continue=false;
}}
}
if(! allow_continue){
this._use_external_link();
return;
}
if(this.lazy_load&&this.load_btn.length&&this.type!="html5"){
this.$option_container.addClass('av-video-lazyload');
this.load_btn.on('click', function(){
_self.load_btn.remove();
_self._setPlayer();
});
}else{
this.lazy_load=false;
this._setPlayer();
}},
_use_external_link: function(){
this.$option_container.addClass('av-video-lazyload');
this.load_btn.on('click', function(e){
if(e.originalEvent===undefined) return;
var src_url=$(this).parents('.avia-slide-wrap').find('div[data-original_url]').data('original_url');
if(src_url) window.open(src_url , '_blank');
});
},
_setPlayer: function(){
var _self=this;
switch(this.type){
case "html5":
this.player=this.$video.data('mediaelementplayer');
if(!this.player){
this.$video.data('mediaelementplayer', $.AviaVideoAPI.players[ this.$video.attr('id').replace(/_html5/,'') ]);
this.player=this.$video.data('mediaelementplayer');
}
this._playerReady();
break;
case "vimeo":
var ifrm=document.createElement("iframe");
var $ifrm=$(ifrm);
ifrm.onload=function(){
_self.player=Froogaloop(ifrm);
_self._playerReady();
_self.$option_container.trigger('av-video-loaded');
};
ifrm.setAttribute("src", this.$video.data('src'));
$ifrm.insertAfter(this.$video);
this.$video.remove();
this.$video=ifrm;
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(){
if(this.player){
this.player.options.pauseOtherPlayers=false;
this.player.play();
}},
_html5_pause: function(){
if(this.player) this.player.pause();
},
_html5_mute: function(){
if(this.player) this.player.setMuted(true);
},
_html5_unmute: function(){
if(this.player) this.player.setVolume(0.7);
},
_html5_loop: function(){
if(this.player) this.player.options.loop=true;
},
_html5_reset: function(){
if(this.player) 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(){ jQuery('body').trigger('av-youtube-iframe-api-loaded'); };
var Froogaloop=(function(){
function Froogaloop(iframe){
return new Froogaloop.fn.init(iframe);
}
var eventCallbacks={},
hasWindowEvent=false,
isReady=false,
slice=Array.prototype.slice,
playerOrigin='*';
Froogaloop.fn=Froogaloop.prototype={
element: null,
init: function(iframe){
if(typeof iframe==="string"){
iframe=document.getElementById(iframe);
}
this.element=iframe;
return this;
},
api: function(method, valueOrCallback){
if(!this.element||!method){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null,
params = !isFunction(valueOrCallback) ? valueOrCallback:null,
callback=isFunction(valueOrCallback) ? valueOrCallback:null;
if(callback){
storeCallback(method, callback, target_id);
}
postMessage(method, params, element);
return self;
},
addEvent: function(eventName, callback){
if(!this.element){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null;
storeCallback(eventName, callback, target_id);
if(eventName!='ready'){
postMessage('addEventListener', eventName, element);
}
else if(eventName=='ready'&&isReady){
callback.call(null, target_id);
}
return self;
},
removeEvent: function(eventName){
if(!this.element){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null,
removed=removeCallback(eventName, target_id);
if(eventName!='ready'&&removed){
postMessage('removeEventListener', eventName, element);
}}
};
function postMessage(method, params, target){
if(!target.contentWindow.postMessage){
return false;
}
var data=JSON.stringify({
method: method,
value: params
});
target.contentWindow.postMessage(data, playerOrigin);
}
function onMessageReceived(event){
var data, method;
try {
data=JSON.parse(event.data);
method=data.event||data.method;
}
catch(e){
}
if(method=='ready'&&!isReady){
isReady=true;
}
if(!(/^https?:\/\/player.vimeo.com/).test(event.origin)){
return false;
}
if(playerOrigin==='*'){
playerOrigin=event.origin;
}
var value=data.value,
eventData=data.data,
target_id=target_id==='' ? null:data.player_id,
callback=getCallback(method, target_id),
params=[];
if(!callback){
return false;
}
if(value!==undefined){
params.push(value);
}
if(eventData){
params.push(eventData);
}
if(target_id){
params.push(target_id);
}
return params.length > 0 ? callback.apply(null, params):callback.call();
}
function storeCallback(eventName, callback, target_id){
if(target_id){
if(!eventCallbacks[target_id]){
eventCallbacks[target_id]={};}
eventCallbacks[target_id][eventName]=callback;
}else{
eventCallbacks[eventName]=callback;
}}
function getCallback(eventName, target_id){
if(target_id&&eventCallbacks[target_id]&&eventCallbacks[target_id][eventName]){
return eventCallbacks[target_id][eventName];
}else{
return eventCallbacks[eventName];
}}
function removeCallback(eventName, target_id){
if(target_id&&eventCallbacks[target_id]){
if(!eventCallbacks[target_id][eventName]){
return false;
}
eventCallbacks[target_id][eventName]=null;
}else{
if(!eventCallbacks[eventName]){
return false;
}
eventCallbacks[eventName]=null;
}
return true;
}
function isFunction(obj){
return !!(obj&&obj.constructor&&obj.call&&obj.apply);
}
function isArray(obj){
return toString.call(obj)==='[object Array]';
}
Froogaloop.fn.init.prototype=Froogaloop.fn;
if(window.addEventListener){
window.addEventListener('message', onMessageReceived, false);
}else{
window.attachEvent('onmessage', onMessageReceived);
}
return (window.Froogaloop=window.$f=Froogaloop);
})();
(function($){
"use strict";
$.AviaccordionSlider=function(options, slider){
this.$slider=$(slider);
this.$inner=this.$slider.find('.aviaccordion-inner');
this.$slides=this.$inner.find('.aviaccordion-slide');
this.$images=this.$inner.find('.aviaccordion-image');
this.$last=this.$slides.last();
this.$titles=this.$slider.find('.aviaccordion-preview');
this.$titlePos=this.$slider.find('.aviaccordion-preview-title-pos');
this.$titleWrap=this.$slider.find('.aviaccordion-preview-title-wrap');
this.$win=$(window);
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.transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false;
this.isMobile=$.avia_utilities.isMobile;
this.property=this.browserPrefix + 'transform',
this.count=this.$slides.length;
this.open=false;
this.autoplay=false;
this.increaseTitle=this.$slider.is(".aviaccordion-title-on-hover");
this._init(options);
}
$.AviaccordionSlider.prototype =
{
_init: function(options){
var _self=this;
_self.options=$.extend({}, options, this.$slider.data());
$.avia_utilities.preload({container: this.$slider , single_callback: function(){ _self._kickOff(); }});
},
_kickOff: function(){
var _self=this;
_self._calcMovement();
_self._bindEvents();
_self._showImages();
_self._autoplay();
},
_autoplay: function(){
var _self=this;
if(_self.options.autoplay){
_self.autoplay=setInterval(function(){
_self.open=_self.open===false ? 0:_self.open + 1;
if(_self.open >=_self.count) _self.open=0;
_self._move({}, _self.open);
}, _self.options.interval * 1000)
}},
_showImages: function(){
var _self=this, counter=0, delay=300, title_delay=this.count * delay;
if(this.cssActive){
setTimeout(function(){ _self.$slider.addClass('av-animation-active'); } , 10);
}
this.$images.each(function(i){
var current=$(this), timer=delay * (i + 1);
setTimeout(function(){
current.avia_animate({opacity:1}, 400, function(){
current.css($.avia_utilities.supported.transition + "transform", "none");
});
},timer);
});
if(_self.increaseTitle) title_delay=0;
this.$titlePos.each(function(i){
var current=$(this), new_timer=title_delay + 100 * (i + 1);
setTimeout(function(){
current.avia_animate({opacity:1}, 200, function(){
current.css($.avia_utilities.supported.transition + "transform", "none");
});
},new_timer);
});
},
_bindEvents: function(){
var trigger=this.isMobile ? "click":"mouseenter";
this.$slider.on(trigger,'.aviaccordion-slide', $.proxy(this._move, this));
this.$slider.on('mouseleave','.aviaccordion-inner', $.proxy(this._move, this));
this.$win.on('debouncedresize', $.proxy(this._calcMovement, this));
this.$slider.on('av-prev av-next', $.proxy(this._moveTo, this));
if(this.isMobile){
this.$slider.avia_swipe_trigger({next: this.$slider, prev: this.$slider, event:{prev: 'av-prev', next: 'av-next'}});
}},
_titleHeight: function(){
var th=0;
this.$titleWrap.css({'height':'auto'}).each(function(){
var new_h=$(this).outerHeight();
if(new_h > th) th=new_h;
}).css({'height':th + 2});
},
_calcMovement: function(event, allow_repeat){
var _self=this,
containerWidth=this.$slider.width(),
defaultPos=this.$last.data('av-left'),
imgWidth=this.$images.last().width()||containerWidth,
imgWidthPercent=Math.floor((100 / containerWidth) * imgWidth),
allImageWidth=imgWidthPercent * _self.count,
modifier=3,
tempMinLeft=100 - imgWidthPercent,
minLeft=tempMinLeft > defaultPos / modifier ? tempMinLeft:0,
oneLeft=minLeft / (_self.count -1),
titleWidth=imgWidth;
if(allImageWidth < 110&&allow_repeat!==false){
var slideHeight=this.$slider.height(),
maxHeight=(slideHeight / allImageWidth) * 110 ;
this.$slider.css({'max-height': maxHeight});
_self._calcMovement(event, false);
return;
}
if(oneLeft < 2) minLeft=0;
this.$slides.each(function(i){
var current=$(this), newLeft=0, newRight=0, defaultLeft=current.data('av-left');
if(minLeft!==0){
newLeft=oneLeft * i;
newRight=imgWidthPercent + newLeft - oneLeft;
}else{
newLeft=defaultLeft / Math.abs(modifier);
newRight=100 - ((newLeft / i) * (_self.count - i));
}
if(i==1&&_self.increaseTitle){ titleWidth=newRight + 1; }
if(_self.cssActive){
newLeft=newLeft - defaultLeft;
newRight=newRight - defaultLeft;
defaultLeft=0;
}
current.data('av-calc-default', defaultLeft);
current.data('av-calc-left', newLeft);
current.data('av-calc-right', newRight);
});
if(_self.increaseTitle){ _self.$titles.css({width: titleWidth + "%"});}},
_moveTo: function(event){
var direction=event.type=="av-next" ? 1:-1,
nextSlide=this.open===false ? 0:this.open + direction;
if(nextSlide >=0&&nextSlide < this.$slides.length) this._move(event, nextSlide);
},
_move: function(event, direct_open){
var _self=this,
slide=event.currentTarget,
itemNo=typeof direct_open!="undefined" ? direct_open:this.$slides.index(slide);
this.open=itemNo;
if(_self.autoplay&&typeof slide!="undefined"){ clearInterval(_self.autoplay); _self.autoplay=false; }
this.$slides.removeClass('aviaccordion-active-slide').each(function(i){
var current=$(this),
dataSet=current.data(),
trans_val=i <=itemNo ? dataSet.avCalcLeft:dataSet.avCalcRight,
transition={},
reset=event.type=='mouseleave' ? 1:0,
active=itemNo===i ? _self.$titleWrap.eq(i):false;
if(active) current.addClass('aviaccordion-active-slide');
if(reset){
trans_val=dataSet.avCalcDefault;
this.open=false;
}
if(_self.cssActive){
transition[_self.property]=_self.transform3d ? "translate3d(" + trans_val + "%, 0, 0)":"translate(" + trans_val + "%,0)";
current.css(transition);
}else{
transition.left=trans_val + "%";
current.stop().animate(transition, 700, 'easeOutQuint');
}});
}};
$.fn.aviaccordion=function(options){
return this.each(function(){
var active=$.data(this, 'AviaccordionSlider');
if(!active){
$.data(this, 'AviaccordionSlider', 1);
new $.AviaccordionSlider(options, this);
}});
}})(jQuery);
(function($){
"use strict";
$.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 < winTop&&winTop <=this.property.offset + this.property.height){
scrollPos=Math.round((winTop - this.property.offset) * 0.3);
}
if(this.scrollPos!=scrollPos){
this.scrollPos=scrollPos;
if(this.transform3d){
prop[$.avia_utilities.supported.transition+"transform"]="translate3d(0px,"+ scrollPos +"px,0px)";
}else{
prop[$.avia_utilities.supported.transition+"transform"]="translate(0px,"+ scrollPos +"px)";
}
this.$inner.css(prop);
}
this.ticking=false;
}};
$.fn.aviaFullscreenSlider=function(options){
return this.each(function(){
var active=$.data(this, 'aviaFullscreenSlider');
if(!active){
$.data(this, 'aviaFullscreenSlider', 1);
new $.AviaFullscreenSlider(options, this);
}});
}})(jQuery);
(function($){
"use strict";
$.fn.layer_slider_height_helper=function(options){
return this.each(function(){
var container=$(this),
first_div=container.find('>div').first(),
timeout=false,
counter=0,
reset_size=function(){
if(first_div.height() > 0||counter > 5){
container.height('auto');
}else{
timeout=setTimeout(reset_size, 500);
counter++;
}};
if(! first_div.length){
return;
}
timeout=setTimeout(reset_size, 0);
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_tab_section=function(){
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),
tabs=container.find('.av-section-tab-title'),
tab_outer=container.find('.av-tab-section-outer-container'),
tab_wrap=container.find('.av-tab-section-tab-title-container'),
tab_nav=container.find('.av_tab_navigation'),
arrows_wrap=container.find('.av-tabsection-arrow'),
arrows=arrows_wrap.find('.av-tab-section-slide'),
content_wrap=container.find('.av-tab-section-inner-container'),
single_tabs=container.find('.av-animation-delay-container'),
inner_content=container.find('.av-layout-tab-inner'),
sliding_active=container.is('.av-tab-slide-transition'),
flexible=container.is('.av-tab-content-auto'),
current_content=container.find('.__av_init_open'),
min_width=0,
change_tab=function(e, prevent_hash){
e.preventDefault();
var current_tab=$(e.currentTarget),
current_arrow=current_tab.find('.av-tab-arrow-container span'),
tab_nr=current_tab.data('av-tab-section-title');
current_content=container.find('[data-av-tab-section-content="'+tab_nr+'"]');
var new_bg=current_content.data('av-tab-bg-color'),
new_font=current_content.data('av-tab-color'),
prev_container=container.find('.av-active-tab-content').not('[data-av-tab-section-content="'+tab_nr+'"]');
tabs.attr('style','').removeClass('av-active-tab-title');
current_tab.removeClass('no-scroll');
current_tab.addClass('av-active-tab-title');
current_content.addClass("av-active-tab-content");
if(new_bg!==""){
current_arrow.css('background-color', new_bg);
}
if(new_font!==""){
current_tab.css('color', new_font);
}
var new_pos=(( parseInt(tab_nr, 10) - 1) * -100);
if($('body').hasClass('rtl')){
new_pos=(( parseInt(tab_nr,10) - 1) * 100);
}
if(cssActive){
new_pos=new_pos / tabs.length;
transition['transform']=transform3d ? "translate3d(" + new_pos + "%, 0, 0)":"translate(" + new_pos + "%,0)";
transition['left']="0%";
content_wrap.css(transition);
}else{
content_wrap.css('left', new_pos + "%");
}
set_tab_title_pos();
set_slide_height();
if(! prevent_hash){
location.hash=current_tab.attr('href');
}
setTimeout(function(){
current_content.trigger('avia_start_animation_if_current_slide_is_active');
if(! isMobile){
single_tabs.not(current_content).trigger('avia_remove_animation');
}}, 600);
},
set_min_width=function(){
min_width=0;
tabs.each(function(){
min_width +=$(this).outerWidth();
});
tab_wrap.css('min-width', min_width);
},
set_slide_height=function(){
if(current_content.length&&flexible){
var old_height=inner_content.height();
inner_content.height('auto');
var height=current_content.find('.av-layout-tab-inner').height(),
add_height=tab_wrap.height();
tab_outer.css('max-height', height + add_height + 100);
inner_content.height(old_height);
inner_content.height(height);
inner_content.css('overflow', 'hidden');
setTimeout(function(){ win.trigger('av-height-change'); }, 600);
}},
set_tab_title_pos=function(){
var current_tab=container.find('.av-active-tab-title'),
viewport=container.width(),
left_pos=(current_tab.position().left * - 1) -(current_tab.outerWidth() / 2) +(viewport / 2);
if(! $('body').hasClass('rtl')){
if(viewport >=min_width){
left_pos=0;
}
if(left_pos + min_width < viewport){
left_pos=(min_width - viewport) * -1;
}
if(left_pos > 0){
left_pos=0;
}
tab_wrap.css('left', left_pos);
var show_prev=left_pos!==0;
var show_next=left_pos + min_width > viewport;
set_arrows_visibility(show_prev, show_next);
}else{
var right_pos=0;
if(viewport < min_width){
if(left_pos + min_width > viewport){
if(left_pos > 0){
left_pos=0;
}
right_pos=(left_pos + min_width - viewport) * -1;
}}
tab_wrap.css('left', 'auto');
tab_wrap.css('right', right_pos);
var show_prev=right_pos + min_width > viewport;
var show_next=right_pos!==0;
set_arrows_visibility(show_prev, show_next);
}},
set_arrows_visibility=function(show_prev, show_next){
if(show_prev){
arrows_wrap.addClass('av-visible-prev');
}else{
arrows_wrap.removeClass('av-visible-prev');
}
if(show_next){
arrows_wrap.addClass('av-visible-next');
}else{
arrows_wrap.removeClass('av-visible-next');
}},
swipe_to_next_prev=function(e){
if(! isMobile){
return;
}
switch_to_next_prev(e);
},
switch_to_next_prev=function(e){
e.preventDefault();
var clicked=$(e.currentTarget),
current_tab=container.find('.av-active-tab-title');
if(clicked.is('.av_prev_tab_section')){
if(! $('body').hasClass('rtl')){
current_tab.prev('.av-section-tab-title').trigger('click');
}else{
current_tab.next('.av-section-tab-title').trigger('click');
}}else{
if(! $('body').hasClass('rtl')){
current_tab.next('.av-section-tab-title').trigger('click');
}else{
current_tab.prev('.av-section-tab-title').trigger('click');
}}
},
get_init_open=function(){
if(! hash&&window.location.hash) var hash=window.location.hash;
var open=tabs.filter('[href="'+hash+'"]');
if(open.length){
if(!open.is('.active_tab')) open.trigger('click');
}else{
container.find('.av-active-tab-title').trigger('click', true);
}};
$.avia_utilities.preload({
container: current_content,
single_callback: function(){
tabs.on('click', change_tab);
tab_nav.on('click', swipe_to_next_prev);
arrows.on('click', switch_to_next_prev);
win.on('debouncedresize', set_tab_title_pos);
win.on('debouncedresize av-content-el-height-changed', set_slide_height);
set_min_width();
set_slide_height();
get_init_open();
}});
content_wrap.avia_swipe_trigger({prev:'.av_prev_tab_section', next:'.av_next_tab_section'});
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_tabs=function(options){
var defaults =
{
heading: '.tab',
content:'.tab_content',
active:'active_tab',
sidebar: false
};
var win=$(window),
options=$.extend(defaults, options);
return this.each(function(){
var container=$(this),
tab_titles=$('').prependTo(container),
tabs=$(options.heading, container),
content=$(options.content, container),
newtabs=false,
oldtabs=false;
newtabs=tabs.clone();
oldtabs=tabs.addClass('fullsize-tab').attr('aria-hidden', true);
tabs=newtabs;
tabs.prependTo(tab_titles).each(function(i){
var tab=$(this),
the_oldtab=false;
if(newtabs){
the_oldtab=oldtabs.eq(i);
}
tab.addClass('tab_counter_'+i).on('click', function(){
open_content(tab, i, the_oldtab);
return false;
});
tab.on('keydown', function(objEvent){
if(objEvent.keyCode===13){
tab.trigger('click');
}});
if(newtabs){
the_oldtab.on('click', function(){
open_content(the_oldtab, i, tab);
return false;
});
the_oldtab.on('keydown', function(objEvent){
if(objEvent.keyCode===13){
the_oldtab.trigger('click');
}});
}});
set_size();
trigger_default_open(false);
win.on("debouncedresize", set_size);
$('a').on('click',function(){
var hash=$(this).attr('href');
if(typeof hash!="undefined"&&hash){
hash=hash.replace(/^.*?#/,'');
trigger_default_open('#'+hash);
}});
function set_size(){
if(! options.sidebar){
return;
}
content.css({'min-height': tab_titles.outerHeight() + 1});
}
function open_content(tab, i, alternate_tab){
if(!tab.is('.'+options.active)){
$('.'+options.active, container).removeClass(options.active);
$('.'+options.active+'_content', container).attr('aria-hidden', true).removeClass(options.active+'_content');
tab.addClass(options.active);
var new_loc=tab.data('fake-id');
if(typeof new_loc=='string'){
window.location.replace(new_loc);
}
if(alternate_tab){
alternate_tab.addClass(options.active);
}
var active_c=content.eq(i).addClass(options.active+'_content').attr('aria-hidden', false);
if(typeof click_container!='undefined'&&click_container.length){
sidebar_shadow.height(active_c.outerHeight());
}
var el_offset=active_c.offset().top,
scoll_target=el_offset - 50 - parseInt($('html').css('margin-top'),10);
if(win.scrollTop() > el_offset){
$('html:not(:animated),body:not(:animated)').scrollTop(scoll_target);
}}
win.trigger('av-content-el-height-changed', tab);
}
function trigger_default_open(hash){
if(! hash&&window.location.hash){
hash=window.location.hash;
}
if(! hash){
return;
}
var open=tabs.filter('[data-fake-id="'+hash+'"]');
if(open.length){
if(! open.is('.active_tab')){
open.trigger('click');
}
window.scrollTo(0, container.offset().top - 70);
}}
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_testimonial=function(options){
return this.each(function(){
var container=$(this),
elements=container.find('.avia-testimonial');
container.on('avia_start_animation', function(){
elements.each(function(i){
var element=$(this);
setTimeout(function(){ element.addClass('avia_start_animation'); }, (i * 150));
});
});
});
};}(jQuery));
(function($){
"use strict";
$(window).on('load', function (e){
if($.AviaSlider){
$('.avia-timeline-container').avia_sc_timeline();
}});
$.fn.avia_sc_timeline=function (options){
return this.each(function (){
var container=this,
timeline_id='#' + $(this).attr('id'),
timeline=$(timeline_id),
methods;
methods =
{
matchHeights: function(){
this.setMinHeight($(timeline_id + ' .av-milestone-placement-top .av-milestone-date'), true);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-bottom .av-milestone-content-wrap'), true);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-bottom.avia-timeline-boxshadow .av-milestone-contentbox'), false);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-top.avia-timeline-boxshadow .av-milestone-contentbox'), false);
this.setMinHeight($(timeline_id + ' .avia-timeline-horizontal.av-milestone-placement-alternate li >:first-child'), true);
},
setMinHeight: function(els, setNav){
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);
if(setNav){
var $firstElement=els.first(),
$parent=$firstElement.closest('.avia-timeline-container'),
$pos=$firstElement.height();
$parent.find('.av-timeline-nav').css('top',$pos);
}},
createCarousel:function(e){
var self=this,
slider=$(timeline_id + '.avia-slideshow-carousel'),
slides_num=3,
slides_num_small=1;
if(timeline.attr('avia-data-slides')){
slides_num=parseInt(timeline.attr('avia-data-slides'));
}
if(slides_num >=2){
slides_num_small=2;
}
var sliderOptions={
carousel:'yes',
keep_pading:true,
carouselSlidesToShow:slides_num,
carouselSlidesToScroll:3,
carouselResponsive:[
{
breakpoint: 989,
settings: {
carouselSlidesToShow: slides_num_small,
carouselSlidesToScroll: slides_num_small
}},
{
breakpoint: 767,
settings: {
carouselSlidesToShow: 1,
carouselSlidesToScroll: 1
}}
]
};
slider.aviaSlider(sliderOptions);
slider.on('_kickOff',function(){
self.matchHeights();
});
$(window).on('resize', function(){
self.matchHeights();
});
},
layoutHelpers:function(e){
$(timeline_id + ' .avia-timeline-vertical li').each(function(index, element){
var $length=$(this).parents('ul').find('li').length;
var $icon_wrap=$(this).find('.av-milestone-icon-wrap');
var $icon_wrap_height=$icon_wrap.outerHeight(true);
var $icon_wrap_height_half=parseInt($icon_wrap_height / 2);
if(index===($length - 1)){
$icon_wrap.css({
'height': $icon_wrap_height_half
});
}else{
$icon_wrap.css({
'height': $icon_wrap_height
});
}});
},
fireAnimations:function(e){
if($(timeline_id + ' > ul').hasClass('avia-timeline-vertical')){
var milestone=timeline.find('.av-milestone');
timeline.on('avia_start_animation', function(){
milestone.each(function(i){
var element=$(this);
setTimeout(function(){ element.addClass('avia_start_animation'); },(i * 350));
});
});
}}
};
methods.createCarousel();
methods.layoutHelpers();
methods.fireAnimations();
methods.matchHeights();
});
};})(jQuery);
(function($){
"use strict";
$.fn.avia_sc_toggle=function(options){
var defaults =
{
single: '.single_toggle',
heading: '.toggler',
content: '.toggle_wrap',
sortContainer:'.taglist'
};
var win=$(window),
options=$.extend(defaults, options);
return this.each(function(){
var container=$(this).addClass('enable_toggles'),
toggles=$(options.single, container),
heading=$(options.heading, container),
allContent=$(options.content, container),
sortLinks=$(options.sortContainer + " a", container),
preview=$('#av-admin-preview');
var activeStyle='',
headingStyle='';
heading.each(function(i){
var thisheading=$(this),
content=thisheading.next(options.content, container);
function scroll_to_viewport(){
var el_offset=content.offset().top,
scoll_target=el_offset - 50 - parseInt($('html').css('margin-top'),10);
if(win.scrollTop() > el_offset){
$('html:not(:animated),body:not(:animated)').animate({scrollTop: scoll_target},200);
}}
if(content.css('visibility')!="hidden"){
thisheading.addClass('activeTitle').attr('style',activeStyle);
}
thisheading.on('keydown', function(objEvent){
if(objEvent.keyCode===13){
thisheading.trigger('click');
}});
thisheading.on('click', function(){
if(content.css('visibility')!="hidden"){
content.slideUp(200, function(){
content.removeClass('active_tc').attr({style:''});
win.trigger('av-height-change');
win.trigger('av-content-el-height-changed', this);
if(preview.length==0){
location.replace(thisheading.data('fake-id') + "-closed");
}});
thisheading.removeClass('activeTitle').attr('style',headingStyle);
}else{
if(container.is('.toggle_close_all')){
allContent.not(content).slideUp(200, function(){
$(this).removeClass('active_tc').attr({style:''});
scroll_to_viewport();
});
heading.removeClass('activeTitle').attr('style',headingStyle);
}
content.addClass('active_tc');
setTimeout(function(){
content.slideDown(200, function(){
if(!container.is('.toggle_close_all')){
scroll_to_viewport();
}
win.trigger('av-height-change');
win.trigger('av-content-el-height-changed', this);
});
}, 1);
thisheading.addClass('activeTitle').attr('style',activeStyle);
if(preview.length==0){
location.replace(thisheading.data('fake-id'));
}}
});
});
sortLinks.on('click', function(e){
e.preventDefault();
var show=toggles.filter('[data-tags~="'+$(this).data('tag')+'"]'),
hide=toggles.not('[data-tags~="'+$(this).data('tag')+'"]');
sortLinks.removeClass('activeFilter');
$(this).addClass('activeFilter');
heading.filter('.activeTitle').trigger('click');
show.slideDown();
hide.slideUp();
});
function trigger_default_open(hash){
if(! hash&&window.location.hash){
hash=window.location.hash;
}
if(! hash){
return;
}
var open=heading.filter('[data-fake-id="'+hash+'"]');
if(open.length){
if(!open.is('.activeTitle')){
open.trigger('click');
}
window.scrollTo(0, container.offset().top - 70);
}}
trigger_default_open(false);
$('a').on('click', function(){
var hash=$(this).attr('href');
if(typeof hash!="undefined"&&hash){
hash=hash.replace(/^.*?#/,'');
trigger_default_open('#'+hash);
}});
});
};}(jQuery));
(function($){
"use strict";
$('body').on('click','.av-lazyload-video-embed .av-click-to-play-overlay', function(e){
var clicked=$(this);
var cookie_check=$('html').hasClass('av-cookies-needs-opt-in')||$('html').hasClass('av-cookies-can-opt-out');
var allow_continue=true;
var silent_accept_cookie=$('html').hasClass('av-cookies-user-silent-accept');
if(cookie_check&&! silent_accept_cookie){
if(! document.cookie.match(/aviaCookieConsent/)||$('html').hasClass('av-cookies-session-refused')){
allow_continue=false;
}else{
if(! document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){
allow_continue=false;
}
else if(! document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){
allow_continue=false;
}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){
allow_continue=false;
}}
}
var container=clicked.parents('.av-lazyload-video-embed');
if(container.hasClass('avia-video-lightbox')&&container.hasClass('avia-video-standard-html')){
allow_continue=true;
}
if(! allow_continue){
if(typeof e.originalEvent=='undefined'){ return; }
var src_url=container.data('original_url');
if(src_url) window.open(src_url , '_blank', 'noreferrer noopener');
return;
}
var video=container.find('.av-video-tmpl').html();
var link='';
if(container.hasClass('avia-video-lightbox')){
link=container.find('a.lightbox-link');
if(link.length==0){
container.append(video);
setTimeout(function(){
link=container.find('a.lightbox-link');
if($('html').hasClass('av-default-lightbox')){
link.addClass('lightbox-added').magnificPopup($.avia_utilities.av_popup);
link.trigger('click');
}else{
link.trigger('avia-open-video-in-lightbox');
}}, 100);
}else{
link.trigger('click');
}}else{
container.html(video);
}});
$('.av-lazyload-immediate .av-click-to-play-overlay').trigger('click');
}(jQuery));
(function($){
"use strict";
$(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;
}
avia_hamburger_menu();
$(window).trigger('resize');
});
$.avia_utilities=$.avia_utilities||{};
function avia_hamburger_menu(){
var header=$('#header'),
header_main=$('#main .av-logo-container'),
menu=$('#avia-menu'),
burger_wrap=$('.av-burger-menu-main a'),
htmlEL=$('html').eq(0),
overlay=$(''),
overlay_scroll=$('').appendTo(overlay),
inner_overlay=$('').appendTo(overlay_scroll),
bgColor=$('').appendTo(overlay),
animating=false,
first_level={},
logo_container=$('.av-logo-container .inner-container'),
menu_in_logo_container=logo_container.find('.main_menu'),
cloneFirst=htmlEL.is('.html_av-submenu-display-click.html_av-submenu-clone, .html_av-submenu-display-hover.html_av-submenu-clone'),
menu_generated=false,
cloned_menu_cnt=0;
var alternate=$('#avia_alternate_menu');
if(alternate.length > 0){
menu=alternate;
}
var set_list_container_height=function(){
if($.avia_utilities.isMobile){
overlay_scroll.outerHeight(window.innerHeight);
}},
create_list=function(items , append_to){
if(!items) return;
var list, link, current, subitems, megacolumns, sub_current, sub_current_list, new_li, new_ul;
items.each(function(){
current=$(this);
subitems=current.find(' > .sub-menu > li');
if(subitems.length==0){
subitems=current.find(' > .children > li');
}
megacolumns=current.find('.avia_mega_div > .sub-menu > li.menu-item');
var cur_menu=current.find('>a');
var clone_events=true;
if(cur_menu.length){
if(cur_menu.get(0).hash=='#'||'undefined'==typeof cur_menu.attr('href')||cur_menu.attr('href')=='#'){
if(subitems.length > 0||megacolumns.length > 0){
clone_events=false;
}}
}
link=cur_menu.clone(clone_events).attr('style','');
if('undefined'==typeof cur_menu.attr('href')){
link.attr('href', '#');
}
new_li=$('').append(link);
var cls=[];
if('undefined'!=typeof current.attr('class')){
cls=current.attr('class').split(/\s+/);
$.each(cls, function(index, value){
if(( value.indexOf('menu-item')!=0)&&(value.indexOf('page-item') < 0)&&(value.indexOf('page_item')!=0)&&(value.indexOf('dropdown_ul') < 0)){
new_li.addClass(value);
}
return true;
});
}
if('undefined'!=typeof current.attr('id')&&''!=current.attr('id')){
new_li.addClass(current.attr('id'));
}else{
$.each(cls, function(index, value){
if(value.indexOf('page-item-') >=0){
new_li.addClass(value);
return false;
}});
}
append_to.append(new_li);
if(subitems.length){
new_ul=$('