// http://blog.strictly-software.com/2009/03/detecting-ie-8-compatibility-modes-with.html
// http://www.strictly-software.com/scripts/downloads/IE8.js
new function () {
  var d = document, b = d.body, ua = navigator.userAgent, r;
  if (r = /MSIE (\d+)(?:\.(\d+))?/.exec(ua)) {
    if (r[1] == '7' && d.documentMode && /Trident\/\d/.test(ua))
      r = ['ie', 8, 0];
    else
      r[0] = 'ie';
  }
  else if (r = /Firefox\/(\d+)(?:\.(\d+))?/.exec(ua))
    r[0] = 'moz';
  else if (r = /WebKit\/(\d+)(?:\.(\d+))?/.exec(ua))
    r[0] = 'webkit';
  else
    return;
  var c = b.className.split(' ');
  c.push(r[0], 'major-'+r[1], 'minor-'+r[2]);
  b.className = c.join(' ');
}

