/*!
colorbox v1.4.27 - 2013-07-16
jquery lightbox and modal window plugin
(c) 2013 jack moore - http://www.jacklmoore.com/colorbox
license: http://www.opensource.org/licenses/mit-license.php
*/
(function(t,e,i){function o(i,o,n){var r=e.createelement(i);return o&&(r.id=te+o),n&&(r.style.csstext=n),t(r)}function n(){return i.innerheight?i.innerheight:t(i).height()}function r(t){var e=e.length,i=(j+t)%e;return 0>i?e+i:i}function l(t,e){return math.round((/%/.test(t)?("x"===e?h.width():n())/100:1)*parseint(t,10))}function h(t,e){return t.photo||t.photoregex.test(e)}function s(t,e){return t.retinaurl&&i.devicepixelratio>1?e.replace(t.photoregex,t.retinasuffix):e}function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stoppropagation(),v.focus())}function d(){var e,i=t.data(a,z);null==i?(o=t.extend({},y),console&&console.log&&console.log("error: cboxelement missing settings object")):o=t.extend({},i);for(e in o)t.isfunction(o[e])&&"on"!==e.slice(0,2)&&(o[e]=o[e].call(a));o.rel=o.rel||a.rel||t(a).data("rel")||"nofollow",o.href=o.href||t(a).attr("href"),o.title=o.title||a.title,"string"==typeof o.href&&(o.href=t.trim(o.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isfunction(o)&&o.call(a)}function u(){var t,e,i,o,n,r=te+"slideshow_",l="click."+te;o.slideshow&&e[1]?(e=function(){cleartimeout(t)},i=function(){(o.loop||e[j+1])&&(t=settimeout(j.next,o.slideshowspeed))},o=function(){r.html(o.slideshowstop).unbind(l).one(l,n),se.bind(ne,i).bind(oe,e).bind(re,n),v.removeclass(r+"off").addclass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),r.html(o.slideshowstart).unbind(l).one(l,function(){j.next(),o()}),v.removeclass(r+"on").addclass(r+"off")},o.slideshowauto?o():n()):v.removeclass(r+"off "+r+"on")}function p(i){g||(a=i,d(),e=t(a),j=0,"nofollow"!==o.rel&&(e=t("."+ee).filter(function(){var e,i=t.data(this,z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===o.rel}),j=e.index(a),-1===j&&(e=e.add(a),j=e.length-1)),g.css({opacity:parsefloat(o.opacity),cursor:o.overlayclose?"pointer":"auto",visibility:"visible"}).show(),v&&v.add(g).removeclass(v),o.classname&&v.add(g).addclass(o.classname),v=o.classname,o.closebutton?p.html(o.close).appendto(x):p.appendto("
"),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),w=o(ae,"loadedcontent","width:0; height:0; overflow:hidden"),x.css({width:"",height:""}).append(w),_=b.height()+k.height()+x.outerheight(!0)-x.height(),d=t.width()+c.width()+x.outerwidth(!0)-x.width(),n=w.outerheight(!0),z=w.outerwidth(!0),o.w=l(o.initialwidth,"x"),o.h=l(o.initialheight,"y"),j.position(),u(),c(ie,o.onopen),b.add(s).hide(),v.focus(),o.trapfocus&&e.addeventlistener&&(e.addeventlistener("focus",a,!0),se.one(le,function(){e.removeeventlistener("focus",a,!0)})),o.returnfocus&&se.one(le,function(){t(a).focus()})),w())}function f(){!v&&e.body&&(x=!1,h=t(i),v=o(ae).attr({id:z,"class":t.support.opacity===!1?te+"ie":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"overlay").hide(),l=t([o(ae,"loadingoverlay")[0],o(ae,"loadinggraphic")[0]]),y=o(ae,"wrapper"),x=o(ae,"content").append(s=o(ae,"title"),m=o(ae,"current"),k=t('').attr({id:te+"previous"}),i=t('').attr({id:te+"next"}),r=o("button","slideshow"),l),p=t('').attr({id:te+"close"}),y.append(o(ae).append(o(ae,"topleft"),b=o(ae,"topcenter"),o(ae,"topright")),o(ae,!1,"clear:left").append(t=o(ae,"middleleft"),x,c=o(ae,"middleright")),o(ae,!1,"clear:left").append(o(ae,"bottomleft"),k=o(ae,"bottomcenter"),o(ae,"bottomright"))).find("div div").css({"float":"left"}),f=o(ae,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),b=i.add(k).add(m).add(r),t(e.body).append(g,v.append(y,f)))}function m(){function i(t){t.which>1||t.shiftkey||t.altkey||t.metakey||t.ctrlkey||(t.preventdefault(),p(this))}return v?(x||(x=!0,i.click(function(){j.next()}),k.click(function(){j.prev()}),p.click(function(){j.close()}),g.click(function(){o.overlayclose&&j.close()}),t(e).bind("keydown."+te,function(t){var e=t.keycode;$&&o.esckey&&27===e&&(t.preventdefault(),j.close()),$&&o.arrowkey&&e[1]&&!t.altkey&&(37===e?(t.preventdefault(),k.click()):39===e&&(t.preventdefault(),i.click()))}),t.isfunction(t.fn.on)?t(e).on("click."+te,"."+ee,i):t("."+ee).live("click."+te,i)),!0):!1}function w(){var n,r,a,u=j.prep,p=++de;q=!0,u=!1,a=e[j],d(),c(he),c(oe,o.onload),o.h=o.height?l(o.height,"y")-n-_:o.innerheight&&l(o.innerheight,"y"),o.w=o.width?l(o.width,"x")-z-d:o.innerwidth&&l(o.innerwidth,"x"),o.mw=o.w,o.mh=o.h,o.maxwidth&&(o.mw=l(o.maxwidth,"x")-z-d,o.mw=o.w&&o.w1&&(u.height=u.height/i.devicepixelratio,u.width=u.width/i.devicepixelratio),o.scalephotos&&(r=function(){u.height-=u.height*e,u.width-=u.width*e},o.mw&&u.width>o.mw&&(e=(u.width-o.mw)/u.width,r()),o.mh&&u.height>o.mh&&(e=(u.height-o.mh)/u.height,r())),o.h&&(u.style.margintop=math.max(o.mh-u.height,0)/2+"px"),e[1]&&(o.loop||e[j+1])&&(u.style.cursor="pointer",u.onclick=function(){j.next()}),u.style.width=u.width+"px",u.style.height=u.height+"px",settimeout(function(){u(u)},1))}),settimeout(function(){u.src=n},1)):n&&f.load(n,o.data,function(e,i){p===de&&u("error"===i?o(ae,"error").html(o.xhrerror):t(this).contents())})}var g,v,y,x,b,t,c,k,e,h,w,f,l,s,m,r,i,k,p,b,o,_,d,n,z,a,j,u,$,q,g,q,j,v,x,y={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:void 0,closebutton:!0},z="colorbox",te="cbox",ee=te+"element",ie=te+"_open",oe=te+"_load",ne=te+"_complete",re=te+"_cleanup",le=te+"_closed",he=te+"_purge",se=t(""),ae="div",de=0,ce={};t.colorbox||(t(f),j=t.fn[z]=t[z]=function(e,i){var o=this;if(e=e||{},f(),m()){if(t.isfunction(o))o=t(""),e.open=!0;else if(!o[0])return o;i&&(e.oncomplete=i),o.each(function(){t.data(this,z,t.extend({},t.data(this,z)||y,e))}).addclass(ee),(t.isfunction(e.open)&&e.open.call(o)||e.open)&&p(o[0])}return o},j.position=function(e,i){function o(){b[0].style.width=k[0].style.width=x[0].style.width=parseint(v[0].style.width,10)-d+"px",x[0].style.height=t[0].style.height=c[0].style.height=parseint(v[0].style.height,10)-_+"px"}var r,h,s,a=0,d=0,c=v.offset();if(h.unbind("resize."+te),v.css({top:-9e4,left:-9e4}),h=h.scrolltop(),s=h.scrollleft(),o.fixed?(c.top-=h,c.left-=s,v.css({position:"fixed"})):(a=h,d=s,v.css({position:"absolute"})),d+=o.right!==!1?math.max(h.width()-o.w-z-d-l(o.right,"x"),0):o.left!==!1?l(o.left,"x"):math.round(math.max(h.width()-o.w-z-d,0)/2),a+=o.bottom!==!1?math.max(n()-o.h-n-_-l(o.bottom,"y"),0):o.top!==!1?l(o.top,"y"):math.round(math.max(n()-o.h-n-_,0)/2),v.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:o.w+z+d,height:o.h+n+_,top:a,left:d},e){var u=0;t.each(r,function(t){return r[t]!==ce[t]?(u=e,void 0):void 0}),e=u}ce=r,e||v.css(r),v.dequeue().animate(r,{duration:e||0,complete:function(){o(),q=!1,y[0].style.width=o.w+z+d+"px",y[0].style.height=o.h+n+_+"px",o.reposition&&settimeout(function(){h.bind("resize."+te,j.position)},1),i&&i()},step:o})},j.resize=function(t){var e;$&&(t=t||{},t.width&&(o.w=l(t.width,"x")-z-d),t.innerwidth&&(o.w=l(t.innerwidth,"x")),w.css({width:o.w}),t.height&&(o.h=l(t.height,"y")-n-_),t.innerheight&&(o.h=l(t.innerheight,"y")),t.innerheight||t.height||(e=w.scrolltop(),w.css({height:"auto"}),o.h=w.height()),w.css({height:o.h}),e&&w.scrolltop(e),j.position("none"===o.transition?0:o.speed))},j.prep=function(i){function n(){return o.w=o.w||w.width(),o.w=o.mw&&o.mw1?("string"==typeof o.current&&m.html(o.current.replace("{current}",j+1).replace("{total}",a)).show(),i[o.loop||a-1>j?"show":"hide"]().html(o.next),k[o.loop||j?"show":"hide"]().html(o.previous),o.slideshow&&r.show(),o.preloading&&t.each([r(-1),r(1)],function(){var i,o,n=e[this],r=t.data(n,z);r&&r.href?(i=r.href,t.isfunction(i)&&(i=i.call(n))):i=t(n).attr("href"),i&&h(r,i)&&(i=s(r,i),o=e.createelement("img"),o.src=i)})):b.hide(),o.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),p in n&&(n[p]="true"),o.scrolling||(n.scrolling="no"),t(n).attr({src:o.href,name:(new date).gettime(),"class":te+"iframe",allowfullscreen:!0,webkitallowfullscreen:!0,mozallowfullscreen:!0}).one("load",l).appendto(w),se.one(he,function(){n.src="//about:blank"}),o.fastiframe&&t(n).trigger("load")):l(),"fade"===o.transition?v.fadeto(d,1,i):i())},"fade"===o.transition?v.fadeto(d,0,function(){j.position(0,a)}):j.position(d,a)}},j.next=function(){!q&&e[1]&&(o.loop||e[j+1])&&(j=r(1),p(e[j]))},j.prev=function(){!q&&e[1]&&(o.loop||j)&&(j=r(-1),p(e[j]))},j.close=function(){$&&!g&&(g=!0,$=!1,c(re,o.oncleanup),h.unbind("."+te),g.fadeto(o.fadeout||0,0),v.stop().fadeto(o.fadeout||0,0,function(){v.add(g).css({opacity:1,cursor:"auto"}).hide(),c(he),w.empty().remove(),settimeout(function(){g=!1,c(le,o.onclosed)},1)}))},j.remove=function(){v&&(v.stop(),t.colorbox.close(),v.stop().remove(),g.remove(),g=!1,v=null,t("."+ee).removedata(z).removeclass(ee),t(e).unbind("click."+te))},j.element=function(){return t(a)},j.settings=y)})(jquery,document,window);