function scroller( content, divID, delay ) {
  //set some variables
  this.content = content;
  this.divID = divID;
  this.delay = delay;
  this.mouseOverState = 0;
  this.messageCounter = 1;
  this.scrollerDiv = getObj( divID );
  
  //initiate scroller
  var scroller = this;
  if (window.addEventListener) window.addEventListener("load", function(){scroller.init()}, false)
  else if (window.attachEvent) window.attachEvent("onload", function(){scroller.init()})
  else if (document.getElementById) setTimeout(function(){scroller.init()}, 500)
}

scroller.prototype.init = function() {
  //make sure of div styling
  this.scrollerDiv.style.overflow = 'hidden';
  this.scrollerDiv.style.position = 'relative';

  //attach content divs
  var d = document.createElement( 'div' );
  d.className = "scrollerDiv";
  d.style.position = 'absolute';
  d.div = this.divID + '1';
  d.innerHTML = this.content[0];
  this.visibleDiv = d;
  this.scrollerDiv.appendChild( d );
  

  var d = document.createElement( 'div' );
  d.className = "scrollerDiv";
  d.style.position = 'absolute';
  d.style.visibility = 'hidden';
  d.div = this.divID + '2';
  d.innerHTML = this.content[1];
  this.hiddenDiv = d;
  this.scrollerDiv.appendChild( d );  


  this.visibleDivTop = parseInt( this.getCSSpadding( this.scrollerDiv ) );
  
  //set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
  //this.visibleDiv.style.width = this.hiddenDiv.style.width = this.scrollerDiv.offsetWidth - ( this.visibleDivTop * 2 ) + 'px';
  this.getInline(this.visibleDiv, this.hiddenDiv);
  this.hiddenDiv.style.visibility = 'visible';
  
  var scroller = this;
  var scrollerinstance=this
  this.scrollerDiv.onmouseover = function() { scroller.mouseOverState = 1; };
  this.scrollerDiv.onmouseout  = function() { scroller.mouseOverState = 0; };
  
  if (window.attachEvent) window.attachEvent("onunload", function(){scroller.scrollerDiv.onmouseover = scroller.scrollerDiv.onmouseout = null } );
  setTimeout( function() { scroller.animateUp() }, this.delay );
}


scroller.prototype.animateUp = function() {
  var scrollerinstance = this;
  if( parseInt( this.hiddenDiv.style.top ) > (this.visibleDivTop + 5 ) ) {
    this.visibleDiv.style.top = parseInt( this.visibleDiv.style.top ) - 5 + 'px';
    this.hiddenDiv.style.top = parseInt( this.hiddenDiv.style.top ) - 5 + 'px';
    setTimeout( function() { scroller.animateUp() }, 50 );
  } else {
    this.getInline( this.hiddenDiv, this.visibleDiv );
    this.swapDivs();
    setTimeout( function(){ scroller.setMessage() }, this.delay );
  }
}

scroller.prototype.swapDivs = function() {
  var temp = this.visibleDiv;
  this.visibleDiv = this.hiddenDiv;
  this.hiddenDiv = temp;
}

scroller.prototype.setMessage = function() {
  if( this.mouseOverState ==1 )
    setTimeout(function() { scroller.setMessage() }, 100 );
  else {
    var i = this.messageCounter;
    var ceiling = this.content.length;
    this.messageCounter = ( i + 1 > ceiling - 1 ) ? 0 : i + 1;
    this.hiddenDiv.innerHTML = this.content[ this.messageCounter ];
    this.animateUp();
  }
}

scroller.prototype.getInline = function( div1, div2 ) {
  div1.style.top = this.visibleDivTop + 'px';
  div2.style.top = Math.max( div1.parentNode.offsetHeight, div1.offsetHeight ) + 'px';
}

scroller.prototype.getCSSpadding = function( obj ) {
  if( obj.currentStyle ) return obj.currentStyle["paddingTop"];
  else if( window.getComputedStyle ) return window.getComputedStyle( obj, "").getPropertyValue( "padding-top" );
  else return 0;
}