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