function Controller(domID)    {
    this.dom = document.getElementById(domID)
    this.active
    
    this.set = function(button) {
        if(this.active == button)   {
            return
        }
        if(this.active) {
            this.active.moveTo(0)
        }
        this.active = button
        this.setText(this.active.getText())
        this.active.moveTo(9)
    }
    
    this.over = function(button)    {
        if(this.active == button)   {
            return
        }
        this.setText(button.getText())
        button.moveTo(5)
    }
    
    this.out = function(button) {
        if(this.active == button)   {
            return
        }
        this.setText(this.active.getText())
        button.moveTo(0)
    }
    
    this.setText = function(txt)    {
        while(this.dom.hasChildNodes()) {
            this.dom.removeChild(this.dom.firstChild)
        }
        this.dom.appendChild(document.createTextNode(txt))
    }
}
