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