//
// webreg.js - Determine if browser supports web registration.
//


function isNotWin2kPlatform()
{
  return navigator.userAgent.indexOf( "Windows NT 5.0" ) < 0;
}

function isWin32Platform()
{
  return navigator.platform == "Win32";
}

function isNetscape()
{
  return navigator.appName.indexOf( "Netscape" ) >= 0;
}

function isIE()
{
  return navigator.appName.indexOf( "Internet Explorer" ) >= 0;
}

function isJavaEnabled()
{
  return navigator.javaEnabled();
}

// This does not work on IE: "Request not defined"
//function is128BitSSL()
//{
//  var colServerVars = Request.ServerVariables; 
//  var keySize = parseInt( colServerVars( "CERT_KEYSIZE" ).Item ); 
//  return isNaN( keySize ) == false && keySize >= 128;
//}


function browserSupportsRegistration()
{
  var appVer = parseFloat( navigator.appVersion );

  return isWin32Platform()
         &&
         (
          ( isIE() && appVer >= 4 )
// web reg does not support Netscape for now
//          ||
//          ( isNetscape() && appVer >= 4.08 && appVer <= 4.76 )
         )
         &&
         isJavaEnabled()
//         &&
//         is128BitSSL()
//         &&
//         isNotWin2kPlatform()
//         &&
//         web reg does not support Win2K and SP1. Because there is no detection for SP1,
//         we blanket send all Win2K and above users to Download instead of Sign Up
         ;
}

