
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;
}

function checkForIE6()
{
  var ver = getInternetExplorerVersion();
  if ( ver > -1 )
  {
    if ( ver < 7 ) return true;
  }
  return false;
}

function renderIE6Warning()
{
	document.write('<!--[if IE 6] -->');
	document.write('<style type="text/css">');
	document.write('#ie6msg{border:3px solid #090; margin:8px 0; background:#cfc; color:#000;}');
	document.write('#ie6msg h4{margin:8px; padding:0;}');
	document.write('#ie6msg p{margin:8px; padding:0;}');
	document.write('#ie6msg p a.getie8{font-weight:bold; color:#006;}');
	document.write('#ie6msg p a.ie6expl{font-weight:normal; color:#006;}');
	document.write('</style>');
	document.write('<div id="ie6msg">');
	document.write('<h4>Did you know that your browser is out of date?</h4>');
	document.write('<p>To get the best possible experience using this website we recommend that you upgrade your browser to a newer version. The current version is <a class="getie8" href="http://upgradeie.s3.amazonaws.com/eng/index.html">Internet Explorer 8</a>. The upgrade is free. If you are using a PC at work you should contact your IT administrator.</p>');
	document.write('<p>If you want to you may also try some other popular Internet browsers like <a class="ie6expl" href="http://getfirefox.com">Firefox</a>, <a class="ie6expl" href="http://www.opera.com">Opera</a>, or <a class="ie6expl" href="http://www.apple.com/safari/download/">Safari</a></p>');
	document.write('</div>');
	document.write('<!-- [endif]-->');
}

if (checkForIE6()) renderIE6Warning();
