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