// ----------------------------------
// App Startup
// ----------------------------------
// copied from http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx
function getInternetExplorerVersion() {
  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 checkForValidBrowser() {
  if (Prototype.Browser.IE) {
    var v = getInternetExplorerVersion();
    if (v < 8)
      window.location = "/static/upgrade.html";
  }
  return true;
}


// ----------
// Inital startup code
// ----------
if (checkForValidBrowser())
  attemptInitialLogin();
else
  window.location = "/static/unsupported.html";

