selected div now visible.
improved text input.
slightly cleaned up the code.