You can also check out this code in action on our UA parser test page too and if for some reason your browser isn't being correctly detected, let us know and we should be able to figure out how to get that right.
All of this though brings me back to the fact that there's really not a great, bleeding-edge accurate, user agent parsing library available today that I'm aware of. The best ones out there at present that I know of are browscap.ini and useragentstring.com, but neither of these offer the detection library itself nor are they community maintained and bleeding-edge up to date. There's also WURFL, though it's more about offering a database of capabilities than a universal browser detection tool. Is there something else out there that you know of that's good?
I still have this fantasy of a client library, written to use and cache an ordered list of regexes and patterns for detecting browsers - it would be so cool if this list could be distributed by pubsubhubbub and then any one could host their own, augment the format, or just contribute their changes back to an open source project. Do you know of anyone looking for a fun, meaningful 20% project?