input fields now hide/show correctly

some code clean up in application.js