I would like to enable the behaviour described on this page, including the improvements suggested below the original post.

However I don't know what to do with the file available for download, or how to incorporate the suggested improvements.

Can anyone help please?