Added a fix for a change in behaviour of $.browser sniffing. This code now works for modern versions of jQuery