copied toggle controls into JS.