Save it and upload it to /forums(or your boards dir.)/jscripts/ then place this code into your ungrouped templates > "headerinclude" template:
<script type="text/javascript" src="jscripts/SCRIPTNAME.js"></script>
I think this is not a simple javascript... don't works for me.