Wondering if there is an accepted way to detect browser/OS in a zimlet ... ?

Of course there are many scripts out there that do nice useragent parsing already for this but I'd rather not bundle more stuff than necessary w/ the zimlet and I figure the zimbra web-frontend surely has a way of detecting this already ... has anyone leveraged this before to do a browser/os detect in a zimlet?