JavaScript Switch Framework