Added JS switch class snippet

Removes the need for jQuery and replaces the class asap to help prevent content flash