Or if your not afraid of writing php (doc, settings, code):
http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ezscript.txt
http://svn.projects.ez.no/ezcore/trunk/ezcore/settings/ezcore.ini http://svn.projects.ez.no/ezcore/trunk/ezcore/classes/ezcoreservercallfunctions.php
However this is only useful if you need to generate a lot of js dynamically, for instance like OE 5.x does with translations:
So if you have mostly static js, with a couple of dynamic values from template, I would rather split out the static part into a external js file (unless it's small of course) and put the dynamic part in script tags in your pagelayout.