You can't use window.onload in that script.
By the time the code is run to put that script in place, window.onload has already occurred.
Your test for browserok is VERY VERY OLD and UNNEEDED code. Get rid of it. *ALL* modern browsers will support that script.
But, in general, that script is too old to be worth using. It is *STILL* using document.write() which became essentially obsolete and unnecessary about 15 years ago!
Personally, instead of conditionally including the <script>, I would just *ALWAYS* include it (it's a small script, after all) but then only *RUN* the script when the time of year is right.
And there is so much *CRAP* unneeded code in there, in any case, it could be twice as small as it is.
Throw it out. Start over.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.