function HorizontalScroller(_el,_cl){this.el=SJEL.$(_el);this.es=SJEL.$C(_cl,this.el);this.esl=this.es.length;if(this.esl==0)
return;var i=0;this.mo=new SJEL.Morph("easyboth");this.w=parseInt(SJEL.GStyle(this.es[0],"width"));this.h=parseInt(SJEL.GStyle(this.es[0],"height"));this.ew=parseInt(SJEL.GStyle(this.el,"width"));this.eh=parseInt(SJEL.GStyle(this.el,"height"));this.c=0;this.pos=0;this.max=(this.esl*this.w)-this.w;if(this.max<this.ew)
return;this.wr=SJEL.CE("div");SJEL.SStyle(this.wr,{position:"absolute",top:0,left:0,width:this.max});for(i=0;i<this.es.length;i++){SJEL.SStyle(this.es[i],{position:"absolute",left:i*this.w});this.wr.appendChild(this.es[i]);}
this.el.appendChild(this.wr);this.dots=new Array();var he=this.h;he=this.h+20;var bar=SJEL.CE("div");SJEL.AddClass(bar,"hs_buts_bar");var aleft=SJEL.CE("div");SJEL.AddClass(aleft,"hs_arrow_left");var aright=SJEL.CE("div");SJEL.AddClass(aright,"hs_arrow_right");SJEL.SStyle(bar,{position:"absolute",top:this.h,width:this.ew});aleft.ref=this;aleft.onclick=function(_e){this.ref.GoTo(this.ref.pos-1);}
aright.ref=this;aright.onclick=function(_e){this.ref.GoTo(this.ref.pos+1);}
bar.appendChild(aright);bar.appendChild(aleft);for(i=this.esl-1;i>=0;i--){var dot=SJEL.CE("div");SJEL.AddClass(dot,"hs_dot");if(i==0)
SJEL.AddClass(dot,"hs_dot_active");dot.onmouseover=function(){SJEL.AddClass(this,"hs_dot_active");}
dot.onmouseout=function(){SJEL.RemoveClass(this,"hs_dot_active");}
dot.ref=this;dot.i=i;dot.onclick=function(){this.ref.GoTo(this.i);}
this.dots[i]=dot;bar.appendChild(dot);}
this.el.appendChild(bar);SJEL.SStyle(this.el,{position:"relative",overflow:"hidden",height:he});this.GoTo=function(_p){if(_p==this.pos)
return;SJEL.RemoveClass(this.dots[this.pos],"hs_dot_active");var n=Math.abs(_p-this.pos);if(_p<0){this.c=-this.max;this.pos=this.esl-1;}else if(_p>this.esl-1){this.c=0;this.pos=0;}else if(_p>this.pos){this.c-=n*this.w;this.pos+=n;}else if(_p<this.pos){this.c+=n*this.w;this.pos-=n;}
SJEL.AddClass(this.dots[this.pos],"hs_dot_active");this.mo.Init(this.wr,{left:this.c},500);this.mo.Morph();}}