... if(window.captureEvents){ window.captureEvents(Event.CLICK|Event.MOUSEUP); window.onclick=window.onmouseup=handle; }else document.onclick=window.onmouseup=handle; ...