/**
* ÆÄÀÏ¸í: lib.textSlider.js
* ¼³  ¸í: ½ºÅ©·Ñ ¹è³Ê ¶óÀÌºê·¯¸®
* ÀÛ¼ºÀÚ: lainTT[±è±º¿ì] - jstoy project
* ³¯  Â¥: 2004-03-30
*
***********************************************
*/

TextBanner = function(className, id) {
    this.IE = document.all ? 1 : 0;
    this.NN = document.layer ? 1 : 0;
    this.N6 = document.getElementById ? 1 : 0;
    if(this.IE) this.layer = document.all(id);
    else if(this.NN) this.layer = document.layer[id];
    else if(this.N6) this.layer = document.getElementById(id);
    else return;
    this.className = className;
    this.top = this.oldY = parseInt(this.layer.style.top,10);
    setInterval(this.className + ".move()", 10);
}
TextBanner.prototype.move = function() {
    var diffY = (this.IE) ? document.body.scrollTop+this.top : self.pageYOffset+this.top;
    if(diffY != this.oldY) {
        var percentY = .1 * (diffY - this.oldY);
        percentY = (percentY > 0) ? Math.ceil(percentY) : Math.floor(percentY);

        this.oldY += percentY;
        this.layer.style.top = this.oldY + "px";
    }
}

