Hi malware fighters,
HTLM, CSS and Javascript should be separated. The way towards no more memory leaks is writing unobtrusive javascript. How this is implimented you read here:
http://www.onlinetools.org/articles/unobtrusivejavascript/
Read the online chapters, and apply what you learn.
polonus
P.S. Using an unobtrusive javascipt EventManager and RemoveEventListener.JS will help you enormously.
If someone likes to try inside the browser, I can give you the code.
D.