self.transform = function (a) {
  var d = (a.steps != 'undefined') ? a.steps : 5;
  self._transform = (typeof self._transform != 'undefined') ? self._transform : {};
  if (_transform[a.el.id]) {
    clearTimeout(_transform[a.el.id])
  }
  var x = parseInt(a.el.style.left) ? parseInt(a.el.style.left) : 0;
  var y = parseInt(a.el.style.top) ? parseInt(a.el.style.top) : 0;
  var sx = (x > a.toleft) ? -1 : (x < a.toleft) ? 1 : 0;
  var sy = (y > a.totop) ? -1 : (y < a.totop) ? 1 : 0;
  var dx = (sx) ? Math.abs(a.toleft - x) : 0;
  var dy = (sy) ? Math.abs(a.totop - y) : 0;
  //alert('ok?' + d+ ' '+ sx)
  if (d && sx) {
    a.el.style.left = (x + Math.ceil(dx/d)*sx)+'px';
  }
  if (d && sy) {
    a.el.style.top = (y + Math.ceil(dy/d)*sy)+'px';
  }
  if (d) {
    _transform[a.el.id] = setTimeout( function () { transform( { el : a.el , toleft : a.toleft , totop:  a.totop , steps : d-1 } ) } , 20 )
  }
}
self.scroll_left = function () {
  var x = parseInt(document.getElementById('slides').style.left) ? parseInt(document.getElementById('slides').style.left) : 0;
  if (x-960 >= (parseInt(document.getElementById('slides').clientWidth) - 960)*-1) {
    transform( { el : document.getElementById('slides'), toleft: x - 960, steps : 15 }) ;
  }
}
