Added basic browser detection and some IE8-specific code.