use collapsed panel to show resource details

Please  play around with latest 3 commits.
This definitely doesn't need to be in a document.write call, just a normal script in the <head> would do fine.