Moved dom onclick to jquery event handlers