/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(a, b, d, e) {
  this.content = a;
  this.tickerid = b;
  this.delay = e;
  this.mouseoverBol = 0;
  this.hiddendivpointer = 1;
  document.write('<div id="' + b + '" class="' + d + '" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="' + b + '1">' + a[0] + '</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="' + b + '2">' + a[1] + "</div></div>");
  var c = this;
  if(window.addEventListener) {
    window.addEventListener("load", function() {
      c.initialize()
    }, false)
  }else {
    if(window.attachEvent) {
      window.attachEvent("onload", function() {
        c.initialize()
      })
    }else {
      document.getElementById && setTimeout(function() {
        c.initialize()
      }, 500)
    }
  }
}
pausescroller.prototype.initialize = function() {
  this.tickerdiv = document.getElementById(this.tickerid);
  this.visiblediv = document.getElementById(this.tickerid + "1");
  this.hiddendiv = document.getElementById(this.tickerid + "2");
  this.visibledivtop = parseInt(pausescroller.getCSSpadding(this.tickerdiv));
  this.visiblediv.style.width = this.hiddendiv.style.width = this.tickerdiv.offsetWidth - this.visibledivtop * 2 + "px";
  this.getinline(this.visiblediv, this.hiddendiv);
  this.hiddendiv.style.visibility = "visible";
  var a = this;
  document.getElementById(this.tickerid).onmouseover = function() {
    a.mouseoverBol = 1
  };
  document.getElementById(this.tickerid).onmouseout = function() {
    a.mouseoverBol = 0
  };
  window.attachEvent && window.attachEvent("onunload", function() {
    a.tickerdiv.onmouseover = a.tickerdiv.onmouseout = null
  });
  setTimeout(function() {
    a.animateup()
  }, this.delay)
};
pausescroller.prototype.animateup = function() {
  var a = 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() {
      a.animateup()
    }, 50)
  }else {
    this.getinline(this.hiddendiv, this.visiblediv);
    this.swapdivs();
    setTimeout(function() {
      a.setmessage()
    }, this.delay)
  }
};
pausescroller.prototype.swapdivs = function() {
  var a = this.visiblediv;
  this.visiblediv = this.hiddendiv;
  this.hiddendiv = a
};
pausescroller.prototype.getinline = function(a, b) {
  a.style.top = this.visibledivtop + "px";
  b.style.top = Math.max(a.parentNode.offsetHeight, a.offsetHeight) + "px"
};
pausescroller.prototype.setmessage = function() {
  var a = this;
  if(this.mouseoverBol == 1) {
    setTimeout(function() {
      a.setmessage()
    }, 100)
  }else {
    var b = this.hiddendivpointer;
    this.hiddendivpointer = b + 1 > this.content.length - 1 ? 0 : b + 1;
    this.hiddendiv.innerHTML = this.content[this.hiddendivpointer];
    this.animateup()
  }
};
pausescroller.getCSSpadding = function(a) {
  return a.currentStyle ? a.currentStyle.paddingTop : window.getComputedStyle ? window.getComputedStyle(a, "").getPropertyValue("padding-top") : 0
};

