Adapted the code to support jquery >= 1.9

`$.browser` is deprecated in jquery 1.9 http://api.jquery.com/jQuery.browser