var bO={init:function(){this.kh=0;this.cG=0;this.cb=document.getElementById('worksDiv');this.dS=document.getElementById('next');this.ni=document.getElementById('prev');this.nj=document.getElementById('works');this.gU=this.nj.getElementsByTagName('table');this.nk=this.cb.getElementsByTagName('span');this.dS.onclick=function(){bO.dT()}
this.ni.onclick=function(){bO.nl()}
this.ni.style.cursor='pointer';this.ji()},ji:function(){if(!this.cb){return}
this.cb.style.top=this.nj.offsetTop+'px';this.cb.style.left=(this.left(this.cb.parentNode)*-1)+'px';this.cb.style.width=document.body.offsetWidth+'px';for(var b,c=2,a=this.nk.length-1;a>-1;a--){b=this.nk[a];b.style.marginTop=(b.offsetHeight*-1)+'px';if(a<this.kh){b.style.left=(b.offsetWidth*-1)+'px'}else if(a>this.kh+2){b.style.left=this.cb.offsetWidth+'px'}else{b.style.left=this.left(this.gU[c--])+'px'}}},dT:function(){if(this.cG||this.kh<1){return}
setTimeout(function(){bO.jw(bO.nk[bO.kh],bO.left(bO.gU[0]),20,5)},200);this.jw(bO.nk[this.kh],this.left(this.gU[1]),20,1);this.jw(bO.nk[this.kh+1],this.left(this.gU[2]),20,1);this.jw(bO.nk[this.kh+2],document.body.offsetWidth,20,10);this.kh-=1;this.cursor(this.dS,'/images/arrow-left-grey.png','default')},nl:function(){if(this.cG||this.kh+4>this.nk.length){return}
this.jw(bO.nk[this.kh],this.nk[this.kh].offsetWidth*-1,20,-10);this.jw(bO.nk[this.kh+1],this.left(this.gU[0]),20,-1);this.jw(bO.nk[this.kh+2],this.left(this.gU[1]),20,-1);setTimeout(function(){bO.jw(bO.nk[bO.kh+2],bO.left(bO.gU[2]),20,-5)},200);this.kh+=1;this.cursor(this.ni,'/images/arrow-right-grey.png','default')},lQ:function(a){clearInterval(a);this.cG--;if(this.cG<=0){this.cG=0;return}
if(this.kh==0){this.cursor(this.dS,'/images/arrow-left-grey.png','default')}else{this.cursor(this.dS,'/images/arrow-left-red.png','pointer')}
if(this.kh+4>this.nk.length){this.cursor(this.ni,'/images/arrow-right-grey.png','default')}else{this.cursor(this.ni,'/images/arrow-right-red.png','pointer')}},jw:function(a,b,c,d){this.cG++;var intervalId=setInterval(function(){bO.nm(a,b,d,intervalId)},c)},nm:function(a,b,c,d){var e=parseInt(a.style.left);e=e+(b-e)/6+c;if(c<0){if(e<=b){e=b;this.lQ(d)}}else if(e>=b){e=b;this.lQ(d)}
a.style.left=e+'px'},cursor:function(a,b,c){a.src=b;a.style.cursor=c;fixPNG(a)},left:function(a){var b=a.offsetLeft;while(a=a.offsetParent){b+=a.offsetLeft-a.scrollLeft}
return b},top:function(a){var b=a.offsetTop;while(a=a.offsetParent){b+=a.offsetTop-a.scrollTop}
return b}};window.onload=function(){bO.init()}
window.onresize=function(){setTimeout(function(){bO.ji()},10)}
