Viewer: Added an textwidth calc function to the index.html.

Renamed function to drawTitle and added some minor functionality.