Your IP : 172.28.240.42


Current Path : /var/www/html/clients/kampol.e-nk.ru/plugins/content/sigplus/engines/slimbox/js/
Upload File :
Current File : /var/www/html/clients/kampol.e-nk.ru/plugins/content/sigplus/engines/slimbox/js/slimbox.min.js

/*

 Slimbox v1.58 - The ultimate lightweight Lightbox clone
 (c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
 MIT-style license.
*/
var Slimbox=function(){function x(){var a=e.getScrollLeft(),b=D?E.clientWidth:e.getWidth();$$(f,p).setStyle("left",a+b/2);F&&i.setStyles({left:a,top:e.getScrollTop(),width:b,height:e.getHeight()})}function G(a){["object",e.ie6?"select":"embed"].forEach(function(l){$each(document.getElementsByTagName(l),function(j){if(a)j._slimbox=j.style.visibility;j.style.visibility=a?"hidden":j._slimbox})});i.style.display=a?"":"none";var b=a?"addEvent":"removeEvent";e[b]("scroll",x)[b]("resize",x);document[b]("keydown",
Q)}function H(){return y(q)}function I(){return y(r)}function y(a){if(a>=0){m=a;v=g[a][0];q=(m||(c.loop?g.length:0))-1;r=(m+1)%g.length||(c.loop?0:-1);J();f.className="lbLoading";n=new Image;n.onload=R;n.src=v}return false}function R(){f.className="";w.set(0);o.setStyles({width:n.width,backgroundImage:"url("+v+")",display:""});$$(o,s,t).setStyle("height",n.height);K.setHTML(g[m][1]||"");L.setHTML((g.length>1&&c.counterText||"").replace(/{x}/,m+1).replace(/{y}/,g.length));if(q>=0)M.src=g[q][0];if(r>=
0)N.src=g[r][0];h=o.offsetWidth;k=o.offsetHeight;var a=Math.max(0,z-k/2);f.offsetHeight!=k&&d.chain(d.start.pass({height:k,top:a},d));f.offsetWidth!=h&&d.chain(d.start.pass({width:h,marginLeft:-h/2},d));d.chain(function(){p.setStyles({width:h,top:a+k,marginLeft:-h/2,visibility:"hidden",display:""});w.start(1)});d.callChain()}function S(){if(q>=0)s.style.display="";if(r>=0)t.style.display="";A.set(-B.offsetHeight).start(0);p.style.visibility=""}function J(){n.onload=Class.empty;n.src=M.src=N.src=v;
d.clearChain();d.stop();w.stop();A.stop();$$(s,t,o,p).setStyle("display","none")}function O(){if(m>=0){J();m=q=r=-1;f.style.display="none";C.stop().chain(G).start(0)}return false}var e=window,c,g,m=-1,v,q,r,F,z,h,k,Q=function(a){var b=a.code;if(c.closeKeys.contains(b))O();else if(c.nextKeys.contains(b))I();else c.previousKeys.contains(b)&&H();a.stop()}.bindWithEvent(),D=window.opera&&navigator.appVersion>="9.3",E=document.documentElement,n={},M=new Image,N=new Image,i,f,o,s,t,p,B,K,L,C,d,w,A;e.addEvent("domready",
function(){$(document.body).adopt($$(i=new Element("div",{id:"lbOverlay"}),f=new Element("div",{id:"lbCenter"}),p=new Element("div",{id:"lbBottomContainer"})).setStyle("display","none"));o=(new Element("div",{id:"lbImage"})).injectInside(f).adopt(s=new Element("a",{id:"lbPrevLink",href:"#"}),t=new Element("a",{id:"lbNextLink",href:"#"}));s.onclick=H;t.onclick=I;var a;B=(new Element("div",{id:"lbBottom"})).injectInside(p).adopt(a=new Element("a",{id:"lbCloseLink",href:"#"}),K=new Element("div",{id:"lbCaption"}),
L=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}));a.onclick=i.onclick=O});Element.extend({slimbox:function(a,b){$$(this).slimbox(a,b);return this}});Elements.extend({slimbox:function(a,b,l){b=b||function(u){return[u.href,u.title]};l=l||function(){return true};var j=this;j.forEach(function(u){u.removeEvents("click").addEvent("click",function(T){var P=j.filter(l,this);Slimbox.open(P.map(b),P.indexOf(this),a);T.stop()}.bindWithEvent(u))});return j}});return{open:function(a,
b,l){c=$extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"{x}/{y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},l||{});C=i.effect("opacity",{duration:c.overlayFadeDuration});d=f.effects($extend({duration:c.resizeDuration},c.resizeTransition?{transition:c.resizeTransition}:{}));w=o.effect("opacity",{duration:c.imageFadeDuration,onComplete:S});
A=B.effect("margin-top",{duration:c.captionAnimationDuration});if(typeof a=="string"){a=[[a,b]];b=0}z=e.getScrollTop()+(D?E.clientHeight:e.getHeight())/2;h=c.initialWidth;k=c.initialHeight;f.setStyles({top:Math.max(0,z-k/2),width:h,height:k,marginLeft:-h/2,display:""});if(F=e.ie6||i.currentStyle&&i.currentStyle.position!="fixed")i.style.position="absolute";C.set(0).start(c.overlayOpacity);x();G(1);g=a;c.loop=c.loop&&g.length>1;return y(b)}}}();