Remove use of $.browser from gfx initialization

$.browser has been removed as of JQuery 1.9 (http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed). This fix replaces use of $.browser with navigator.userAgent detection to determine if the browser is WebKit or Firefox.