(function(n,t,i){function h(i,r,u){var f=t.createElement(i);return r&&(f.id=e+r),u&&(f.style.cssText=u),n(f)}function ai(){return i.innerHeight?i.innerHeight:n(i).height()}function kt(t,i){i!==Object(i)&&(i={});this.cache={};this.el=t;this.value=function(t){var r;return this.cache[t]===undefined&&(r=n(this.el).attr("data-cbox-"+t),r!==undefined?this.cache[t]=r:i[t]!==undefined?this.cache[t]=i[t]:ni[t]!==undefined&&(this.cache[t]=ni[t])),this.cache[t]};this.get=function(t){var i=this.value(t);return n.isFunction(i)?i.call(this.el,this):i}}function dt(n){var i=c.length,t=(v+n)%i;return t<0?i+t:t}function a(n,t){return Math.round((/%/.test(n)?(t==="x"?g.width():ai())/100:1)*parseInt(n,10))}function pi(n,t){return n.get("photo")||n.get("photoRegex").test(t)}function wi(n,t){return n.get("retinaUrl")&&i.devicePixelRatio>1?t.replace(n.get("photoRegex"),n.get("retinaSuffix")):t}function bi(n){"contains"in u[0]&&!u[0].contains(n.target)&&n.target!==d[0]&&(n.stopPropagation(),u.focus())}function at(n){at.str!==n&&(u.add(d).removeClass(at.str).addClass(n),at.str=n)}function gi(t){v=0;t&&t!==!1&&t!=="nofollow"?(c=n("."+ft).filter(function(){var i=n.data(this,y),r=new kt(this,i);return r.get("rel")===t}),v=c.index(r.el),v===-1&&(c=c.add(r.el),v=c.length-1)):c=n(r.el)}function ut(i){n(t).trigger(i);w.triggerHandler(i)}function gt(i){var e,f;if(!lt){if(e=n(i).data(y),r=new kt(i,e),gi(r.get("rel")),!it){it=ct=!0;at(r.get("className"));u.css({visibility:"hidden",display:"block",opacity:""});l=h(s,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden");p.css({width:"",height:""}).append(l);b=ri.height()+ei.height()+p.outerHeight(!0)-p.height();k=ui.width()+fi.width()+p.outerWidth(!0)-p.width();nt=l.outerHeight(!0);tt=l.outerWidth(!0);var c=a(r.get("initialWidth"),"x"),v=a(r.get("initialHeight"),"y"),g=r.get("maxWidth"),rt=r.get("maxHeight");if(r.w=Math.max((g!==!1?Math.min(c,a(g,"x")):c)-tt-k,0),r.h=Math.max((rt!==!1?Math.min(v,a(rt,"y")):v)-nt-b,0),l.css({width:"",height:r.h}),o.position(),ut(di),r.get("onOpen"),hi.add(oi).hide(),u.focus(),r.get("trapFocus")&&t.addEventListener){t.addEventListener("focus",bi,!0);w.one(ii,function(){t.removeEventListener("focus",bi,!0)})}if(r.get("returnFocus"))w.one(ii,function(){n(r.el).focus()})}f=parseFloat(r.get("opacity"));d.css({opacity:f===f?f:"",cursor:r.get("overlayClose")?"pointer":"",visibility:"visible"}).show();r.get("closeButton")?bt.html(r.get("close")).appendTo(p):bt.appendTo("<div/>");ir()}}function ki(){u||(li=!1,g=n(i),u=h(s).attr({id:y,"class":n.support.opacity===!1?e+"IE":"",role:"dialog",tabindex:"-1"}).hide(),d=h(s,"Overlay").hide(),wt=n([h(s,"LoadingOverlay")[0],h(s,"LoadingGraphic")[0]]),rt=h(s,"Wrapper"),p=h(s,"Content").append(oi=h(s,"Title"),si=h(s,"Current"),ht=n('<button type="button"/>').attr({id:e+"Previous"}),st=n('<button type="button"/>').attr({id:e+"Next"}),et=n('<button type="button"/>').attr({id:e+"Slideshow"}),wt),bt=n('<button type="button"/>').attr({id:e+"Close"}),rt.append(h(s).append(h(s,"TopLeft"),ri=h(s,"TopCenter"),h(s,"TopRight")),h(s,!1,"clear:left").append(ui=h(s,"MiddleLeft"),p,fi=h(s,"MiddleRight")),h(s,!1,"clear:left").append(h(s,"BottomLeft"),ei=h(s,"BottomCenter"),h(s,"BottomRight"))).find("div div").css({float:"left"}),ot=h(s,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),hi=st.add(ht).add(si).add(et));t.body&&!u.parent().length&&n(t.body).append(d,u.append(rt,ot))}function tr(){function i(n){n.which>1||n.shiftKey||n.altKey||n.metaKey||n.ctrlKey||(n.preventDefault(),gt(this))}if(u){if(!li)if(li=!0,st.click(function(){o.next()}),ht.click(function(){o.prev()}),bt.click(function(){o.close()}),d.click(function(){r.get("overlayClose")&&o.close()}),n(t).bind("keydown."+e,function(n){var t=n.keyCode;it&&r.get("escKey")&&t===27&&(n.preventDefault(),o.close());it&&r.get("arrowKey")&&c[1]&&!n.altKey&&(t===37?(n.preventDefault(),ht.click()):t===39&&(n.preventDefault(),st.click()))}),n.isFunction(n.fn.on))n(t).on("click."+e,"."+ft,i);else n("."+ft).live("click."+e,i);return!0}return!1}function ir(){var t,y,u=o.prep,p,d=++ci,l;if(ct=!0,f=!1,ut(pt),ut(vt),r.get("onLoad"),r.h=r.get("height")?a(r.get("height"),"y")-nt-b:r.get("innerHeight")&&a(r.get("innerHeight"),"y"),r.w=r.get("width")?a(r.get("width"),"x")-tt-k:r.get("innerWidth")&&a(r.get("innerWidth"),"x"),r.mw=r.w,r.mh=r.h,r.get("maxWidth")&&(r.mw=a(r.get("maxWidth"),"x")-tt-k,r.mw=r.w&&r.w<r.mw?r.w:r.mw),r.get("maxHeight")&&(r.mh=a(r.get("maxHeight"),"y")-nt-b,r.mh=r.h&&r.h<r.mh?r.h:r.mh),t=r.get("href"),vi=setTimeout(function(){wt.show()},100),r.get("inline")){l=n(t).eq(0);p=n("<div>").hide().insertBefore(l);w.one(pt,function(){p.replaceWith(l)});u(l)}else if(r.get("iframe"))u(" ");else if(r.get("html"))u(r.get("html"));else if(pi(r,t)){t=wi(r,t);f=r.get("createImg");n(f).addClass(e+"Photo").bind("error."+e,function(){u(h(s,"Error").html(r.get("imgError")))}).one("load",function(){d===ci&&setTimeout(function(){var t;r.get("retinaImage")&&i.devicePixelRatio>1&&(f.height=f.height/i.devicePixelRatio,f.width=f.width/i.devicePixelRatio);r.get("scalePhotos")&&(y=function(){f.height-=f.height*t;f.width-=f.width*t},r.mw&&f.width>r.mw&&(t=(f.width-r.mw)/f.width,y()),r.mh&&f.height>r.mh&&(t=(f.height-r.mh)/f.height,y()));r.h&&(f.style.marginTop=Math.max(r.mh-f.height,0)/2+"px");c[1]&&(r.get("loop")||c[v+1])&&(f.style.cursor="pointer",n(f).bind("click."+e,function(){o.next()}));f.style.width=f.width+"px";f.style.height=f.height+"px";u(f)},1)});f.src=t}else t&&ot.load(t,r.get("data"),function(t,i){d===ci&&u(i==="error"?h(s,"Error").html(r.get("xhrError")):n(this).contents())})}var ni={html:!1,photo:!1,iframe:!1,inline:!1,transition:"fade",speed:300,fadeOut:300,width:!1,initialWidth:"300",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"200",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.5,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!0,data:undefined,closeButton:!1,fastIframe:!1,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:3e3,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 n(this).attr("href")},title:function(){return this.title},createImg:function(){var t=new Image,i=n(this).data("cbox-img-attrs");return typeof i=="object"&&n.each(i,function(n,i){t[n]=i}),t},createIframe:function(){var i=t.createElement("iframe"),r=n(this).data("cbox-iframe-attrs");return typeof r=="object"&&n.each(r,function(n,t){i[n]=t}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},y="colorbox",e="cbox",ft=e+"Element",di=e+"_open",vt=e+"_load",yt=e+"_complete",ti=e+"_cleanup",ii=e+"_closed",pt=e+"_purge",d,u,rt,p,ri,ui,fi,ei,c,g,l,ot,wt,oi,si,et,st,ht,bt,hi,w=n("<a/>"),r,b,k,nt,tt,v,f,it,ct,lt,vi,o,s="div",ci=0,yi={},li,nr=function(){function t(){clearTimeout(l)}function s(){(r.get("loop")||c[v+1])&&(t(),l=setTimeout(o.next,r.get("slideshowSpeed")))}function a(){et.html(r.get("slideshowStop")).unbind(i).one(i,y);w.bind(yt,s).bind(vt,t);u.removeClass(n+"off").addClass(n+"on")}function y(){t();w.unbind(yt,s).unbind(vt,t);et.html(r.get("slideshowStart")).unbind(i).one(i,function(){o.next();a()});u.removeClass(n+"on").addClass(n+"off")}function h(){f=!1;et.hide();t();w.unbind(yt,s).unbind(vt,t);u.removeClass(n+"off "+n+"on")}var f,n=e+"Slideshow_",i="click."+e,l;return function(){if(f)r.get("slideshow")||(w.unbind(ti,h),h());else if(r.get("slideshow")&&c[1]){f=!0;w.one(ti,h);r.get("slideshowAuto")?a():y();et.show()}}}();n[y]||(n(ki),o=n.fn[y]=n[y]=function(t,i){var u,r=this;return(t=t||{},n.isFunction(r)&&(r=n("<a/>"),t.open=!0),!r[0])?r:(ki(),tr()&&(i&&(t.onComplete=i),r.each(function(){var i=n.data(this,y)||{};n.data(this,y,n.extend(i,t))}).addClass(ft),u=new kt(r[0],t),u.get("open")&&gt(r[0])),r)},o.position=function(t,i){function w(){ri[0].style.width=ei[0].style.width=p[0].style.width=parseInt(u[0].style.width,10)-k+"px";p[0].style.height=ui[0].style.height=fi[0].style.height=parseInt(u[0].style.height,10)-b+"px"}var f,h=0,c=0,s=u.offset(),l,v,y;g.unbind("resize."+e);u.css({top:-9e4,left:-9e4});l=g.scrollTop();v=g.scrollLeft();r.get("fixed")?(s.top-=l,s.left-=v,u.css({position:"fixed"})):(h=l,c=v,u.css({position:"absolute"}));c+=r.get("right")!==!1?Math.max(g.width()-r.w-tt-k-a(r.get("right"),"x"),0):r.get("left")!==!1?a(r.get("left"),"x"):Math.round(Math.max(g.width()-r.w-tt-k,0)/2);h+=r.get("bottom")!==!1?Math.max(ai()-r.h-nt-b-a(r.get("bottom"),"y"),0):r.get("top")!==!1?a(r.get("top"),"y"):Math.round(Math.max(ai()-r.h-nt-b,0)/2);u.css({top:s.top,left:s.left,visibility:"visible"});rt[0].style.width=rt[0].style.height="9999px";f={width:r.w+tt+k,height:r.h+nt+b,top:h,left:c};t&&(y=0,n.each(f,function(n){if(f[n]!==yi[n]){y=t;return}}),t=y);yi=f;t||u.css(f);u.dequeue().animate(f,{duration:t||0,complete:function(){w();ct=!1;rt[0].style.width=r.w+tt+k+"px";rt[0].style.height=r.h+nt+b+"px";r.get("reposition")&&setTimeout(function(){g.bind("resize."+e,o.position)},1);n.isFunction(i)&&i()},step:w})},o.resize=function(n){var t;it&&(n=n||{},n.width&&(r.w=a(n.width,"x")-tt-k),n.innerWidth&&(r.w=a(n.innerWidth,"x")),l.css({width:r.w}),n.height&&(r.h=a(n.height,"y")-nt-b),n.innerHeight&&(r.h=a(n.innerHeight,"y")),n.innerHeight||n.height||(t=l.scrollTop(),l.css({height:"auto"}),r.h=l.height()),l.css({height:r.h}),t&&l.scrollTop(t),o.position(r.get("transition")==="none"?0:r.get("speed")))},o.prep=function(i){function k(){return r.w=r.w||l.width(),r.w=r.mw&&r.mw<r.w?r.mw:r.w,r.w}function d(){return r.h=r.h||l.height(),r.h=r.mh&&r.mh<r.h?r.mh:r.h,r.h}if(it){var a,b=r.get("transition")==="none"?0:r.get("speed");l.remove();l=h(s,"LoadedContent").append(i);l.hide().appendTo(ot.show()).css({width:k(),overflow:r.get("scrolling")?"auto":"hidden"}).css({height:d()}).prependTo(p);ot.hide();n(f).css({float:"none"});at(r.get("className"));a=function(){function s(){n.support.opacity===!1&&u[0].style.removeAttribute("filter")}var f=c.length,i,o;if(it){if(o=function(){clearTimeout(vi);wt.hide();ut(yt);r.get("onComplete")},oi.html(r.get("title")).show(),l.show(),f>1?(typeof r.get("current")=="string"&&si.html(r.get("current").replace("{current}",v+1).replace("{total}",f)).show(),st[r.get("loop")||v<f-1?"show":"hide"]().html(r.get("next")),ht[r.get("loop")||v?"show":"hide"]().html(r.get("previous")),nr(),r.get("preloading")&&n.each([dt(-1),dt(1)],function(){var u,f=c[this],r=new kt(f,n.data(f,y)),i=r.get("href");i&&pi(r,i)&&(i=wi(r,i),u=t.createElement("img"),u.src=i)})):hi.hide(),r.get("iframe")){i=r.get("createIframe");r.get("scrolling")||(i.scrolling="no");n(i).attr({src:r.get("href"),"class":e+"Iframe"}).one("load",o).appendTo(l);w.one(pt,function(){i.src="//about:blank"});r.get("fastIframe")&&n(i).trigger("load")}else o();r.get("transition")==="fade"?u.fadeTo(b,1,s):s()}};r.get("transition")==="fade"?u.fadeTo(b,0,function(){o.position(0,a)}):o.position(b,a)}},o.next=function(){!ct&&c[1]&&(r.get("loop")||c[v+1])&&(v=dt(1),gt(c[v]))},o.prev=function(){!ct&&c[1]&&(r.get("loop")||v)&&(v=dt(-1),gt(c[v]))},o.close=function(){it&&!lt&&(lt=!0,it=!1,ut(ti),r.get("onCleanup"),g.unbind("."+e),d.fadeTo(r.get("fadeOut")||0,0),u.stop().fadeTo(r.get("fadeOut")||0,0,function(){u.hide();d.hide();ut(pt);l.remove();setTimeout(function(){lt=!1;ut(ii);r.get("onClosed")},1)}))},o.remove=function(){u&&(u.stop(),n[y].close(),u.stop(!1,!0).remove(),d.remove(),lt=!1,u=null,n("."+ft).removeData(y).removeClass(ft),n(t).unbind("click."+e).unbind("keydown."+e))},o.element=function(){return n(r.el)},o.settings=ni)})(jQuery,document,window)