CHG: permalink enabled and fixed again for new lightbox script.

Moved lightbox init script to its own file.
Improved html structure a bit.