What does the following mean in JavaScript?
var evt=event||window.event;
The code is a hack because Microsoft decided to put their events in the global window.event instead of passing it as a parameter to the event function.
So, this code will attempt to set evt to the event passed in (which will work for the non-Microsoft browsers) and, if that turns out to be null (as it will be for Microsoft browsers), it will then grab it from the global.
From that point on, your function can just use evt disregarding browser differences (well, at least those relating to events).