Save the JS to a file. Name it whatever you like. Upload it to your forum root or a folder of your choosing.
Then insert the following code between the <head> tags in the globalTemplate for your theme.
<script type="text/javascript" src="path-to-javascript-file.js"></script>