function Slider(name,start,finalv,step,division,method1,method2,numero){
  this.name=name;
  this.actual=start;
  this.start=start;
  this.finalv=finalv;
  this.ffinalv=finalv;
  this.step=step;
  this.division=division;
  this.numero=numero;
  this.running=typeof(method1)=="undefined"?function(){}:method1;
  this.last=typeof(method2)=="undefined"?function(){}:method2;

}



Slider.prototype.run=function(){
  if(this.actual<this.finalv){
    this.actual+=Math.ceil((this.finalv-this.actual)/this.division);
  }else{
    this.actual+=Math.floor((this.finalv-this.actual)/this.division);
  };
  if(this.actual!=this.finalv){
    this.running(this.actual,this.numero);
    this.timer=setTimeout(this.name+".run()",this.step);    
  }else{
    this.last(this.finalv,this.numero);
    clearTimeout(this.timer);
  };
}



Slider.prototype.stop=function(){
  clearTimeout(this.timer);
}


Slider.prototype.reverse=function(){
  if(this.finalv!=this.start)this.finalv=this.start;else this.finalv=this.ffinalv;
}

Slider.prototype.toString=function(){
  return "Slider\n\n(c) 2004 Maņas" 
}
