See makeBgWhiteSpt(), makeBgBlackSpt() toggleIsDown[backgroundIndex] is used for tests instead of the actual background color. Note [] not () see e.g. getEchoColor(); setButtonState("down", backgroundIndex) Jmol variable backgroundColor