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

