//

function scrollIt(obj) {
  if ( obj.active ) {
    if ( (obj.dir == 0 && obj.y < obj.yinit ) || (obj.dir == 1 && obj.y > obj.yfinal) ) {
      if ( obj.dir == 0 ) {
        next = parseInt(eval(obj.y+'+'+obj.vel));
        if ( next > obj.yinit ) obj.moveTo(null,obj.yinit);
        else obj.moveTo(null,next);
      } else {
        next = parseInt(obj.y - obj.vel);
        if ( next < obj.yfinal ) obj.moveTo(null,obj.yfinal);
        else obj.moveTo(null,next);
      }
    }
  }
}

function gotoInicio(obj) {
  obj.moveTo(null,obj.yinit);
}

function gotoFin(obj) {
  obj.moveTo(null,obj.yfinal);
}

function Play(obj,direct) {
  obj.dir = direct;
  obj.active = true;
}

function Stop(obj) {
  obj.active = false;
}

function scrollItH(obj) {
  if ( obj.active ) {
    if ( (obj.dir == 0 && obj.x < obj.xinit ) || (obj.dir == 1 && obj.x > obj.xfinal) ) {
      if ( obj.dir == 0 ) {
        next = parseInt(eval(obj.x+'+'+obj.vel));
        if ( next > obj.xinit ) obj.moveTo(obj.xinit,null);
        else obj.moveTo(next,null);
      } else {
        next = parseInt(obj.x - obj.vel);
        if ( next < obj.xfinal ) obj.moveTo(obj.xfinal,null);
        else obj.moveTo(next,null);
      }
    }
  }
}

function gotoInicioH(obj) {
  obj.moveTo(obj.xinit,null);
}

function gotoFinH(obj) {
  obj.moveTo(obj.xfinal,null);
}
