<!-- JavaScript banner Code -->
function scrollObject(main, width, height, direct, pause, speed) {
  var self = this;
  this.main = main;
  this.width = width;
  this.height = height;
  this.direct = direct;
  this.pause = pause;
  var opac= 100;
  this.speed = Math.max(1.001, Math.min((direct == "up" || direct == "down") ? height : width, speed));
  if (this.direct == "fade"){this.speed = speed; this.offset= 100;}
  this.slope = (direct == "up" || direct == "left" || direct == "fade") ? 1 : -1;
  this.prev = 0;
  this.offset = 0;
  this.curr = 1;
  this.mouse = false;
  this.scroll = function() {
    this.main = document.getElementById(this.main);
    this.main.style.overflow = "hidden";
    this.main.style.position = "relative";
    this.main.style.width = this.width + "px";
    this.main.style.height = this.height + "px";
    if (this.main.childNodes.length > 1) {
      setInterval(function() {
        if (!self.offset && self.scrollLoop()){
	 self.main.children[self.curr].style.visibility = "visible";
	}
      }, this.pause);
    } 
    this.main.children[this.prev].style.visibility = "visible";
  };

// MAIN SCROLL LOOP

  this.scrollLoop = function() {
    if (!this.offset) {
      this.offset = (this.direct == "up" || this.direct == "down") ? this.height : this.width;
      if (this.direct == "fade") {this.offset= 100;}
    } else this.offset = Math.floor(this.offset / this.speed);
    if (this.direct == "up" || this.direct == "down") {
      this.main.children[this.curr].style.top = (this.offset * this.slope) + "px";
      this.main.children[this.prev].style.top = ((this.offset - this.height) * this.slope) + "px";
    } else if (this.direct == "left" || this.direct == "right"){
      this.main.children[this.curr].style.left = (this.offset * this.slope) + "px";
      this.main.children[this.prev].style.left = ((this.offset - this.width) * this.slope) + "px";
    } else {
      opac= this.offset/100;
      if (opac < 0){opac= 0;}
      this.main.children[this.curr].style.opacity = 1 - opac ;
      if (opac < .1){
	this.main.children[this.prev].style.opacity = 0 ;
      } else {this.main.children[this.prev].style.opacity = opac ;}
    }
    if (!this.offset) {
      this.main.children[this.prev].style.visibility = "hidden";
      this.prev = this.curr;
      ++this.curr;
      if (this.curr >= this.main.children.length) this.curr = 0;
    } else setTimeout(function() { self.scrollLoop(); }, 50);
    return true;
  };
  if (window.addEventListener) {
    window.addEventListener('load', function() { self.scroll(); }, false); 
  } else if (window.attachEvent)
    window.attachEvent('onload', function() { self.scroll(); });
}


<!-- End JavaScript banner Code -->

