/*
 * Detect Internet Explorer, the broken browser we care about.
 *
 * Based on code from MSDN:
 * http://msdn.microsoft.com/en-us/library/ms537509.aspx
 *
 * Per Olofsson, 2009
 */


function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

var ie_ver = getInternetExplorerVersion();
var is_ie = (ie_ver != -1);
var ie_below7 = (is_ie && (ie_ver < 7.0));
var ie6 = ie_below7;
var ie7 = (is_ie && ie_ver >= 7.0 && ie_ver < 8.0);
