function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}



function VSScroller(ulId, speed, pause, pauseafter) {

        this.container = document.getElementById(ulId);
        this.container.Scroller = this;
        this.speed = speed;
        this.count = 0;
        this.pause = pause;
        this.pauseafter = pauseafter;

        this.scroll = function() {
          var c = this.container.firstChild;
          var first = null;
          var blnPause = false;
          while (c) {
                  if (c.tagName == 'LI') {
                          first = c;
                          break;
                  }
                  c = c.nextSibling;
          }
          var px = 0;
          var nodeSize = 0;
          nodeSize = first.clientWidth;

          if (first.style.marginLeft != '') {
                  px = parseInt(first.style.marginLeft);
          }
          first.style.marginLeft = ( px - 2 ) + 'px';

          if ( parseInt(first.style.marginLeft) <= -(nodeSize) ) {

                  first.style.marginLeft = '0px';
                  this.container.removeChild(first);
                  this.container.appendChild(first);
                  this.count++;
                  if (this.count == this.pauseafter)
                  {
                    var blnPause = true;
                    this.count = 0;
                  }
          }
          if (!blnPause)
          {
            setTimeout('document.getElementById(\'' + this.container.id + '\').Scroller.scroll()', this.speed);
          }
          else
          {
            setTimeout('document.getElementById(\'' + this.container.id + '\').Scroller.scroll()', (this.speed+this.pause));
          }
        }

        setTimeout('document.getElementById(\'' + ulId + '\').Scroller.scroll()', this.speed);

}