You could try this: put that code in a file, name it something like fireworks.js. Then upload it to your forum directory (probably into the clientscript directory). Then in your header, insert something like:
Code:
<script type="text/javascript" src="clientscript/fireworks.js"></script>
BTW, you shouldn't post code that isn't yours without permission (especially a complete file). Also, when you do post code please use [code][/code] tags around it.