Put the javascript in a js file (new file javascript\printable.js).