updated PDF links to use remote JS file and improved scripting