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