Added feature detection to replace deprecated browser detection. Now
compatible with latest jQuery.