toggler as a JavaScript function class-like thing