Moved class definitions out of the JQuery function.