utScroll = function()
{
    this.speed = 20;
    this.delay = 2000;
    this.height = 0;
    this.lineHeight = 20;
    this.count = 0;
    this.name = "init_main";
    this.id = "init_main";
	this.time_val = "init_main";

	this.setSpeed = function(speed) {
		this.speed = speed;
	};

	this.setDelay = function(delay) {
		this.delay = delay;
	};

    this.setName = function(name) {
        this.name = name;
    };

    this.setHeight = function(h) {
        this.height = h;
    };

    this.setId = function(id) {
        this.id = id;
	};

    this.add = function(item) 
    {
        var top = this.lineHeight * this.count++;
        var html = "<div style=\"position:absolute; top:" + top + "px;\"><nobr>" + item + "</nobr></div>";
        document.getElementById(this.id).innerHTML += html;
    };

	this.stop = function()
	{
		clearTimeout(this.time_val);
	}

    this.ing = function() 
    {
        var speed = this.speed;
        var item = document.getElementById(this.id).getElementsByTagName("div");

        for (var i = 0; i < item.length; i++) {
            obj = item[i].style;
            obj.top = parseInt(obj.top) - 1;
            if (parseInt(obj.top) <= this.lineHeight * (-1)){
                obj.top = this.lineHeight * (item.length-1);
            }
            if (parseInt(obj.top) == 0){
                speed = this.delay;
            }
        }

        this.time_val = window.setTimeout(this.name + ".ing('"+this.id+"')", speed);
    };

    this.run = function() 
    {
        this.time_val = window.setTimeout(this.name + ".ing('"+this.id+"')", this.delay);
    }

};