GOT IT! Amazing how stuff simply “solves itself” the minute you are about to quit! This happened to my a hundred times in my developer career.
Well, I don’t know if unfiltered-html is needed or not, but the trick was:
1) Enable Text Control
2) In the post where u have the javascript code, use No formatting, and No character encoding
3) Put all the functions, and preferably MOST of the code in a .js file, and include it in the header.php of the template, inside the HEAD section, like this:
...
<script type="text/javascript" language="javascript" src="/casorio.js"></script>
</head>
Maybe it won’t work, but keep trying. I just spent 3h trying to figure this one out, and eventually it worked! =)