/*
	Slimbox v1.71 - The ultimate lightweight Lightbox clone
	(c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
	MIT-style license.
*/
var Slimbox=(function(){var k=window,O=Browser.Engine.trident4,W,G,l=-1,P,a,j,X,c,r,T,N={},V=new Image(),p=new Image(),n,B,H,R,o,E,m,C,f,q,U,Y,g,L,Z,b,I,D,h;k.addEvent("domready",function(){$(document.body).adopt($$(n=new Element("div",{id:"lbOverlay",events:{click:i}}),B=new Element("div",{id:"lbCenter"}),m=new Element("div",{id:"lbBottomContainer"})).setStyle("display","none"));H=new Element("div",{id:"lbImage"}).injectInside(B).adopt(R=new Element("div",{styles:{position:"relative"}}).adopt(o=new Element("a",{id:"lbPrevLink",href:"#",events:{click:d}}),E=new Element("a",{id:"lbNextLink",href:"#",events:{click:F}})));C=new Element("div",{id:"lbBottom"}).injectInside(m).adopt(L=new Element("div",{id:"lbCloseBox",href:"#",events:{click:i}}),imgInfo=new Element("div",{id:"lbImgInfo"}),new Element("div",{styles:{clear:"both"}}));Z=new Element("a").injectInside(L);U=new Element("span").injectInside(imgInfo);Y=new Element("span").injectInside(imgInfo);g=new Element("span").injectInside(imgInfo);q=new Element("span",{id:"lbNumber"}).injectInside(imgInfo);U.className="date month";Y.className="date year";g.className="name";});function e(){var s=k.getScroll(),t=k.getSize();$$(B,m).setStyle("left",s.x+(t.x/2));if(X){n.setStyles({left:s.x,top:s.y,width:t.x,height:t.y});}}function M(s){["object",O?"select":"embed"].forEach(function(u){Array.forEach(document.getElementsByTagName(u),function(v){if(s){v._slimbox=v.style.visibility;}v.style.visibility=s?"hidden":v._slimbox;});});n.style.display=s?"":"none";var t=s?"addEvent":"removeEvent";k[t]("scroll",e)[t]("resize",e);document[t]("keydown",Q);}function Q(t){var s=t.code;return W.closeKeys.contains(s)?i():W.nextKeys.contains(s)?F():W.previousKeys.contains(s)?d():false;}function d(){return A(a);}function F(){return A(j);}function A(s){if(s>=0){l=s;P=G[s][0];a=(l||(W.loop?G.length:0))-1;j=((l+1)%G.length)||(W.loop?0:-1);S();B.className="lbLoading";N=new Image();N.onload=K;N.src=P;}return false;}function K(){B.className="";D.set(0);H.setStyles({backgroundImage:"url("+P+")",display:""});R.setStyle("width",N.width);$$(R,o,E).setStyle("height",N.height);var t=G[l][1].split(" | ");U.set("html",t[0]+"/"||"");Y.set("html",t[1]||"");g.set("html",t[2]||"");Z.set("html","close");q.set("html",(((G.length>1)&&W.counterText)||"").replace(/{x}/,l+1).replace(/{y}/,G.length));if(a>=0){V.src=G[a][0];}if(j>=0){p.src=G[j][0];}r=H.offsetWidth;T=H.offsetHeight;var v=Math.max(0,c-(T/2)),s=0,u;if(B.offsetHeight!=T){s=I.start({height:T,top:v-10});}if(B.offsetWidth!=r){s=I.start({width:r,marginLeft:-r/2});}u=function(){m.setStyles({width:r,top:v,marginLeft:-r/2,visibility:"hidden",display:""});D.start(1);};if(s){I.chain(u);}else{u();}}function J(){if(a>=0){o.style.display="";}if(j>=0){E.style.display="";}h.set(-C.offsetHeight).start(0);m.style.visibility="";}function S(){N.onload=$empty;N.src=V.src=p.src=P;I.cancel();D.cancel();h.cancel();$$(o,E,H,m).setStyle("display","none");}function i(){if(l>=0){S();l=a=j=-1;B.style.display="none";b.cancel().chain(M).start(0);}return false;}Element.implement({slimbox:function(s,t){$$(this).slimbox(s,t);return this;}});Elements.implement({slimbox:function(s,v,u){v=v||function(w){return[w.href,w.title];};u=u||function(){return true;};var t=this;t.removeEvents("click").addEvent("click",function(){var w=t.filter(u,this);return Slimbox.open(w.map(v),w.indexOf(this),s);});return t;}});return{open:function(u,t,s){W=$extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},s||{});b=new Fx.Tween(n,{property:"opacity",duration:W.overlayFadeDuration});I=new Fx.Morph(B,$extend({duration:W.resizeDuration,link:"chain"},W.resizeTransition?{transition:W.resizeTransition}:{}));D=new Fx.Tween(H,{property:"opacity",duration:W.imageFadeDuration,onComplete:J});h=new Fx.Tween(C,{property:"margin-top",duration:W.captionAnimationDuration});if(typeof u=="string"){u=[[u,t]];t=0;}c=k.getScrollTop()+(k.getHeight()/2);r=W.initialWidth;T=W.initialHeight;B.setStyles({top:Math.max(0,c-(T/2)),width:r,height:T,marginLeft:-r/2,display:""});X=O||(n.currentStyle&&(n.currentStyle.position!="fixed"));if(X){n.style.position="absolute";}b.set(0).start(W.overlayOpacity);e();M(1);G=u;W.loop=W.loop&&(G.length>1);return A(t);}};})();
