").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);
$.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.filter(':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.filter(':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);
}});
}
$.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();
},
_autoplay: function(){
var _self=this;
_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)
},
_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);
}});
}
$.fn.avia_waypoints=function(options_passed){
if(! $('html').is('.avia_transform')) return;
var defaults={ offset: 'bottom-in-view' , triggerOnce: true},
options=$.extend({}, defaults, options_passed),
isMobile=$.avia_utilities.isMobile;
return this.each(function(){
var element=$(this);
setTimeout(function(){
if(isMobile){
element.addClass('avia_start_animation').trigger('avia_start_animation');
}else{
element.waypoint(function(direction){
var current=$(this.element),
parent=current.parents('.av-animation-delay-container:eq(0)');
if(parent.length){
current.addClass('avia_start_animation_when_active').trigger('avia_start_animation_when_active');
}
if(!parent.length||(parent.length&&parent.is('.__av_init_open'))){
current.addClass('avia_start_animation').trigger('avia_start_animation');
}}, options);
}},100)
});
};
var $event=$.event, $special, resizeTimeout;
$special=$event.special.debouncedresize={
setup: function(){
$(this).on("resize", $special.handler);
},
teardown: function(){
$(this).off("resize", $special.handler);
},
handler: function(event, execAsap){
var context=this,
args=arguments,
dispatch=function(){
event.type="debouncedresize";
$event.dispatch.apply(context, args);
};
if(resizeTimeout){
clearTimeout(resizeTimeout);
}
execAsap ?
dispatch() :
resizeTimeout=setTimeout(dispatch, $special.threshold);
},
threshold: 150
};
$.easing['jswing']=$.easing['swing'];
$.extend($.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d){ return $.easing[$.easing.def](x, t, b, c, d); },
easeInQuad: function (x, t, b, c, d){ return c*(t/=d)*t + b; },
easeOutQuad: function (x, t, b, c, d){ return -c *(t/=d)*(t-2) + b; },
easeInOutQuad: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; },
easeInCubic: function (x, t, b, c, d){ return c*(t/=d)*t*t + b; },
easeOutCubic: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t + 1) + b; },
easeInOutCubic: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; },
easeInQuart: function (x, t, b, c, d){ return c*(t/=d)*t*t*t + b; },
easeOutQuart: function (x, t, b, c, d){ return -c * ((t=t/d-1)*t*t*t - 1) + b; },
easeInOutQuart: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; },
easeInQuint: function (x, t, b, c, d){ return c*(t/=d)*t*t*t*t + b; },
easeOutQuint: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t*t*t + 1) + b; },
easeInOutQuint: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; },
easeInSine: function (x, t, b, c, d){ return -c * Math.cos(t/d * (Math.PI/2)) + c + b; },
easeOutSine: function (x, t, b, c, d){ return c * Math.sin(t/d * (Math.PI/2)) + b; },
easeInOutSine: function (x, t, b, c, d){ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; },
easeInExpo: function (x, t, b, c, d){ return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b; },
easeOutExpo: function (x, t, b, c, d){ return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b; },
easeInOutExpo: function (x, t, b, c, d){
if(t==0) return b;
if(t==d) return b+c;
if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d){ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; },
easeOutCirc: function (x, t, b, c, d){return c * Math.sqrt(1 - (t=t/d-1)*t) + b; },
easeInOutCirc: function (x, t, b, c, d){ if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; },
easeInElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
},
easeOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b;
},
easeInOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5);
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d){
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d){
if((t/=d) < (1/2.75)){
return c*(7.5625*t*t) + b;
}else if(t < (2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
}else if(t < (2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}},
easeInOutBounce: function (x, t, b, c, d){
if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}});
})(jQuery);
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$.avia_utilities.loading=function(attach_to, delay){
var loader={
active: false,
show: function(){
if(loader.active===false){
loader.active=true;
loader.loading_item.css({display:'block', opacity:0});
}
loader.loading_item.stop().animate({opacity:1});
},
hide: function(){
if(typeof delay==='undefined'){ delay=600; }
loader.loading_item.stop().delay(delay).animate({opacity:0}, function(){
loader.loading_item.css({display:'none'});
loader.active=false;
});
},
attach: function(){
if(typeof attach_to==='undefined'){ attach_to='body';}
loader.loading_item=$('
').css({display:"none"}).appendTo(attach_to);
}}
loader.attach();
return loader;
};
$.avia_utilities.playpause=function(attach_to, delay){
var pp={
active: false,
to1: "",
to2: "",
set: function(status){
pp.loading_item.removeClass('av-play av-pause');
pp.to1=setTimeout(function(){ pp.loading_item.addClass('av-' + status); },10);
pp.to2=setTimeout(function(){ pp.loading_item.removeClass('av-' + status); },1500);
},
attach: function(){
if(typeof attach_to==='undefined'){ attach_to='body';}
pp.loading_item=$('
').css({display:"none"}).appendTo(attach_to);
}}
pp.attach();
return pp;
};
$.avia_utilities.preload=function(options_passed){
new $.AviaPreloader(options_passed);
}
$.AviaPreloader=function(options){
this.win=$(window);
this.defaults =
{
container: 'body',
maxLoops: 10,
trigger_single: true,
single_callback: function(){},
global_callback: function(){}};
this.options=$.extend({}, this.defaults, options);
this.preload_images=0;
this.load_images();
}
$.AviaPreloader.prototype =
{
load_images: function(){
var _self=this;
if(typeof _self.options.container==='string'){ _self.options.container=$(_self.options.container); }
_self.options.container.each(function(){
var container=$(this);
container.images=container.find('img');
container.allImages=container.images;
_self.preload_images +=container.images.length;
setTimeout(function(){ _self.checkImage(container); }, 10);
});
},
checkImage: function(container){
var _self=this;
container.images.each(function(){
if(this.complete===true){
container.images=container.images.not(this);
_self.preload_images -=1;
}});
if(container.images.length&&_self.options.maxLoops >=0){
_self.options.maxLoops-=1;
setTimeout(function(){ _self.checkImage(container); }, 500);
}else{
_self.preload_images=_self.preload_images - container.images.length;
_self.trigger_loaded(container);
}},
trigger_loaded: function(container){
var _self=this;
if(_self.options.trigger_single!==false){
_self.win.trigger('avia_images_loaded_single', [container]);
_self.options.single_callback.call(container);
}
if(_self.preload_images===0){
_self.win.trigger('avia_images_loaded');
_self.options.global_callback.call();
}}
}
$.avia_utilities.css_easings={
linear: 'linear',
swing: 'ease-in-out',
bounce: 'cubic-bezier(0.0, 0.35, .5, 1.3)',
easeInQuad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)' ,
easeInCubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)' ,
easeInQuart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)' ,
easeInQuint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)' ,
easeInSine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)' ,
easeInExpo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)' ,
easeInCirc: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)' ,
easeInBack: 'cubic-bezier(0.600, -0.280, 0.735, 0.04)' ,
easeOutQuad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)' ,
easeOutCubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)' ,
easeOutQuart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)' ,
easeOutQuint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)' ,
easeOutSine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)' ,
easeOutExpo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)' ,
easeOutCirc: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)' ,
easeOutBack: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)' ,
easeInOutQuad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)' ,
easeInOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)' ,
easeInOutQuart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)' ,
easeInOutQuint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)' ,
easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)' ,
easeInOutExpo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)' ,
easeInOutCirc: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)' ,
easeInOutBack: 'cubic-bezier(0.680, -0.550, 0.265, 1.55)' ,
easeInOutBounce:'cubic-bezier(0.580, -0.365, 0.490, 1.365)',
easeOutBounce: 'cubic-bezier(0.760, 0.085, 0.490, 1.365)'
};
$.avia_utilities.supported={};
$.avia_utilities.supports=(function(){
var div=document.createElement('div'),
vendors=['Khtml', 'Ms','Moz','Webkit'];
return function(prop, vendor_overwrite){
if(div.style[prop]!==undefined){ return ""; }
if(vendor_overwrite!==undefined){ vendors=vendor_overwrite; }
prop=prop.replace(/^[a-z]/, function(val){
return val.toUpperCase();
});
var len=vendors.length;
while(len--){
if(div.style[vendors[len] + prop]!==undefined){
return "-" + vendors[len].toLowerCase() + "-";
}}
return false;
};}());
$.fn.avia_animate=function(prop, speed, easing, callback){
if(typeof speed==='function'){callback=speed; speed=false; }
if(typeof easing==='function'){callback=easing; easing=false;}
if(typeof speed==='string'){easing=speed; speed=false;}
if(callback===undefined||callback===false){ callback=function(){};}
if(easing===undefined||easing===false){ easing='easeInQuad'; }
if(speed===undefined||speed===false){ speed=400; }
if($.avia_utilities.supported.transition===undefined){
$.avia_utilities.supported.transition=$.avia_utilities.supports('transition');
}
if($.avia_utilities.supported.transition!==false){
var prefix=$.avia_utilities.supported.transition + 'transition',
cssRule={},
cssProp={},
thisStyle=document.body.style,
end=(thisStyle.WebkitTransition!==undefined) ? 'webkitTransitionEnd':(thisStyle.OTransition!==undefined) ? 'oTransitionEnd':'transitionend';
easing=$.avia_utilities.css_easings[easing];
cssRule[prefix]='all '+(speed/1000)+'s '+easing;
end=end + ".avia_animate";
for (var rule in prop){
if(prop.hasOwnProperty(rule)){ cssProp[rule]=prop[rule]; }}
prop=cssProp;
this.each(function(){
var element=$(this), css_difference=false, rule, current_css;
for (rule in prop){
if(prop.hasOwnProperty(rule)){
current_css=element.css(rule);
if(prop[rule]!=current_css&&prop[rule]!=current_css.replace(/px|%/g,"")){
css_difference=true;
break;
}}
}
if(css_difference){
if(!($.avia_utilities.supported.transition+"transform" in prop)){
prop[$.avia_utilities.supported.transition+"transform"]="translateZ(0)";
}
var endTriggered=false;
element.on(end, function(event){
if(event.target!=event.currentTarget) return false;
if(endTriggered==true) return false;
endTriggered=true;
cssRule[prefix]="none";
element.off(end);
element.css(cssRule);
setTimeout(function(){ callback.call(element); });
});
setTimeout(function(){
if(!endTriggered&&!avia_is_mobile&&$('html').is('.avia-safari')){
element.trigger(end);
$.avia_utilities.log('Safari Fallback '+end+' trigger');
}}, speed + 100);
setTimeout(function(){ element.css(cssRule);},10);
setTimeout(function(){ element.css(prop); },20);
}else{
setTimeout(function(){ callback.call(element); });
}});
}else{
this.animate(prop, speed, easing, callback);
}
return this;
};})(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
};
$.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.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;
this.video=false;
if(this.options.bg_slider==true){
this.imageUrls=[];
this.loader=$.avia_utilities.loading(this.$slider);
this._bgPreloadImages();
}else{
this._kickOff();
}},
_setOptions: function(options){
var newOptions=$.extend(true, {}, $.AviaSlider.defaults, options),
htmlData=this.$slider.data(),
i="";
for (i in htmlData){
if(htmlData.hasOwnProperty(i)){
if(typeof htmlData[i]==="string"||typeof htmlData[i]==="number"||typeof htmlData[i]==="boolean"){
newOptions[i]=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');
current.find('.av-click-overlay, .mejs-mediaelement, .mejs-container').remove();
if(!fallback){
var appendTo=current.find('.avia-slide-wrap');
$('
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);
}else{
var image=$('
');
current.find('.avia-slide-wrap').append(image);
}});
}},
_bgPreloadImages:function(callback){
this._getImageURLS();
this._preloadSingle(0, function(){
this._kickOff();
this._preloadNext(1);
});
},
_getImageURLS: function(){
var _self=this;
this.$slides.each(function(i){
_self.imageUrls[i]=[];
_self.imageUrls[i]['url']=$(this).data("img-url");
if(typeof _self.imageUrls[i]['url']=='string'){
_self.imageUrls[i]['status']=false;
}else{
_self.imageUrls[i]['status']=true;
}});
},
_preloadSingle: function(key, callback){
var _self=this,
objImage=new Image();
if(typeof _self.imageUrls[key]['url']=='string'){
$(objImage).bind('load error', function(){
_self.imageUrls[key]['status']=true;
_self.$slides.eq(key).css('background-image','url(' + _self.imageUrls[key]['url'] + ')');
if(typeof callback=='function') callback.apply(_self, [objImage, key]);
});
if(_self.imageUrls[key]['url']!=""){
objImage.src=_self.imageUrls[key]['url'];
}else{
$(objImage).trigger('error');
}}else{
if(typeof callback=='function') callback.apply(_self, [objImage, key]);
}},
_preloadNext: function(key){
if(typeof this.imageUrls[key]!="undefined"){
this._preloadSingle(key, function(){
this._preloadNext(key + 1);
});
}},
_bindEvents: function(){
var self=this,
win=$(window);
this.$slider.on('click','.next-slide', $.proxy(this.next, this));
this.$slider.on('click','.prev-slide', $.proxy(this.previous, this));
this.$slider.on('click','.goto-slide', $.proxy(this.go2, this));
if(this.options.hoverpause){
this.$slider.on('mouseenter', $.proxy(this.pause, this));
this.$slider.on('mouseleave', $.proxy(this.resume, this));
}
if(this.options.stopinfiniteloop&&this.options.autoplay){
if(this.options.stopinfiniteloop=='last'){
this.$slider.on('avia_slider_last_slide', $.proxy(this._stopSlideshow, this));
}
else if(this.options.stopinfiniteloop=='first'){
this.$slider.on('avia_slider_first_slide', $.proxy(this._stopSlideshow, this));
}}
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();
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();
}},
_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');
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});
},
_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')) 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')) displaySlide.trigger('play');
if(self.options.fullfade==true){
hideSlide.avia_animate({opacity:0}, 200, 'linear', function(){
displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed, 'linear',fadeCallback);
});
}else{
displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed/2, 'linear', function(){
hideSlide.avia_animate({opacity:0}, 200, 'linear', fadeCallback);
});
}},
_attach_video_events: function(){
var self=this, $html=$('html');
self.$slides.each(function(i){
var currentSlide=$(this),
caption=currentSlide.find('.caption_fullwidth, .av-click-overlay'),
mejs=currentSlide.find('.mejs-mediaelement');
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 }, 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');
}});
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');
}}
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";
$.fn.avia_keyboard_controls=function(options_passed){
var defaults =
{
37: '.prev-slide',
39: '.next-slide'
},
methods={
mousebind: function(slider){
slider.hover(function(){ slider.mouseover=true; },
function(){ slider.mouseover=false; }
);
},
keybind: function(slider){
$(document).keydown(function(e){
if(slider.mouseover&&typeof slider.options[e.keyCode]!=='undefined'){
var item;
if(typeof slider.options[e.keyCode]==='string'){
item=slider.find(slider.options[e.keyCode]);
}else{
item=slider.options[e.keyCode];
}
if(item.length){
item.trigger('click', ['keypress']);
return false;
}}
});
}};
return this.each(function(){
var slider=$(this);
slider.options=$.extend({}, defaults, options_passed);
slider.mouseover=false;
methods.mousebind(slider);
methods.keybind(slider);
});
};
$.fn.avia_swipe_trigger=function(passed_options){
var win=$(window),
isMobile=$.avia_utilities.isMobile,
defaults =
{
prev: '.prev-slide',
next: '.next-slide',
event: {
prev: 'click',
next: 'click'
}},
methods={
activate_touch_control: function(slider){
var i, differenceX, differenceY;
slider.touchPos={};
slider.hasMoved=false;
slider.on('touchstart', function(event){
slider.touchPos.X=event.originalEvent.touches[0].clientX;
slider.touchPos.Y=event.originalEvent.touches[0].clientY;
});
slider.on('touchend', function(event){
slider.touchPos={};
if(slider.hasMoved){ event.preventDefault(); }
slider.hasMoved=false;
});
slider.on('touchmove', function(event){
if(!slider.touchPos.X){
slider.touchPos.X=event.originalEvent.touches[0].clientX;
slider.touchPos.Y=event.originalEvent.touches[0].clientY;
}else{
differenceX=event.originalEvent.touches[0].clientX - slider.touchPos.X;
differenceY=event.originalEvent.touches[0].clientY - slider.touchPos.Y;
if(Math.abs(differenceX) > Math.abs(differenceY)){
event.preventDefault();
if(slider.touchPos!==event.originalEvent.touches[0].clientX){
if(Math.abs(differenceX) > 50){
i=differenceX > 0 ? 'prev':'next';
if(typeof slider.options[i]==='string'){
slider.find(slider.options[i]).trigger(slider.options.event[i], ['swipe']);
}else{
slider.options[i].trigger(slider.options.event[i], ['swipe']);
}
slider.hasMoved=true;
slider.touchPos={};
return false;
}}
}}
});
}};
return this.each(function(){
if(isMobile){
var slider=$(this);
slider.options=$.extend({}, defaults, passed_options);
methods.activate_touch_control(slider);
}});
};}(jQuery));
(function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;r.length>a;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith('
'):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'
',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("
");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'
',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('
').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto);
!function(a,b){function c(){function a(){"undefined"!=typeof _wpmejsSettings&&(c=b.extend(!0,{},_wpmejsSettings)),c.classPrefix="mejs-",c.success=c.success||function(a){var b,c;a.rendererName&&-1!==a.rendererName.indexOf("flash")&&(b=a.attributes.autoplay&&"false"!==a.attributes.autoplay,c=a.attributes.loop&&"false"!==a.attributes.loop,b&&a.addEventListener("canplay",function(){a.play()},!1),c&&a.addEventListener("ended",function(){a.play()},!1))},c.customError=function(a,b){if(-1!==a.rendererName.indexOf("flash")||-1!==a.rendererName.indexOf("flv"))return'
'+mejsL10n.strings["mejs.download-video"]+""},b(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!b(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(c)}var c={};return{initialize:a}}a.wp=a.wp||{},a.wp.mediaelement=new c,b(a.wp.mediaelement.initialize)}(window,jQuery);
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.draggable",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(a,b){this._super(a,b),"handle"===a&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(b){var c=this.options;return this._blurActiveElement(b),!(this.helper||c.disabled||a(b.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(b),!!this.handle&&(this._blockFrames(c.iframeFix===!0?"iframe":c.iframeFix),!0))},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var b=a(this);return a("
").css("position","absolute").appendTo(b.parent()).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).offset(b.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(b){var c=this.document[0];if(this.handleElement.is(b.target))try{c.activeElement&&"body"!==c.activeElement.nodeName.toLowerCase()&&a(c.activeElement).blur()}catch(d){}},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===a(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(b),this.originalPosition=this.position=this._generatePosition(b,!1),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._normalizeRightBottom(),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(b,c){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(b,!0),this.positionAbs=this._convertPositionTo("absolute"),!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=this,d=!1;return a.ui.ddmanager&&!this.options.dropBehaviour&&(d=a.ui.ddmanager.drop(this,b)),this.dropped&&(d=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!d||"valid"===this.options.revert&&d||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)?a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",b)!==!1&&c._clear()}):this._trigger("stop",b)!==!1&&this._clear(),!1},_mouseUp:function(b){return this._unblockFrames(),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),this.handleElement.is(b.target)&&this.element.focus(),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){return!this.options.handle||!!a(b.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper),e=d?a(c.helper.apply(this.element[0],[b])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return e.parents("body").length||e.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),d&&e[0]===this.element[0]&&this._setPositionRelative(),e[0]===this.element[0]||/(fixed|absolute)/.test(e.css("position"))||e.css("position","absolute"),e},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var b=this.offsetParent.offset(),c=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==c&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:a.left-(parseInt(this.helper.css("left"),10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,c,d,e=this.options,f=this.document[0];return this.relativeContainer=null,e.containment?"window"===e.containment?void(this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===e.containment?void(this.containment=[0,0,a(f).width()-this.helperProportions.width-this.margins.left,(a(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):e.containment.constructor===Array?void(this.containment=e.containment):("parent"===e.containment&&(e.containment=this.helper[0].parentNode),c=a(e.containment),d=c[0],void(d&&(b=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(b?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(a,b){b||(b=this.position);var c="absolute"===a?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:b.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*c,left:b.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*c}},_generatePosition:function(a,b){var c,d,e,f,g=this.options,h=this._isRootNode(this.scrollParent[0]),i=a.pageX,j=a.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),b&&(this.containment&&(this.relativeContainer?(d=this.relativeContainer.offset(),c=[this.containment[0]+d.left,this.containment[1]+d.top,this.containment[2]+d.left,this.containment[3]+d.top]):c=this.containment,a.pageX-this.offset.click.leftc[2]&&(i=c[2]+this.offset.click.left),a.pageY-this.offset.click.top>c[3]&&(j=c[3]+this.offset.click.top)),g.grid&&(e=g.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY,j=c?e-this.offset.click.top>=c[1]||e-this.offset.click.top>c[3]?e:e-this.offset.click.top>=c[1]?e-g.grid[1]:e+g.grid[1]:e,f=g.grid[0]?this.originalPageX+Math.round((i-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX,i=c?f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2]?f:f-this.offset.click.left>=c[0]?f-g.grid[0]:f+g.grid[0]:f),"y"===g.axis&&(i=this.originalPageX),"x"===g.axis&&(j=this.originalPageY)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d,this],!0),/^(drag|start|stop)/.test(b)&&(this.positionAbs=this._convertPositionTo("absolute"),d.offset=this.positionAbs),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c,d){var e=a.extend({},c,{item:d.element});d.sortables=[],a(d.options.connectToSortable).each(function(){var c=a(this).sortable("instance");c&&!c.options.disabled&&(d.sortables.push(c),c.refreshPositions(),c._trigger("activate",b,e))})},stop:function(b,c,d){var e=a.extend({},c,{item:d.element});d.cancelHelperRemoval=!1,a.each(d.sortables,function(){var a=this;a.isOver?(a.isOver=0,d.cancelHelperRemoval=!0,a.cancelHelperRemoval=!1,a._storedCSS={position:a.placeholder.css("position"),top:a.placeholder.css("top"),left:a.placeholder.css("left")},a._mouseStop(b),a.options.helper=a.options._helper):(a.cancelHelperRemoval=!0,a._trigger("deactivate",b,e))})},drag:function(b,c,d){a.each(d.sortables,function(){var e=!1,f=this;f.positionAbs=d.positionAbs,f.helperProportions=d.helperProportions,f.offset.click=d.offset.click,f._intersectsWith(f.containerCache)&&(e=!0,a.each(d.sortables,function(){return this.positionAbs=d.positionAbs,this.helperProportions=d.helperProportions,this.offset.click=d.offset.click,this!==f&&this._intersectsWith(this.containerCache)&&a.contains(f.element[0],this.element[0])&&(e=!1),e})),e?(f.isOver||(f.isOver=1,d._parent=c.helper.parent(),f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return c.helper[0]},b.target=f.currentItem[0],f._mouseCapture(b,!0),f._mouseStart(b,!0,!0),f.offset.click.top=d.offset.click.top,f.offset.click.left=d.offset.click.left,f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top,d._trigger("toSortable",b),d.dropped=f.element,a.each(d.sortables,function(){this.refreshPositions()}),d.currentItem=d.element,f.fromOutside=d),f.currentItem&&(f._mouseDrag(b),c.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,f.options.revert=!1,f._trigger("out",b,f._uiHash(f)),f._mouseStop(b,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),c.helper.appendTo(d._parent),d._refreshOffsets(b),c.position=d._generatePosition(b,!0),d._trigger("fromSortable",b),d.dropped=!1,a.each(d.sortables,function(){this.refreshPositions()}))})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c,d){var e=a("body"),f=d.options;e.css("cursor")&&(f._cursor=e.css("cursor")),e.css("cursor",f.cursor)},stop:function(b,c,d){var e=d.options;e._cursor&&a("body").css("cursor",e._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("opacity")&&(f._opacity=e.css("opacity")),e.css("opacity",f.opacity)},stop:function(b,c,d){var e=d.options;e._opacity&&a(c.helper).css("opacity",e._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(a,b,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1)),c.scrollParentNotHidden[0]!==c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(b,c,d){var e=d.options,f=!1,g=d.scrollParentNotHidden[0],h=d.document[0];g!==h&&"HTML"!==g.tagName?(e.axis&&"x"===e.axis||(d.overflowOffset.top+g.offsetHeight-b.pageY=0;m--)i=d.snapElements[m].left-d.margins.left,j=i+d.snapElements[m].width,k=d.snapElements[m].top-d.margins.top,l=k+d.snapElements[m].height,rj+p||tl+p||!a.contains(d.snapElements[m].item.ownerDocument,d.snapElements[m].item)?(d.snapElements[m].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=!1):("inner"!==o.snapMode&&(e=Math.abs(k-t)<=p,f=Math.abs(l-s)<=p,g=Math.abs(i-r)<=p,h=Math.abs(j-q)<=p,e&&(c.position.top=d._convertPositionTo("relative",{top:k-d.helperProportions.height,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i-d.helperProportions.width}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j}).left)),n=e||f||g||h,"outer"!==o.snapMode&&(e=Math.abs(k-s)<=p,f=Math.abs(l-t)<=p,g=Math.abs(i-q)<=p,h=Math.abs(j-r)<=p,e&&(c.position.top=d._convertPositionTo("relative",{top:k,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l-d.helperProportions.height,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left)),!d.snapElements[m].snapping&&(e||f||g||h||n)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=e||f||g||h||n)}}),a.ui.plugin.add("draggable","stack",{start:function(b,c,d){var e,f=d.options,g=a.makeArray(a(f.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});g.length&&(e=parseInt(a(g[0]).css("zIndex"),10)||0,a(g).each(function(b){a(this).css("zIndex",e+b)}),this.css("zIndex",e+g.length))}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("zIndex")&&(f._zIndex=e.css("zIndex")),e.css("zIndex",f.zIndex)},stop:function(b,c,d){var e=d.options;e._zIndex&&a(c.helper).css("zIndex",e._zIndex)}}),a.ui.draggable});
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.slider",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var b,c,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=[];for(c=d.values&&d.values.length||1,e.length>c&&(e.slice(c).remove(),e=e.slice(0,c)),b=e.length;b
").appendTo(this.element),c="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(c+("min"===b.range||"max"===b.range?" ui-slider-range-"+b.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(b){var c,d,e,f,g,h,i,j,k=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),c={x:b.pageX,y:b.pageY},d=this._normValueFromMouse(c),e=this._valueMax()-this._valueMin()+1,this.handles.each(function(b){var c=Math.abs(d-k.values(b));(e>c||e===c&&(b===k._lastChangedValue||k.values(b)===l.min))&&(e=c,f=a(this),g=b)}),h=this._start(b,g),h!==!1&&(this._mouseSliding=!0,this._handleIndex=g,f.addClass("ui-state-active").focus(),i=f.offset(),j=!a(b.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=j?{left:0,top:0}:{left:b.pageX-i.left-f.width()/2,top:b.pageY-i.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,g,d),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return"horizontal"===this.orientation?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),"vertical"===this.orientation&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),2===this.options.values.length&&this.options.range===!0&&(0===b&&c>d||1===b&&c
1)return this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),void this._change(null,b);if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();for(d=this.options.values,e=arguments[0],f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return 2*Math.abs(c)>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_calculateNewMax:function(){var a=this.options.max,b=this._valueMin(),c=this.options.step,d=Math.floor(+(a-b).toFixed(this._precision())/c)*c;a=d+b,this.max=parseFloat(a.toFixed(this._precision()))},_precision:function(){var a=this._precisionOf(this.options.step);return null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min))),a},_precisionOf:function(a){var b=a.toString(),c=b.indexOf(".");return c===-1?0:b.length-c-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var b,c,d,e,f,g=this.options.range,h=this.options,i=this,j=!this._animateOff&&h.animate,k={};this.options.values&&this.options.values.length?this.handles.each(function(d){c=(i.values(d)-i._valueMin())/(i._valueMax()-i._valueMin())*100,k["horizontal"===i.orientation?"left":"bottom"]=c+"%",a(this).stop(1,1)[j?"animate":"css"](k,h.animate),i.options.range===!0&&("horizontal"===i.orientation?(0===d&&i.range.stop(1,1)[j?"animate":"css"]({left:c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({width:c-b+"%"},{queue:!1,duration:h.animate})):(0===d&&i.range.stop(1,1)[j?"animate":"css"]({bottom:c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({height:c-b+"%"},{queue:!1,duration:h.animate}))),b=c}):(d=this.value(),e=this._valueMin(),f=this._valueMax(),c=f!==e?(d-e)/(f-e)*100:0,k["horizontal"===this.orientation?"left":"bottom"]=c+"%",this.handle.stop(1,1)[j?"animate":"css"](k,h.animate),"min"===g&&"horizontal"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({width:c+"%"},h.animate),"max"===g&&"horizontal"===this.orientation&&this.range[j?"animate":"css"]({width:100-c+"%"},{queue:!1,duration:h.animate}),"min"===g&&"vertical"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({height:c+"%"},h.animate),"max"===g&&"vertical"===this.orientation&&this.range[j?"animate":"css"]({height:100-c+"%"},{queue:!1,duration:h.animate}))},_handleEvents:{keydown:function(b){var c,d,e,f,g=a(b.target).data("ui-slider-handle-index");switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(b.preventDefault(),!this._keySliding&&(this._keySliding=!0,a(b.target).addClass("ui-state-active"),c=this._start(b,g),c===!1))return}switch(f=this.options.step,d=e=this.options.values&&this.options.values.length?this.values(g):this.value(),b.keyCode){case a.ui.keyCode.HOME:e=this._valueMin();break;case a.ui.keyCode.END:e=this._valueMax();break;case a.ui.keyCode.PAGE_UP:e=this._trimAlignValue(d+(this._valueMax()-this._valueMin())/this.numPages);break;case a.ui.keyCode.PAGE_DOWN:e=this._trimAlignValue(d-(this._valueMax()-this._valueMin())/this.numPages);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(d===this._valueMax())return;e=this._trimAlignValue(d+f);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(d===this._valueMin())return;e=this._trimAlignValue(d-f)}this._slide(b,g,e)},keyup:function(b){var c=a(b.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(b,c),this._change(b,c),a(b.target).removeClass("ui-state-active"))}}})});
(function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f)}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown")};c._touchMove=function(f){if(!a){return}this._touchMoved=true;d(f,"mousemove")};c._touchEnd=function(f){if(!a){return}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click")}a=false};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f)}})(jQuery);
!function(a,b){function c(){var b,c,d="backgroundImage";j?k="filter":(b=a(''),c="linear-gradient(top,#fff,#000)",a.each(l,function(a,e){if(b.css(d,e+c),b.css(d).match("gradient"))return k=a,!1}),k===!1&&(b.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),b.css(d).match("gradient")&&(k="webkit")),b.remove())}function d(b,c){return b="top"===b?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1),"webkit"===k?f(b,c):l[k]+"linear-gradient("+b+", "+c.join(", ")+")"}function e(b,c){var d,e,f,h,i,j,k,l,m;b="top"===b?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1),d="top"===b?0:1,e=a(this),f=c.length-1,h="filter",i=1===d?"left":"top",j=1===d?"right":"bottom",k=1===d?"height":"width",l='',m="","static"===e.css("position")&&e.css({position:"relative"}),c=g(c),a.each(c,function(a,b){var e,g,h;return a!==f&&(e=c[a+1],void(b.stop!==e.stop&&(g=100-parseFloat(e.stop)+"%",b.octoHex=new Color(b.color).toIEOctoHex(),e.octoHex=new Color(e.color).toIEOctoHex(),h="progid:DXImageTransform.Microsoft.Gradient(GradientType="+d+", StartColorStr='"+b.octoHex+"', EndColorStr='"+e.octoHex+"')",m+=l.replace("%start%",b.stop).replace("%end%",g).replace("%filter%",h))))}),e.find(".iris-ie-gradient-shim").remove(),a(m).prependTo(e)}function f(b,c){var d=[];return b="top"===b?"0% 0%,0% 100%,":"0% 100%,100% 100%,",c=g(c),a.each(c,function(a,b){d.push("color-stop("+parseFloat(b.stop)/100+", "+b.color+")")}),"-webkit-gradient(linear,"+b+d.join(",")+")"}function g(b){var c=[],d=[],e=[],f=b.length-1;return a.each(b,function(a,b){var e=b,f=!1,g=b.match(/1?[0-9]{1,2}%$/);g&&(e=b.replace(/\s?1?[0-9]{1,2}%$/,""),f=g.shift()),c.push(e),d.push(f)}),d[0]===!1&&(d[0]="0%"),d[f]===!1&&(d[f]="100%"),d=h(d),a.each(d,function(a){e[a]={color:c[a],stop:d[a]}}),e}function h(b){var c,d,e,f,g=0,i=b.length-1,j=0,k=!1;if(b.length<=2||a.inArray(!1,b)<0)return b;for(;j'),c=a(''),d=a.isArray(this.options.palettes)?this.options.palettes:this._palettes;this.picker.find(".iris-palette-container").length&&(b=this.picker.find(".iris-palette-container").detach().html("")),a.each(d,function(a,d){c.clone().data("color",d).css("backgroundColor",d).appendTo(b).height(10).width(10)}),this.picker.append(b)},_paint:function(){var a=this;a.horizontalSlider?a._paintDimension("left","strip"):a._paintDimension("top","strip"),a._paintDimension("top","vert"),a._paintDimension("left","horiz")},_paintDimension:function(a,b){var c,d=this,e=d._color,f=d.options.mode,g=d._getHSpaceColor(),h=d.controls[b],i=d.options.controls;if(b!==d.active&&("square"!==d.active||"strip"===b))switch(i[b]){case"h":if("hsv"===f){switch(g=e.clone(),b){case"horiz":g[i.vert](100);break;case"vert":g[i.horiz](100);break;case"strip":g.setHSpace("hsl")}c=g.toHsl()}else c="strip"===b?{s:g.s,l:g.l}:{s:100,l:g.l};h.rainbowGradient(a,c);break;case"s":"hsv"===f?"vert"===b?c=[e.clone().a(0).s(0).toCSS("rgba"),e.clone().a(1).s(0).toCSS("rgba")]:"strip"===b?c=[e.clone().s(100).toCSS("hsl"),e.clone().s(0).toCSS("hsl")]:"horiz"===b&&(c=["#fff","hsl("+g.h+",100%,50%)"]):c="vert"===b&&"h"===d.options.controls.horiz?["hsla(0, 0%, "+g.l+"%, 0)","hsla(0, 0%, "+g.l+"%, 1)"]:["hsl("+g.h+",0%,50%)","hsl("+g.h+",100%,50%)"],h.gradient(a,c);break;case"l":c="strip"===b?["hsl("+g.h+",100%,100%)","hsl("+g.h+", "+g.s+"%,50%)","hsl("+g.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],h.gradient(a,c);break;case"v":c="strip"===b?[e.clone().v(100).toCSS(),e.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],h.gradient(a,c)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_stripOnlyDimensions:function(){var a=this,b=this.options.width,c=.12*b;a.horizontalSlider?a.picker.css({width:b,height:c}).addClass("iris-only-strip iris-strip-horiz"):a.picker.css({width:c,height:b}).addClass("iris-only-strip iris-strip-vert")},_dimensions:function(b){if("hue"===this.options.type)return this._stripOnlyDimensions();var c,d,e,f,g=this,h=g.options,i=g.controls,j=i.square,k=g.picker.find(".iris-strip"),l="77.5%",m="12%",n=20,o=h.border?h.width-n:h.width,p=a.isArray(h.palettes)?h.palettes.length:g._palettes.length;return b&&(j.css("width",""),k.css("width",""),g.picker.css({width:"",height:""})),l=o*(parseFloat(l)/100),m=o*(parseFloat(m)/100),c=h.border?l+n:l,j.width(l).height(l),k.height(l).width(m),g.picker.css({width:h.width,height:c}),h.palettes?(d=2*l/100,f=l-(p-1)*d,e=f/p,g.picker.find(".iris-palette").each(function(b){var c=0===b?0:d;a(this).css({width:e,height:e,marginLeft:c})}),g.picker.css("paddingBottom",e+d),void k.height(e+d+l)):g.picker.css("paddingBottom","")},_addInputListeners:function(a){var b=this,c=100,d=function(c){var d=new Color(a.val()),e=a.val().replace(/^#/,"");a.removeClass("iris-error"),d.error?""!==e&&a.addClass("iris-error"):d.toString()!==b._color.toString()&&("keyup"===c.type&&e.match(/^[0-9a-fA-F]{3}$/)||b._setOption("color",d.toString()))};a.on("change",d).on("keyup",b._debounce(d,c)),b.options.hide&&a.one("focus",function(){b.show()})},_initControls:function(){var b=this,c=b.controls,d=c.square,e=b.options.controls,f=b._scale[e.strip],g=b.horizontalSlider?"horizontal":"vertical";c.stripSlider.slider({orientation:g,max:f,slide:function(a,c){b.active="strip","h"===e.strip&&"vertical"===g&&(c.value=f-c.value),b._color[e.strip](c.value),b._change.apply(b,arguments)}}),c.squareDrag.draggable({containment:c.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(a,c){b._squareDrag(a,c)},start:function(){d.addClass("iris-dragging"),a(this).addClass("ui-state-focus")},stop:function(){d.removeClass("iris-dragging"),a(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(c){var d="ui-state-focus";c.preventDefault(),"mousedown"===c.type?(b.picker.find("."+d).removeClass(d).blur(),a(this).addClass(d).focus()):a(this).removeClass(d)}).on("keydown",function(a){var d=c.square,e=c.squareDrag,f=e.position(),g=b.options.width/100;switch(a.altKey&&(g*=10),a.keyCode){case 37:f.left-=g;break;case 38:f.top-=g;break;case 39:f.left+=g;break;case 40:f.top+=g;break;default:return!0}f.left=Math.max(0,Math.min(f.left,d.width())),f.top=Math.max(0,Math.min(f.top,d.height())),e.css(f),b._squareDrag(a,{position:f}),a.preventDefault()}),d.mousedown(function(c){var d,e;1===c.which&&a(c.target).is("div")&&(d=b.controls.square.offset(),e={top:c.pageY-d.top,left:c.pageX-d.left},c.preventDefault(),b._squareDrag(c,{position:e}),c.target=b.controls.squareDrag.get(0),b.controls.squareDrag.css(e).trigger(c))}),b.options.palettes&&b._paletteListeners()},_paletteListeners:function(){var b=this;b.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){b._color.fromCSS(a(this).data("color")),b.active="external",b._change()}).on("keydown.palette",".iris-palette",function(b){return 13!==b.keyCode&&32!==b.keyCode||(b.stopPropagation(),void a(this).click())})},_squareDrag:function(a,b){var c=this,d=c.options.controls,e=c._squareDimensions(),f=Math.round((e.h-b.position.top)/e.h*c._scale[d.vert]),g=c._scale[d.horiz]-Math.round((e.w-b.position.left)/e.w*c._scale[d.horiz]);c._color[d.horiz](g)[d.vert](f),c.active="square",c._change.apply(c,arguments)},_setOption:function(b,c){var d,e,f,g=this,h=g.options[b],i=!1;switch(g.options[b]=c,b){case"color":g.onlySlider?(c=parseInt(c,10),c=isNaN(c)||c<0||c>359?h:"hsl("+c+",100,50)",g.options.color=g.options[b]=c,g._color=new Color(c).setHSpace(g.options.mode),g.active="external",g._change()):(c=""+c,d=c.replace(/^#/,""),e=new Color(c).setHSpace(g.options.mode),e.error?g.options[b]=h:(g._color=e,g.options.color=g.options[b]=g._color.toString(),g.active="external",g._change()));break;case"palettes":i=!0,c?g._addPalettes():g.picker.find(".iris-palette-container").remove(),h||g._paletteListeners();break;case"width":i=!0;break;case"border":i=!0,f=c?"addClass":"removeClass",g.picker[f]("iris-border");break;case"mode":case"controls":if(h===c)return;return f=g.element,h=g.options,h.hide=!g.picker.is(":visible"),g.destroy(),g.picker.remove(),a(g.element).iris(h)}i&&g._dimensions(!0)},_squareDimensions:function(a){var c,d,e=this.controls.square;return a!==b&&e.data("dimensions")?e.data("dimensions"):(d=this.controls.squareDrag,c={w:e.width(),h:e.height()},e.data("dimensions",c),c)},_isNonHueControl:function(a,b){return"square"===a&&"h"===this.options.controls.strip||"external"!==b&&("h"!==b||"strip"!==a)},_change:function(){var b=this,c=b.controls,d=b._getHSpaceColor(),e=["square","strip"],f=b.options.controls,g=f[b.active]||"external",h=b.hue;"strip"===b.active?e=[]:"external"!==b.active&&e.pop(),a.each(e,function(a,e){var g,h,i;if(e!==b.active)switch(e){case"strip":g="h"!==f.strip||b.horizontalSlider?d[f.strip]:b._scale[f.strip]-d[f.strip],c.stripSlider.slider("value",g);break;case"square":h=b._squareDimensions(),i={left:d[f.horiz]/b._scale[f.horiz]*h.w,top:h.h-d[f.vert]/b._scale[f.vert]*h.h},b.controls.squareDrag.css(i)}}),d.h!==h&&b._isNonHueControl(b.active,g)&&b._color.h(h),b.hue=b._color.h(),b.options.color=b._color.toString(),b._inited&&b._trigger("change",{type:b.active},{color:b._color}),b.element.is(":input")&&!b._color.error&&(b.element.removeClass("iris-error"),b.onlySlider?b.element.val()!==b.hue&&b.element.val(b.hue):b.element.val()!==b._color.toString()&&b.element.val(b._color.toString())),b._paint(),b._inited=!0,b.active=!1},_debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()},color:function(a){return a===!0?this._color.clone():a===b?this._color.toString():void this.option("color",a)}},a.widget("a8c.iris",n),void a('").appendTo("head"))}(jQuery),function(a,b){var c=function(a,b){return this instanceof c?this._init(a,b):new c(a,b)};c.fn=c.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(a){var c="noop";switch(typeof a){case"object":return a.a!==b&&this.a(a.a),c=a.r!==b?"fromRgb":a.l!==b?"fromHsl":a.v!==b?"fromHsv":c,this[c](a);case"string":return this.fromCSS(a);case"number":return this.fromInt(parseInt(a,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var a=new c(this.toInt()),b=["_alpha","_hSpace","_hsl","_hsv","error"],d=b.length-1;d>=0;d--)a[b[d]]=this[b[d]];return a},setHSpace:function(a){return this._hSpace="hsv"===a?a:"hsl",this},noop:function(){return this},fromCSS:function(a){var b,c=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,a=a.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),a.match(c)&&a.match(/\)$/)){if(b=a.replace(/(\s|%)/g,"").replace(c,"").replace(/,?\);?$/,"").split(","),b.length<3)return this._error();if(4===b.length&&(this.a(parseFloat(b.pop())),this.error))return this;for(var d=b.length-1;d>=0;d--)if(b[d]=parseInt(b[d],10),isNaN(b[d]))return this._error();return a.match(/^rgb/)?this.fromRgb({r:b[0],g:b[1],b:b[2]}):a.match(/^hsv/)?this.fromHsv({h:b[0],s:b[1],v:b[2]}):this.fromHsl({h:b[0],s:b[1],l:b[2]})}return this.fromHex(a)},fromRgb:function(a,c){return"object"!=typeof a||a.r===b||a.g===b||a.b===b?this._error():(this.error=!1,this.fromInt(parseInt((a.r<<16)+(a.g<<8)+a.b,10),c))},fromHex:function(a){return a=a.replace(/^#/,"").replace(/^0x/,""),3===a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),this.error=!/^[0-9A-F]{6}$/i.test(a),this.fromInt(parseInt(a,16))},fromHsl:function(a){var c,d,e,f,g,h,i,j;return"object"!=typeof a||a.h===b||a.s===b||a.l===b?this._error():(this._hsl=a,this._hSpace="hsl",h=a.h/360,i=a.s/100,j=a.l/100,0===i?c=d=e=j:(f=j<.5?j*(1+i):j+i-j*i,g=2*j-f,c=this.hue2rgb(g,f,h+1/3),d=this.hue2rgb(g,f,h),e=this.hue2rgb(g,f,h-1/3)),this.fromRgb({r:255*c,g:255*d,b:255*e},!0))},fromHsv:function(a){var c,d,e,f,g,h,i,j,k,l,m;if("object"!=typeof a||a.h===b||a.s===b||a.v===b)return this._error();switch(this._hsv=a,this._hSpace="hsv",c=a.h/360,d=a.s/100,e=a.v/100,i=Math.floor(6*c),j=6*c-i,k=e*(1-d),l=e*(1-j*d),m=e*(1-(1-j)*d),i%6){case 0:f=e,g=m,h=k;break;case 1:f=l,g=e,h=k;break;case 2:f=k,g=e,h=m;break;case 3:f=k,g=l,h=e;break;case 4:f=m,g=k,h=e;break;case 5:f=e,g=k,h=l}return this.fromRgb({r:255*f,g:255*g,b:255*h},!0)},fromInt:function(a,c){return this._color=parseInt(a,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),c===b&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+6*(b-a)*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},toString:function(){var a=parseInt(this._color,10).toString(16);if(this.error)return"";if(a.length<6)for(var b=6-a.length-1;b>=0;b--)a="0"+a;return"#"+a},toCSS:function(a,b){switch(a=a||"hex",b=parseFloat(b||this._alpha),a){case"rgb":case"rgba":var c=this.toRgb();return b<1?"rgba("+c.r+", "+c.g+", "+c.b+", "+b+")":"rgb("+c.r+", "+c.g+", "+c.b+")";case"hsl":case"hsla":var d=this.toHsl();return b<1?"hsla("+d.h+", "+d.s+"%, "+d.l+"%, "+b+")":"hsl("+d.h+", "+d.s+"%, "+d.l+"%)";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var a,b,c=this.toRgb(),d=c.r/255,e=c.g/255,f=c.b/255,g=Math.max(d,e,f),h=Math.min(d,e,f),i=(g+h)/2;if(g===h)a=b=0;else{var j=g-h;switch(b=i>.5?j/(2-g-h):j/(g+h),g){case d:a=(e-f)/j+(ed?(b+.05)/(d+.05):(d+.05)/(b+.05)},getMaxContrastColor:function(){var a=this.getDistanceLuminosityFrom(new c("#000")),b=this.getDistanceLuminosityFrom(new c("#fff")),d=a>=b?"#000":"#fff";return new c(d)},getReadableContrastingColor:function(a,d){if(!(a instanceof c))return this;var e,f,g,h=d===b?5:d,i=a.getDistanceLuminosityFrom(this);if(i>=h)return this;if(e=a.getMaxContrastColor(),f=e.getDistanceLuminosityFrom(a),f<=h)return e;for(g=0===e.toInt()?-1:1;ic.range[1]?c.range[1]:d),f[a]=d,this._spaceFunc("from",c.space,f))}},_spaceFunc:function(a,b,c){var d=b||this._hSpace,e=a+d.charAt(0).toUpperCase()+d.substr(1);return this[e](c)}};var d={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var e in d)d.hasOwnProperty(e)&&(c.fn[e]=c.fn._partial(e));"object"==typeof exports?module.exports=c:a.Color=c}(this);