(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function L(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function X(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel||i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function Y(b){i=b;a=c.extend({},c(i).data(p));X();if(a.rel&&a.rel!=="nofollow"){g=
c(".cboxElement").filter(function(){return(c(this).data(p).rel||this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!C){D=C=n;M=i;M.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();E.click()}else if(d.keyCode===39){d.preventDefault();F.click()}});a.overlayClose&&u.css({cursor:"pointer"}).one("click",e.close);c.event.trigger($);
a.onOpen&&a.onOpen.call(i);u.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);N&&m.bind("resize.cboxie6 scroll.cboxie6",function(){u.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}O.add(E).add(F).add(v).add(P).hide();Q.html(a.close).show();e.slideshow();e.load()}var p="colorbox",G="hover",n=true,e,z=c.browser.msie&&!c.support.opacity,N=z&&c.browser.version<7,$="cbox_open",H="cbox_load",R=
"cbox_complete",S="resize.cbox_resize",u,k,w,o,T,U,V,W,g,m,l,I,J,K,P,O,v,F,E,Q,A,B,x,y,i,M,j,a,C,D,Z={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,aspect:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,
overlayClose:n,slideshow:false,slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("<a/>");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(p)?c(this).data(p):Z,b);c(this).data(p,f).addClass("cboxElement");if(d)c(this).data(p).onComplete=d});b&&b.open&&Y(h);return this};e.init=
function(){function b(d){return c('<div id="cbox'+d+'"/>')}m=c(window);k=c('<div id="colorbox"/>');u=b("Overlay").hide();w=b("Wrapper");o=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),P=b("Title"),O=b("Current"),v=b("Slideshow"),F=b("Next"),E=b("Previous"),Q=b("Close"));w.append(c("<div/>").append(b("TopLeft"),T=b("TopCenter"),b("TopRight")),c("<div/>").append(U=b("MiddleLeft"),o,V=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),
W=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});I=c("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");c("body").prepend(u,k.append(w,I));if(z){k.addClass("cboxIE");N&&u.css("position","absolute")}o.children().bind("mouseover mouseout",function(){c(this).toggleClass(G)}).addClass(G);A=T.height()+W.height()+o.outerHeight(n)-o.height();B=U.width()+V.width()+o.outerWidth(n)-o.width();x=l.outerHeight(n);y=l.outerWidth(n);k.css({"padding-bottom":A,
"padding-right":B}).hide();F.click(e.next);E.click(e.prev);Q.click(e.close);o.children().removeClass(G);c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Y(this);return false}})};e.position=function(b,d){function h(s){T[0].style.width=W[0].style.width=o[0].style.width=s.style.width;K[0].style.height=J[0].style.height=o[0].style.height=U[0].style.height=V[0].style.height=s.style.height}var f;f=m.height();var q=Math.max(f-a.h-x-A,0)/2+m.scrollTop(),
t=Math.max(document.documentElement.clientWidth-a.w-y-B,0)/2+m.scrollLeft();f=k.width()===a.w+y&&k.height()===a.h+x?0:b;w[0].style.width=w[0].style.height="9999px";k.dequeue().animate({width:a.w+y,height:a.h+x,top:q,left:t},{duration:f,complete:function(){h(this);D=false;w[0].style.width=a.w+y+B+"px";w[0].style.height=a.h+x+A+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}function h(s){e.position(s,function(){if(C){if(z){q&&
l.fadeIn(100);k[0].style.removeAttribute("filter")}if(a.iframe)l.append("<iframe id='cboxIframe'"+(a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+a.href+"' "+(z?"allowtransparency='true'":"")+" />");l.show();P.show().html(a.title);if(g.length>1){O.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();F.html(a.next).show();E.html(a.previous).show();a.slideshow&&v.show()}J.hide();K.hide();c.event.trigger(R);a.onComplete&&a.onComplete.call(i);
a.transition==="fade"&&k.fadeTo(t,1,function(){z&&k[0].style.removeAttribute("filter")});m.bind(S,function(){e.position(0)})}})}if(C){var f,q,t=a.transition==="none"?0:a.speed;m.unbind(S);if(b){l.remove();l=c('<div id="cboxLoadedContent"/>').html(b);l.hide().appendTo(I).css({width:function(){a.w=a.w||l.width();a.w=a.aspect&&a.w<Math.round(d()*a.aspect)?Math.round(d()*a.aspect):a.w;a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?"auto":"hidden"}).css({height:d()}).prependTo(o);c("#cboxPhoto").css({cssFloat:"none"});
N&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition==="fade"&&k.fadeTo(t,0,function(){h(0)})||h(t);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];f=j<g.length-1?g[j+1]:g[0];f=c(f).data(p).href||f.href;b=c(b).data(p).href||b.href;L(f)&&c("<img />").attr("src",f);L(b)&&c("<img />").attr("src",b)}}else setTimeout(function(){var s=l.wrapInner("<div style='overflow:auto'></div>").children();
a.h=s.height();l.css({height:a.h});s.replaceWith(s.children());e.position(t)},1)}};e.load=function(){var b,d,h,f=e.resize;D=n;i=g[j];a=c.extend({},c(i).data(p));X();c.event.trigger(H);a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-x-A:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-y-B:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-y-B;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=r(a.maxHeight,"y")-x-A;a.mh=a.h&&a.h<
a.mh?a.h:a.mh}b=a.href;J.show();K.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())});f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(L(b)){d=new Image;d.onload=function(){var q;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*q;d.width-=d.width*q};if(a.mw&&d.width>a.mw){q=(d.width-
a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){q=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next);if(z)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").appendTo(I).load(b,function(q,t){t==="success"?f(this):f(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!D){j=j<g.length-1?j+1:0;e.load()}};e.prev=function(){if(!D){j=j>0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){v.text(a.slideshowStop).bind(R,
function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(G)});k.removeClass(f+"off").addClass(f+"on")}var d,h,f="cboxSlideshow_";v.bind("cbox_closed",function(){v.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);v.text(a.slideshowStart).unbind(R+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(G)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&
g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);C=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows");m.unbind(S+" resize.cboxie6 scroll.cboxie6");u.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{M.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};
e.settings=Z;c(e.init)})(jQuery);

