Generic controller for multiple toggle elements