// ColorBox v1.3.19.3 - jQuery lightbox plugin
// (c) 2011 Jack Moore - jacklmoore.com
// License: http://www.opensource.org/licenses/mit-license.php
(function(b,A,aa){function d(a,f,d){a=A.createElement(a);f&&(a.id=o+f);d&&(a.style.cssText=d);return b(a)}function J(a){var f=l.length,a=(p+a)%f;return 0>a?f+a:a}function n(a,f){return Math.round((/%/.test(a)?("x"===f?h.width():h.height())/100:1)*parseInt(a,10))}function ba(e){return a.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(e)}function ca(){var e,f=b.data(k,q);null==f?(a=b.extend({},O),console&&console.log&&console.log("Error: cboxElement missing settings object")):a=b.extend({},f);
for(e in a)b.isFunction(a[e])&&"on"!==e.slice(0,2)&&(a[e]=a[e].call(k));a.rel=a.rel||k.rel||"nofollow";a.href=a.href||b(k).attr("href");a.title=a.title||k.title;"string"===typeof a.href&&(a.href=b.trim(a.href))}function y(a,f){b.event.trigger(a);f&&f.call(k)}function ia(){var e,f=o+"Slideshow_",b="click."+o,d,c;a.slideshow&&l[1]?(d=function(){B.text(a.slideshowStop).unbind(b).bind(P,function(){if(a.loop||l[p+1])e=setTimeout(g.next,a.slideshowSpeed)}).bind(Q,function(){clearTimeout(e)}).one(b+" "+
K,c);i.removeClass(f+"off").addClass(f+"on");e=setTimeout(g.next,a.slideshowSpeed)},c=function(){clearTimeout(e);B.text(a.slideshowStart).unbind([P,Q,K,b].join(" ")).one(b,function(){g.next();d()});i.removeClass(f+"on").addClass(f+"off")},a.slideshowAuto?d():c()):i.removeClass(f+"off "+f+"on")}function da(e){if(!L){k=e;ca();l=b(k);p=0;"nofollow"!==a.rel&&(l=b("."+C).filter(function(){var e=b.data(this,q),d;e&&(d=e.rel||this.rel);return d===a.rel}),p=l.index(k),-1===p&&(l=l.add(k),p=l.length-1));if(!r){r=
D=!0;i.show();if(a.returnFocus)b(k).blur().one(ea,function(){b(this).focus()});v.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":"auto"}).show();a.w=n(a.initialWidth,"x");a.h=n(a.initialHeight,"y");g.position();E&&h.bind("resize."+M+" scroll."+M,function(){v.css({width:h.width(),height:h.height(),top:h.scrollTop(),left:h.scrollLeft()})}).trigger("resize."+M);y(fa,a.onOpen);R.add(S).hide();T.html(a.close).show()}g.load(!0)}}function ga(){!i&&A.body&&(U=!1,h=b(aa),i=d(c).attr({id:q,"class":F?
o+(E?"IE6":"IE"):""}).hide(),v=d(c,"Overlay",E?"position:absolute":"").hide(),z=d(c,"Wrapper"),s=d(c,"Content").append(m=d(c,"LoadedContent","width:0; height:0; overflow:hidden"),V=d(c,"LoadingOverlay").add(d(c,"LoadingGraphic")),S=d(c,"Title"),W=d(c,"Current"),G=d(c,"Next"),H=d(c,"Previous"),B=d(c,"Slideshow").bind(fa,ia),T=d(c,"Close")),z.append(d(c).append(d(c,"TopLeft"),X=d(c,"TopCenter"),d(c,"TopRight")),d(c,!1,"clear:left").append(Y=d(c,"MiddleLeft"),s,Z=d(c,"MiddleRight")),d(c,!1,"clear:left").append(d(c,
"BottomLeft"),$=d(c,"BottomCenter"),d(c,"BottomRight"))).find("div div").css({"float":"left"}),I=d(c,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),R=G.add(H).add(W).add(B),b(A.body).append(v,i.append(z,I)))}function ja(){return i?(U||(U=!0,w=X.height()+$.height()+s.outerHeight(!0)-s.height(),x=Y.width()+Z.width()+s.outerWidth(!0)-s.width(),t=m.outerHeight(!0),u=m.outerWidth(!0),i.css({"padding-bottom":w,"padding-right":x}),G.click(function(){g.next()}),H.click(function(){g.prev()}),
T.click(function(){g.close()}),v.click(function(){a.overlayClose&&g.close()}),b(A).bind("keydown."+o,function(e){var b=e.keyCode;r&&(a.escKey&&27===b)&&(e.preventDefault(),g.close());r&&(a.arrowKey&&l[1])&&(37===b?(e.preventDefault(),H.click()):39===b&&(e.preventDefault(),G.click()))}),b("."+C,A).live("click",function(a){1<a.which||(a.shiftKey||a.altKey||a.metaKey)||(a.preventDefault(),da(this))})),!0):!1}var O={transition:"elastic",speed: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:0.9,preloading:!0,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,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",
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},q="colorbox",o="cbox",C=o+"Element",fa=o+"_open",Q=o+"_load",P=o+"_complete",K=o+"_cleanup",ea=o+"_closed",N=o+"_purge",F=!b.support.opacity&&!b.support.style,E=F&&!aa.XMLHttpRequest,M=o+"_IE6",v,i,z,s,X,Y,Z,$,l,h,m,I,V,S,W,B,G,H,T,R,a,w,x,t,u,k,p,j,r,D,L,ha,g,c="div",U;b.colorbox||(b(ga),g=b.fn[q]=b[q]=function(a,d){var c=this,a=a||{};ga();if(ja()){if(!c[0]){if(c.selector)return c;
c=b("<a/>");a.open=!0}d&&(a.onComplete=d);c.each(function(){b.data(this,q,b.extend({},b.data(this,q)||O,a))}).addClass(C);(b.isFunction(a.open)&&a.open.call(c)||a.open)&&da(c[0])}return c},g.position=function(b,d){function c(a){X[0].style.width=$[0].style.width=s[0].style.width=a.style.width;s[0].style.height=Y[0].style.height=Z[0].style.height=a.style.height}var j=0,l=0,m=i.offset(),p,k;h.unbind("resize."+o);i.css({top:-9E4,left:-9E4});p=h.scrollTop();k=h.scrollLeft();a.fixed&&!E?(m.top-=p,m.left-=
k,i.css({position:"fixed"})):(j=p,l=k,i.css({position:"absolute"}));l=!1!==a.right?l+Math.max(h.width()-a.w-u-x-n(a.right,"x"),0):!1!==a.left?l+n(a.left,"x"):l+Math.round(Math.max(h.width()-a.w-u-x,0)/2);j=!1!==a.bottom?j+Math.max(h.height()-a.h-t-w-n(a.bottom,"y"),0):!1!==a.top?j+n(a.top,"y"):j+Math.round(Math.max(h.height()-a.h-t-w,0)/2);i.css({top:m.top,left:m.left});b=i.width()===a.w+u&&i.height()===a.h+t?0:b||0;z[0].style.width=z[0].style.height="9999px";i.dequeue().animate({width:a.w+u,height:a.h+
t,top:j,left:l},{duration:b,complete:function(){c(this);D=false;z[0].style.width=a.w+u+x+"px";z[0].style.height=a.h+t+w+"px";a.reposition&&setTimeout(function(){h.bind("resize."+o,g.position)},1);d&&d()},step:function(){c(this)}})},g.resize=function(b){r&&(b=b||{},b.width&&(a.w=n(b.width,"x")-u-x),b.innerWidth&&(a.w=n(b.innerWidth,"x")),m.css({width:a.w}),b.height&&(a.h=n(b.height,"y")-t-w),b.innerHeight&&(a.h=n(b.innerHeight,"y")),!b.innerHeight&&!b.height&&(m.css({height:"auto"}),a.h=m.height()),
m.css({height:a.h}),g.position("none"===a.transition?0:a.speed))},g.prep=function(e){function f(){a.w=a.w||m.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function h(){a.h=a.h||m.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}if(r){var k,n="none"===a.transition?0:a.speed;m.remove();m=d(c,"LoadedContent").append(e);m.hide().appendTo(I.show()).css({width:f(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(s);I.hide();b(j).css({"float":"none"});if(E)b("select").not(i.find("select")).filter(function(){return"hidden"!==
this.style.visibility}).css({visibility:"hidden"}).one(K,function(){this.style.visibility="inherit"});k=function(){function c(){F&&i[0].style.removeAttribute("filter")}var f,g;f=l.length;var e,k,h;if(r){k=function(){clearTimeout(ha);V.hide();y(P,a.onComplete)};F&&j&&m.fadeIn(100);S.html(a.title).add(m).show();if(1<f){if("string"===typeof a.current&&W.html(a.current.replace("{current}",p+1).replace("{total}",f)).show(),G[a.loop||p<f-1?"show":"hide"]().html(a.next),H[a.loop||p?"show":"hide"]().html(a.previous),
a.slideshow&&B.show(),a.preloading)for(f=[J(-1),J(1)];g=l[f.pop()];)if((h=b.data(g,q))&&h.href?(h=h.href,b.isFunction(h)&&(h=h.call(g))):h=g.href,ba(h))g=new Image,g.src=h}else R.hide();if(a.iframe){e=d("iframe")[0];"frameBorder"in e&&(e.frameBorder=0);"allowTransparency"in e&&(e.allowTransparency="true");e.name=o+ +new Date;if(a.fastIframe)k();else b(e).one("load",k);e.src=a.href;a.scrolling||(e.scrolling="no");b(e).addClass(o+"Iframe").appendTo(m).one(N,function(){e.src="//about:blank"})}else k();
"fade"===a.transition?i.fadeTo(n,1,c):c()}};"fade"===a.transition?i.fadeTo(n,0,function(){g.position(0,k)}):g.position(n,k)}},g.load=function(e){var f,h,i=g.prep;D=!0;j=!1;k=l[p];e||ca();y(N);y(Q,a.onLoad);a.h=a.height?n(a.height,"y")-t-w:a.innerHeight&&n(a.innerHeight,"y");a.w=a.width?n(a.width,"x")-u-x:a.innerWidth&&n(a.innerWidth,"x");a.mw=a.w;a.mh=a.h;a.maxWidth&&(a.mw=n(a.maxWidth,"x")-u-x,a.mw=a.w&&a.w<a.mw?a.w:a.mw);a.maxHeight&&(a.mh=n(a.maxHeight,"y")-t-w,a.mh=a.h&&a.h<a.mh?a.h:a.mh);f=a.href;
ha=setTimeout(function(){V.show()},100);a.inline?(d(c).hide().insertBefore(b(f)[0]).one(N,function(){b(this).replaceWith(m.children())}),i(b(f))):a.iframe?i(" "):a.html?i(a.html):ba(f)?(b(j=new Image).addClass(o+"Photo").error(function(){a.title=false;i(d(c,"Error").html(a.imgError))}).load(function(){var b;j.onload=null;if(a.scalePhotos){h=function(){j.height=j.height-j.height*b;j.width=j.width-j.width*b};if(a.mw&&j.width>a.mw){b=(j.width-a.mw)/j.width;h()}if(a.mh&&j.height>a.mh){b=(j.height-a.mh)/
j.height;h()}}if(a.h)j.style.marginTop=Math.max(a.h-j.height,0)/2+"px";if(l[1]&&(a.loop||l[p+1])){j.style.cursor="pointer";j.onclick=function(){g.next()}}if(F)j.style.msInterpolationMode="bicubic";setTimeout(function(){i(j)},1)}),setTimeout(function(){j.src=f},1)):f&&I.load(f,a.data,function(e,f){i(f==="error"?d(c,"Error").html(a.xhrError):b(this).contents())})},g.next=function(){if(!D&&l[1]&&(a.loop||l[p+1]))p=J(1),g.load()},g.prev=function(){if(!D&&l[1]&&(a.loop||p))p=J(-1),g.load()},g.close=function(){r&&
!L&&(L=!0,r=!1,y(K,a.onCleanup),h.unbind("."+o+" ."+M),v.fadeTo(200,0),i.stop().fadeTo(300,0,function(){i.add(v).css({opacity:1,cursor:"auto"}).hide();y(N);m.remove();setTimeout(function(){L=!1;y(ea,a.onClosed)},1)}))},g.remove=function(){b([]).add(i).add(v).remove();i=null;b("."+C).removeData(q).removeClass(C).die()},g.element=function(){return b(k)},g.settings=O)})(jQuery,document,this);