instead of getClass and setClass, use element.className, and some new addClass/removeClass functions.