The attached product should do what you want. When installed, the source code of showthread looks like this, changes highlighted in bold:
Code:
<script type="text/javascript" src="clientscript/vbulletin_global.js?v=367"></script>
<script type="text/javascript" src="clientscript/vbulletin_menu.js?v=367"></script>
<!-- END TEMPLATE: headinclude --><script type="text/javascript" src="clientscript/yourscript.js"></script>
and
Code:
<body onload="do_js();">
You'll have to edit the product to change what javascript is added, of course. Make sure the semicolon at the end of the onload bit is left, sometimes other onload javascript is included too, apparently.