function doSomething(e)
{
if (!e) var e = window.event;
// e gives access to the event in all browsers
}
If the variable e does not exist (if it isnít sent to the function), make it a reference to window.event . Now e refers to the event in all browsers.