LOL! Too true!
But to answer his question:
APPARENTLY (and this is only from examining the code, not from personal knowledge) some version of MSIE have a userAgent string that includes "MSIE xx;" and other versions have "MSIE (something)xx". So all that code is doing is finding where the beginning and end of "xx" is.
It could have all been done much simpler using a regular expression, if anybody cares.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.