Use innerHTML instead of direct document.write(), which whacks the
original document.

Minor styling changes.