function Button(domID, txt, ctrl)    {
    // liefert den Text
    this.getText = function()   {
        return this.txt
    }
    
    // bewegt den Regler zur angegebenen Position
    this.moveTo = function(status)    {
        this.status = status
        this.interval = window.setInterval(this.makeMove.bind(this), 120)
    }
    
    // setzt den Regler um 1 in Richtung this.status
    // (this.position gibt die aktuelle Position an)
    // löscht den Interval, falls position und status ident
    this.makeMove = function() {
        if(this.position == this.status)    {
            window.clearInterval(this.interval)
            return
        }
        if(this.position < this.status) {
            this.position ++
        }
        else    {
            this.position--
        }
        this.dom.src = this.images[this.position].src
    }
    
    // lädt die Bilder vor
    this.loadImages = function()    {
        var images = new Array();
        for(var i = 1; i < 11; i++) {
            images[i-1] = new Image()
            images[i-1].src = "./img/"+i+".gif"
        }
        return images
    }
    
    // EVENT-HANDLER
    this.click = function() {
        this.ctrl.set(this)
    }
    this.over = function() {
        this.ctrl.over(this)
    }
    this.out = function() {
        this.ctrl.out(this)
    }
    
    this.txt = txt
    this.ctrl = ctrl
    this.dom = document.getElementById(domID)
    this.status = 0
    this.position = 0
    this.interval
    this.images = this.loadImages()
    
    
    
    
    this.dom.onclick = this.click.bind(this)
    this.dom.onmouseover = this.over.bind(this)
    this.dom.onmouseout = this.out.bind(this)
}
