function CScroller(id) {
  this.$ = function(id) {
    return document.getElementById(id);
  }
  this.id;
  this.obj = this.$(id);
  this.imgs = [];

  this.uppercaseThis = function(s) { 
    return s.toUpperCase(); 
  } 

  this.getProp = function(obj, prop) { 
    var s; 

    if (navigator.appVersion.indexOf("MSIE")!= -1) { // Camel case for IE 
      prop = prop.replace(/-(.)/g, this.uppercaseThis); 
      prop = prop.replace(/(-)/g, ""); 
    } 
    if (obj.currentStyle) 
      s = obj.currentStyle[prop]; 
    else 
      if (window.getComputedStyle) 
        s = window.getComputedStyle(obj, null).getPropertyValue(prop); 
    return s; 
  } 

  this.init = function() {
    var d = new Date();
    this.id = "scroller_"+d.getSeconds()+d.getMilliseconds();
    eval(this.id+"=this");
    this.imgs = this.obj.getElementsByTagName("img");
  }
  this.scrollDiv = function(a) {
    this.obj.scrollLeft = a;
  }
  this.slide = function(n) {
    var dir = n>0?1:-1;
    this.timeout = clearTimeout(this.timeout);
    this.slideStartTime = (new Date()).getTime();
    this.scroll(this.obj.scrollLeft,150,dir);
  }
  this.scroll = function(start,target_val,dir) {
    var initialSpeed = 200;
    var acceleration = 400; 
    var timeEllapsed = ((new Date()).getTime() - this.slideStartTime)/1000;
    var totalDistanceTraveled = (initialSpeed * timeEllapsed) + (0.5 * acceleration * (Math.pow(timeEllapsed,2)));

    var newHeight = totalDistanceTraveled;
    newHeight = Math.floor(newHeight);

    if(newHeight>=target_val) {
      newHeight = target_val;
      this.scrollDiv(start+dir*target_val);
    } else {
      this.scrollDiv(start+dir*newHeight);
      this.timeout = window.setTimeout(this.id+".scroll("+start+","+target_val+","+dir+")",20);
    }
  }
  this.init();
}

function scrollBand2() {
  cscroll = new CScroller("imgsBand");
}
