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