var ScrollProduct_Inteval=new Array();var ScrollProduct_Lock=new Array();function ScrollProduct_Register(f,e,d){ScrollProduct_Lock[f]=false;Event.observe($("scroller_left"+f),"click",function(a){if(ScrollProduct_Inteval[f]!=null){clearInterval(ScrollProduct_Inteval[f]);ScrollProduct_Inteval[f]=null}if(ScrollProduct_Lock[f]!=true){ScrollProduct_MoveLeft(f,e,d)}ScrollProduct_SetInterval(f,e,d)});Event.observe($("scroller_right"+f),"click",function(a){if(ScrollProduct_Inteval[f]!=null){clearInterval(ScrollProduct_Inteval[f]);ScrollProduct_Inteval[f]=null}if(ScrollProduct_Lock[f]!=true){ScrollProduct_MoveRight(f,e,d)}ScrollProduct_SetInterval(f,e,d)});ScrollProduct_SetInterval(f,e,d)}function ScrollProduct_SetInterval(f,e,d){ScrollProduct_Inteval[f]=setInterval(function(){ScrollProduct_MoveRight(f,e,d)},6000)}function ScrollProduct_MoveRight(j,i,m){try{ScrollProduct_Lock[j]=true;var k=$("scroller"+j).childElements();for(var n=0;n<k.length;n+=i){for(var e=0;e<i;e++){if(n==0){k[n+e].addClassName("goToBottom")}}}new Effect.Move($("scroller"+j),{x:-1*i*m,y:0,afterFinish:function(b){for(var a=0;a<k.length;a++){if(k[a].hasClassName("goToBottom")){$("scroller"+j).appendChild(k[a].remove());k[a].removeClassName("goToBottom")}}b.element.style.left="0px";ScrollProduct_Lock[j]=false}})}catch(l){}}function ScrollProduct_MoveLeft(j,i,m){ScrollProduct_Lock[j]=true;var k=$("scroller"+j).childElements();for(var n=k.length-1;n>=0;n-=i){for(var e=0;e<i;e++){if(n==k.length-1){k[n-e].addClassName("goToTop")}}}$("scroller"+j).style.left=(-1*i*m)+"px";for(var n=0;n<k.length;n++){if(k[n].hasClassName("goToTop")){try{$("scroller"+j).insertBefore(k[n].remove(),k[0])}catch(l){$("scroller"+j).insertBefore(k[n].remove(),0)}k[n].removeClassName("goToTop")}}new Effect.Move($("scroller"+j),{x:i*m,y:0,afterFinish:function(a){a.element.style.left="0px";ScrollProduct_Lock[j]=false}})};
