/*!
colorbox 1.6.4
license: mit
http://www.jacklmoore.com/colorbox
*/
(function(t,e,i){function n(i,n,o){var r=e.createelement(i);return n&&(r.id=z+n),o&&(r.style.csstext=o),t(r)}function o(){return i.innerheight?i.innerheight:t(i).height()}function r(e,i){i!==object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==x[e]&&(this.cache[e]=x[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isfunction(i)?i.call(this.el,this):i}}function h(t){var e=w.length,i=(a+t)%e;return 0>i?e+i:i}function a(t,e){return math.round((/%/.test(t)?("x"===e?e.width():o())/100:1)*parseint(t,10))}function s(t,e){return t.get("photo")||t.get("photoregex").test(e)}function l(t,e){return t.get("retinaurl")&&i.devicepixelratio>1?e.replace(t.get("photoregex"),t.get("retinasuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stoppropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeclass(c.str).addclass(t),c.str=t)}function g(e){a=0,e&&e!==!1&&"nofollow"!==e?(w=t("."+te).filter(function(){var i=t.data(this,y),n=new r(this,i);return n.get("rel")===e}),a=w.index(_.el),-1===a&&(w=w.add(_.el),a=w.length-1)):w=t(_.el)}function u(i){t(e).trigger(i),ae.triggerhandler(i)}function f(i){var o;if(!g){if(o=t(i).data(y),_=new r(i,o),g(_.get("rel")),!u){u=$=!0,c(_.get("classname")),x.css({visibility:"hidden",display:"block",opacity:""}),i=n(se,"loadedcontent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(i),j=t.height()+k.height()+b.outerheight(!0)-b.height(),d=c.width()+h.width()+b.outerwidth(!0)-b.width(),n=i.outerheight(!0),z=i.outerwidth(!0);var h=a(_.get("initialwidth"),"x"),s=a(_.get("initialheight"),"y"),l=_.get("maxwidth"),f=_.get("maxheight");_.w=math.max((l!==!1?math.min(h,a(l,"x")):h)-z-d,0),_.h=math.max((f!==!1?math.min(s,a(f,"y")):s)-n-j,0),i.css({width:"",height:_.h}),j.position(),u(ee),_.get("onopen"),o.add(f).hide(),x.focus(),_.get("trapfocus")&&e.addeventlistener&&(e.addeventlistener("focus",d,!0),ae.one(re,function(){e.removeeventlistener("focus",d,!0)})),_.get("returnfocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parsefloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayclose")?"pointer":"",visibility:"visible"}).show(),_.get("closebutton")?b.html(_.get("close")).appendto(b):b.appendto("
").hide().insertbefore(c),ae.one(he,function(){r.replacewith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createimg"),t(q).addclass(z+"photo").bind("error."+z,function(){h(n(se,"error").html(_.get("imgerror")))}).one("load",function(){d===le&&settimeout(function(){var e;_.get("retinaimage")&&i.devicepixelratio>1&&(q.height=q.height/i.devicepixelratio,q.width=q.width/i.devicepixelratio),_.get("scalephotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.margintop=math.max(_.mh-q.height,0)/2+"px"),w[1]&&(_.get("loop")||w[a+1])&&(q.style.cursor="pointer",t(q).bind("click."+z,function(){j.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&m.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"error").html(_.get("xhrerror")):t(this).contents())})}var v,x,y,b,t,c,h,k,w,e,i,m,l,f,r,s,k,p,b,o,_,j,d,n,z,a,q,u,$,g,q,j,v,x={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 t(this).attr("href")},title:function(){return this.title},createimg:function(){var e=new image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createiframe:function(){var i=e.createelement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameborder"in i&&(i.frameborder=0),"allowtransparency"in i&&(i.allowtransparency="true"),i.name=(new date).gettime(),i.allowfullscreen=!0,i}},y="colorbox",z="cbox",te=z+"element",ee=z+"_open",ie=z+"_load",ne=z+"_complete",oe=z+"_cleanup",re=z+"_closed",he=z+"_purge",ae=t("
"),se="div",le=0,de={},ce=function(){function t(){cleartimeout(h)}function e(){(_.get("loop")||w[a+1])&&(t(),h=settimeout(j.next,_.get("slideshowspeed")))}function i(){s.html(_.get("slideshowstop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeclass(a+"off").addclass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),s.html(_.get("slideshowstart")).unbind(s).one(s,function(){j.next(),i()}),x.removeclass(a+"on").addclass(a+"off")}function o(){r=!1,s.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeclass(a+"off "+a+"on")}var r,h,a=z+"slideshow_",s="click."+z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&w[1]&&(r=!0,ae.one(oe,o),_.get("slideshowauto")?i():n(),s.show())}}();t[y]||(t(p),j=t.fn[y]=t[y]=function(e,i){var n,o=this;return e=e||{},t.isfunction(o)&&(o=t("
"),e.open=!0),o[0]?(p(),m()&&(i&&(e.oncomplete=i),o.each(function(){var i=t.data(this,y)||{};t.data(this,y,t.extend(i,e))}).addclass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},j.position=function(e,i){function n(){t[0].style.width=k[0].style.width=b[0].style.width=parseint(x[0].style.width,10)-d+"px",b[0].style.height=c[0].style.height=h[0].style.height=parseint(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(e.unbind("resize."+z),x.css({top:-9e4,left:-9e4}),h=e.scrolltop(),s=e.scrollleft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?math.max(e.width()-_.w-z-d-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):math.round(math.max(e.width()-_.w-z-d,0)/2),l+=_.get("bottom")!==!1?math.max(o()-_.h-n-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):math.round(math.max(o()-_.h-n-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+d,height:_.h+n+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+d+"px",y[0].style.height=_.h+n+j+"px",_.get("reposition")&&settimeout(function(){e.bind("resize."+z,j.position)},1),t.isfunction(i)&&i()},step:n})},j.resize=function(t){var e;u&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-d),t.innerwidth&&(_.w=a(t.innerwidth,"x")),i.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-n-j),t.innerheight&&(_.h=a(t.innerheight,"y")),t.innerheight||t.height||(e=i.scrolltop(),i.css({height:"auto"}),_.h=i.height()),i.css({height:_.h}),e&&i.scrolltop(e),j.position("none"===_.get("transition")?0:_.get("speed")))},j.prep=function(i){function o(){return _.w=_.w||i.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||i.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(u){var d,g="none"===_.get("transition")?0:_.get("speed");i.remove(),i=n(se,"loadedcontent").append(i),i.hide().appendto(m.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependto(b),m.hide(),t(q).css({"float":"none"}),c(_.get("classname")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeattribute("filter")}var n,o,a=w.length;u&&(o=function(){cleartimeout(q),l.hide(),u(ne),_.get("oncomplete")},f.html(_.get("title")).show(),i.show(),a>1?("string"==typeof _.get("current")&&r.html(_.get("current").replace("{current}",a+1).replace("{total}",a)).show(),k[_.get("loop")||a-1>a?"show":"hide"]().html(_.get("next")),p[_.get("loop")||a?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=w[this],o=new r(n,t.data(n,y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createelement("img"),i.src=h)})):o.hide(),_.get("iframe")?(n=_.get("createiframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":z+"iframe"}).one("load",o).appendto(i),ae.one(he,function(){n.src="//about:blank"}),_.get("fastiframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeto(g,1,i):i())},"fade"===_.get("transition")?x.fadeto(g,0,function(){j.position(0,d)}):j.position(g,d)}},j.next=function(){!$&&w[1]&&(_.get("loop")||w[a+1])&&(a=h(1),f(w[a]))},j.prev=function(){!$&&w[1]&&(_.get("loop")||a)&&(a=h(-1),f(w[a]))},j.close=function(){u&&!g&&(g=!0,u=!1,u(oe),_.get("oncleanup"),e.unbind("."+z),v.fadeto(_.get("fadeout")||0,0),x.stop().fadeto(_.get("fadeout")||0,0,function(){x.hide(),v.hide(),u(he),i.remove(),settimeout(function(){g=!1,u(re),_.get("onclosed")},1)}))},j.remove=function(){x&&(x.stop(),t[y].close(),x.stop(!1,!0).remove(),v.remove(),g=!1,x=null,t("."+te).removedata(y).removeclass(te),t(e).unbind("click."+z).unbind("keydown."+z))},j.element=function(){return t(_.el)},j.settings=x)})(jquery,document,window);