An attempt at re-writing code for a JavaScript triggered overlay.