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

