Start of the character viewing/editing JavaScript.