(function(c,p,A){function g(a,d,F){a=p.createElement(a);d&&(a.id="cbox"+d);F&&(a.style.cssText=F);return c(a)}function R(){return A.innerHeight?A.innerHeight:c(A).height()}function M(a,d){d!==Object(d)&&(d={});this.cache={};this.el=a;this.value=function(a){var b;void 0===this.cache[a]&&(b=c(this.el).attr("data-cbox-"+a),void 0!==b?this.cache[a]=b:void 0!==d[a]?this.cache[a]=d[a]:void 0!==S[a]&&(this.cache[a]=S[a]));return this.cache[a]};this.get=function(a){a=this.value(a);return c.isFunction(a)?
a.call(this.el,this):a}}function N(a){var d=k.length;a=(m+a)%d;return 0>a?d+a:a}function n(a,d){return Math.round((/%/.test(a)?("x"===d?w.width():R())/100:1)*parseInt(a,10))}function da(a,d){return a.get("photo")||a.get("photoRegex").test(d)}function ea(a,d){return a.get("retinaUrl")&&1<A.devicePixelRatio?d.replace(a.get("photoRegex"),a.get("retinaSuffix")):d}function fa(a){"contains"in f[0]&&!f[0].contains(a.target)&&a.target!==q[0]&&(a.stopPropagation(),f.focus())}function G(a){G.str!==a&&(f.add(q).removeClass(G.str).addClass(a),
G.str=a)}function ja(b){m=0;b&&!1!==b&&"nofollow"!==b?(k=c(".cboxElement").filter(function(){var a=c.data(this,"colorbox");return(new M(this,a)).get("rel")===b}),m=k.index(a.el),-1===m&&(k=k.add(a.el),m=k.length-1)):k=c(a.el)}function C(a){c(p).trigger(a);r.triggerHandler(a)}function O(b){var d;if(!H){d=c(b).data("colorbox");a=new M(b,d);ja(a.get("rel"));if(!x){x=I=!0;G(a.get("className"));f.css({visibility:"hidden",display:"block",opacity:""});h=g("div","LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden");
u.css({width:"",height:""}).append(h);t=T.height()+U.height()+u.outerHeight(!0)-u.height();v=V.width()+W.width()+u.outerWidth(!0)-u.width();y=h.outerHeight(!0);z=h.outerWidth(!0);b=n(a.get("initialWidth"),"x");d=n(a.get("initialHeight"),"y");var F=a.get("maxWidth"),B=a.get("maxHeight");a.w=(!1!==F?Math.min(b,n(F,"x")):b)-z-v;a.h=(!1!==B?Math.min(d,n(B,"y")):d)-y-t;h.css({width:"",height:a.h});l.position();C("cbox_open");a.get("onOpen");X.add(Y).hide();f.focus();a.get("trapFocus")&&p.addEventListener&&
(p.addEventListener("focus",fa,!0),r.one("cbox_closed",function(){p.removeEventListener("focus",fa,!0)}));if(a.get("returnFocus"))r.one("cbox_closed",function(){c(a.el).focus()})}b=parseFloat(a.get("opacity"));q.css({opacity:b===b?b:"",cursor:a.get("overlayClose")?"pointer":"",visibility:"visible"}).show();a.get("closeButton")?P.html(a.get("close")).appendTo(u):P.appendTo("<div/>");ka()}}function ga(){f||(Z=!1,w=c(A),f=g("div").attr({id:"colorbox","class":!1===c.support.opacity?"cboxIE":"",role:"dialog",
tabindex:"-1"}).hide(),q=g("div","Overlay").hide(),Q=c([g("div","LoadingOverlay")[0],g("div","LoadingGraphic")[0]]),D=g("div","Wrapper"),u=g("div","Content").append(Y=g("div","Title"),aa=g("div","Current"),J=c('<button type="button"/>').attr({id:"cboxPrevious"}),K=c('<button type="button"/>').attr({id:"cboxNext"}),E=g("button","Slideshow"),Q),P=c('<button type="button"/>').attr({id:"cboxClose"}),D.append(g("div").append(g("div","TopLeft"),T=g("div","TopCenter"),g("div","TopRight")),g("div",!1,"clear:left").append(V=
g("div","MiddleLeft"),u,W=g("div","MiddleRight")),g("div",!1,"clear:left").append(g("div","BottomLeft"),U=g("div","BottomCenter"),g("div","BottomRight"))).find("div div").css({"float":"left"}),L=g("div",!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),X=K.add(J).add(aa).add(E));p.body&&!f.parent().length&&c(p.body).append(q,f.append(D,L))}function la(){function b(a){1<a.which||a.shiftKey||a.altKey||a.metaKey||a.ctrlKey||(a.preventDefault(),O(this))}if(f){if(!Z)if(Z=
!0,K.click(function(){l.next()}),J.click(function(){l.prev()}),P.click(function(){l.close()}),q.click(function(){a.get("overlayClose")&&l.close()}),c(p).bind("keydown.cbox",function(b){var c=b.keyCode;x&&a.get("escKey")&&27===c&&(b.preventDefault(),l.close());x&&a.get("arrowKey")&&k[1]&&!b.altKey&&(37===c?(b.preventDefault(),J.click()):39===c&&(b.preventDefault(),K.click()))}),c.isFunction(c.fn.on))c(p).on("click.cbox",".cboxElement",b);else c(".cboxElement").live("click.cbox",b);return!0}return!1}
function ka(){var b,d,f=l.prep,B,h=++ba;I=!0;e=!1;C("cbox_purge");C("cbox_load");a.get("onLoad");a.h=a.get("height")?n(a.get("height"),"y")-y-t:a.get("innerHeight")&&n(a.get("innerHeight"),"y");a.w=a.get("width")?n(a.get("width"),"x")-z-v:a.get("innerWidth")&&n(a.get("innerWidth"),"x");a.mw=a.w;a.mh=a.h;a.get("maxWidth")&&(a.mw=n(a.get("maxWidth"),"x")-z-v,a.mw=a.w&&a.w<a.mw?a.w:a.mw);a.get("maxHeight")&&(a.mh=n(a.get("maxHeight"),"y")-y-t,a.mh=a.h&&a.h<a.mh?a.h:a.mh);b=a.get("href");ha=setTimeout(function(){Q.show()},
100);if(a.get("inline")){var ca=c(b);B=c("<div>").hide().insertBefore(ca);r.one("cbox_purge",function(){B.replaceWith(ca)});f(ca)}else a.get("iframe")?f(" "):a.get("html")?f(a.get("html")):da(a,b)?(b=ea(a,b),e=a.get("createImg"),c(e).addClass("cboxPhoto").bind("error",function(){f(g("div","Error").html(a.get("imgError")))}).one("load",function(){h===ba&&setTimeout(function(){var b;a.get("retinaImage")&&1<A.devicePixelRatio&&(e.height/=A.devicePixelRatio,e.width/=A.devicePixelRatio);a.get("scalePhotos")&&
(d=function(){e.height-=e.height*b;e.width-=e.width*b},a.mw&&e.width>a.mw&&(b=(e.width-a.mw)/e.width,d()),a.mh&&e.height>a.mh&&(b=(e.height-a.mh)/e.height,d()));a.h&&(e.style.marginTop=Math.max(a.mh-e.height,0)/2+"px");k[1]&&(a.get("loop")||k[m+1])&&(e.style.cursor="pointer",e.onclick=function(){l.next()});e.style.width=e.width+"px";e.style.height=e.height+"px";f(e)},1)}),e.src=b):b&&L.load(b,a.get("data"),function(b,d){h===ba&&f("error"===d?g("div","Error").html(a.get("xhrError")):c(this).contents())})}
var S={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",
photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return c(this).attr("href")},title:function(){return this.title},createImg:function(){var a=
new Image,d=c(this).data("cbox-img-attrs");"object"===typeof d&&c.each(d,function(c,d){a[c]=d});return a},createIframe:function(){var a=p.createElement("iframe"),d=c(this).data("cbox-iframe-attrs");"object"===typeof d&&c.each(d,function(c,d){a[c]=d});"frameBorder"in a&&(a.frameBorder=0);"allowTransparency"in a&&(a.allowTransparency="true");a.name=(new Date).getTime();a.allowFullScreen=!0;return a}},q,f,D,u,T,V,W,U,k,w,h,L,Q,Y,aa,E,K,J,P,X,r=c("<a/>"),a,t,v,y,z,m,e,x,I,H,ha,l,ba=0,ia={},Z,ma=function(){function b(){clearTimeout(n)}
function c(){if(a.get("loop")||k[m+1])b(),n=setTimeout(l.next,a.get("slideshowSpeed"))}function e(){E.html(a.get("slideshowStop")).unbind("click.cbox").one("click.cbox",B);r.bind("cbox_complete",c).bind("cbox_load",b);f.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on")}function B(){b();r.unbind("cbox_complete",c).unbind("cbox_load",b);E.html(a.get("slideshowStart")).unbind("click.cbox").one("click.cbox",function(){l.next();e()});f.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off")}
function g(){h=!1;E.hide();b();r.unbind("cbox_complete",c).unbind("cbox_load",b);f.removeClass("cboxSlideshow_off cboxSlideshow_on")}var h,n;return function(){h?a.get("slideshow")||(r.unbind("cbox_cleanup",g),g()):a.get("slideshow")&&k[1]&&(h=!0,r.one("cbox_cleanup",g),a.get("slideshowAuto")?e():B(),E.show())}}();c.colorbox||(c(ga),l=c.fn.colorbox=c.colorbox=function(a,d){var f,e=this;a=a||{};c.isFunction(e)&&(e=c("<a/>"),a.open=!0);if(!e[0])return e;ga();la()&&(d&&(a.onComplete=d),e.each(function(){var d=
c.data(this,"colorbox")||{};c.data(this,"colorbox",c.extend(d,a))}).addClass("cboxElement"),f=new M(e[0],a),f.get("open")&&O(e[0]));return e},l.position=function(b,d){function e(){T[0].style.width=U[0].style.width=u[0].style.width=parseInt(f[0].style.width,10)-v+"px";u[0].style.height=V[0].style.height=W[0].style.height=parseInt(f[0].style.height,10)-t+"px"}var g,h=0,k=0,m=f.offset(),p,r;w.unbind("resize.cbox");f.css({top:-9E4,left:-9E4});p=w.scrollTop();r=w.scrollLeft();a.get("fixed")?(m.top-=p,
m.left-=r,f.css({position:"fixed"})):(h=p,k=r,f.css({position:"absolute"}));k=!1!==a.get("right")?k+Math.max(w.width()-a.w-z-v-n(a.get("right"),"x"),0):!1!==a.get("left")?k+n(a.get("left"),"x"):k+Math.round(Math.max(w.width()-a.w-z-v,0)/2);h=!1!==a.get("bottom")?h+Math.max(R()-a.h-y-t-n(a.get("bottom"),"y"),0):!1!==a.get("top")?h+n(a.get("top"),"y"):h+Math.round(Math.max(R()-a.h-y-t,0)/2);f.css({top:m.top,left:m.left,visibility:"visible"});D[0].style.width=D[0].style.height="9999px";g={width:a.w+
z+v,height:a.h+y+t,top:h,left:k};if(b){var q=0;c.each(g,function(a){g[a]!==ia[a]&&(q=b)});b=q}ia=g;b||f.css(g);f.dequeue().animate(g,{duration:b||0,complete:function(){e();I=!1;D[0].style.width=a.w+z+v+"px";D[0].style.height=a.h+y+t+"px";a.get("reposition")&&setTimeout(function(){w.bind("resize.cbox",l.position)},1);c.isFunction(d)&&d()},step:e})},l.resize=function(b){var c;x&&(b=b||{},b.width&&(a.w=n(b.width,"x")-z-v),b.innerWidth&&(a.w=n(b.innerWidth,"x")),h.css({width:a.w}),b.height&&(a.h=n(b.height,
"y")-y-t),b.innerHeight&&(a.h=n(b.innerHeight,"y")),b.innerHeight||b.height||(c=h.scrollTop(),h.css({height:"auto"}),a.h=h.height()),h.css({height:a.h}),c&&h.scrollTop(c),l.position("none"===a.get("transition")?0:a.get("speed")))},l.prep=function(b){function d(){a.w=a.w||h.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function n(){a.h=a.h||h.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}if(x){var q,t="none"===a.get("transition")?0:a.get("speed");h.remove();h=g("div","LoadedContent").append(b);
h.hide().appendTo(L.show()).css({width:d(),overflow:a.get("scrolling")?"auto":"hidden"}).css({height:n()}).prependTo(u);L.hide();c(e).css({"float":"none"});G(a.get("className"));q=function(){function b(){!1===c.support.opacity&&f[0].style.removeAttribute("filter")}var d=k.length,e,g;x&&(g=function(){clearTimeout(ha);Q.hide();C("cbox_complete");a.get("onComplete")},Y.html(a.get("title")).show(),h.show(),1<d?("string"===typeof a.get("current")&&aa.html(a.get("current").replace("{current}",m+1).replace("{total}",
d)).show(),K[a.get("loop")||m<d-1?"show":"hide"]().html(a.get("next")),J[a.get("loop")||m?"show":"hide"]().html(a.get("previous")),ma(),a.get("preloading")&&c.each([N(-1),N(1)],function(){var a,b=k[this];a=new M(b,c.data(b,"colorbox"));(b=a.get("href"))&&da(a,b)&&(b=ea(a,b),a=p.createElement("img"),a.src=b)})):X.hide(),a.get("iframe")?(e=a.get("createIframe"),a.get("scrolling")||(e.scrolling="no"),c(e).attr({src:a.get("href"),"class":"cboxIframe"}).one("load",g).appendTo(h),r.one("cbox_purge",function(){e.src=
"//about:blank"}),a.get("fastIframe")&&c(e).trigger("load")):g(),"fade"===a.get("transition")?f.fadeTo(t,1,b):b())};"fade"===a.get("transition")?f.fadeTo(t,0,function(){l.position(0,q)}):l.position(t,q)}},l.next=function(){!I&&k[1]&&(a.get("loop")||k[m+1])&&(m=N(1),O(k[m]))},l.prev=function(){!I&&k[1]&&(a.get("loop")||m)&&(m=N(-1),O(k[m]))},l.close=function(){x&&!H&&(H=!0,x=!1,C("cbox_cleanup"),a.get("onCleanup"),w.unbind(".cbox"),q.fadeTo(a.get("fadeOut")||0,0),f.stop().fadeTo(a.get("fadeOut")||
0,0,function(){f.hide();q.hide();C("cbox_purge");h.remove();setTimeout(function(){H=!1;C("cbox_closed");a.get("onClosed")},1)}))},l.remove=function(){f&&(f.stop(),c.colorbox.close(),f.stop(!1,!0).remove(),q.remove(),H=!1,f=null,c(".cboxElement").removeData("colorbox").removeClass("cboxElement"),c(p).unbind("click.cbox").unbind("keydown.cbox"))},l.element=function(){return c(a.el)},l.settings=S)})(jQuery,document,window);
