function HScroll() {
  this.name = " HScroll";
  this.item = new Array();
  this.itemcount = 0;
  this.pausemouseover = false;
  this.stop = false;
  this.stopHeight = 0;
  this.add = function() {
    var text = arguments[0];
    this.item[this.itemcount] = text;
    this.itemcount = this.itemcount + 1;
  };

  this.display = function() {
    var box = document.createElement('div');
    box.id = this.name;
    var objbox = document.getElementById("keyword");
    objbox.appendChild(box);
    box.style.height = this.height + 'px';
    box.style.width = this.width + 'px';
    box.style.position = 'relative';
    box.style.overflow = 'hidden';
    box.onmouseover = function() {header_topics.onmouseover();}
    box.onmouseout = function() {header_topics.onmouseout();}

    for (var i = 0; i < this.itemcount; i++) {
      var element = document.createElement('div');
      element.id = this.name + 'item' + i;
      element.style.width = this.width + 'px';
      element.style.position = 'absolute';
      element.style.top = (this.height * i + 1) + 'px';
      element.style.left = 0;
      element.innerHTML = this.item[i];
      var objBody = document.getElementById(this.name);
      objBody.appendChild(element);
    }
  };

  this.scroll = function() {
    this.currentspeed = this.scrollspeed;
    if (!this.stop) {
      for (i = 0; i < this.itemcount; i++) {
        obj = document.getElementById(this.name + 'item' + i).style;
        var t = obj.top.replace(/p[tx]$/, '') - 1;
        obj.top = t + 'px';
        if (t <= this.height * ( - 1)) obj.top = (this.height * (this.itemcount - 1)) + 'px';
        if (t == 0 || (this.stopHeight > 0 && this.stopHeight - t == 0)) this.currentspeed = this.pausedelay;
      }
    }
    window.setTimeout(this.name + ".scroll()", this.currentspeed);
  };

  this.onmouseover = function() {
    if (this.pausemouseover) {
      this.stop = true;
    }
  };

  this.onmouseout = function() {
    if (this.pausemouseover) {
      this.stop = false;
    }
  };

}

function start() {
  header_topics.display();
  header_topics.currentspeed = header_topics.scrollspeed;
  setTimeout(header_topics.name + '.scroll()', header_topics.currentspeed);
};

if (window.attachEvent) {
  window.attachEvent('onload', start);
}
if (window.addEventListener) {
  window.addEventListener('load', start, false);
}
//
header_topics = new HScroll();
header_topics.name = "header_topics";
header_topics.height = 15;
header_topics.width = 375;
header_topics.scrollspeed = 45;
header_topics.pausedelay = 6000;
header_topics.pausemouseover = true;
///////////////////////////////////
