minor spelling fix
moved javascript code into separate function

javascript <script> block has been moved into a separate function in
order to use python raw string for less escaping issues in the future.
fixed anchors hiding behind navbar

Static navbar at the top used to hide anchor elements when in-page jumps
occured.
Pseudo padding has been added to anchor elements (headers and span with
id) to fix this.
Note that margins of elements placed just above and below the anchor
will not overlap as they normally do. To mitigate this, pseudo padding
will be applied only on the targeted id (one that is specified at the
end of URL) rather than being applied to all elements with id.