How "generic" the toggle code is depends on your situation. Show the HTML and indicate what objects should toggle what targets.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.