Handling Window Events: onload
Handling Window Events: onresize
Handling Window Events: onfocus
Handling Window Events: onblur
Mouse Event Handling: onmousedown
Mouse Event Handling: onmousemove
Mouse Event Handling: ondblclick
Form Event Handling: onblur
Form Event Handling: onfocus
Key Event Handling: onkeydown
To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.
See it run: Handling Window Events: onblur
This JavaScript uses onblur to keep a window in the front (active) position.