The suggestion you posted doesn't work, but I understand the concept.
I'll have a play with it.
Is the best/only way to implement this via onLoad in the body tag ?
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.