user agent string parser in javascript