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

