if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1))
{
    document.writeln('<script language="VBscript">');

    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');

    document.writeln('</scr' + 'ipt>');
}
else
  detectableWithVB = false;

function detectPlugin()
{
  var daPlugins = detectPlugin.arguments;
  var pluginFound = false;
  if(navigator.plugins && navigator.plugins.length > 0)
  {
    var pluginsArrayLength = navigator.plugins.length;
	for(pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++)
    {
	  var numFound = 0;
	  for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++)
        if((navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) != -1) || (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) != -1))
		  numFound++;
	  if(numFound == daPlugins.length)
	  {
        pluginFound = true;
		break;
	  }
	}
  }
  return pluginFound;
}

function detectFlash()
{
  pluginFound = detectPlugin('Shockwave','Flash');
  if(!pluginFound && detectableWithVB)
    pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.8');
  return pluginFound;
}

function lmsDetect(bFullCheck)
{
  document.getElementById("Status_NoJavascript").style.display = "none";
  if(bFullCheck)
  {
    var http = new AJAXSync();
    if(http.isAjaxSupported())
      if(detectFlash())
        if(http.connect("FirewallTest.exe"))
          if(http.responseText.substr(0,1) == "-")
            document.getElementById("Status_NoReferer").style.display = "block";
		  else
	      {
	        document.getElementById("Status_AllInstalled").style.display = "block";
			if(http.responseText.substr(0,1) != "+")
              document.getElementById("Status_RefererWarning").style.display = "block";
            document.LoginForm.Username.focus();
		  }
        else
        {
          document.getElementById("Status_AllInstalled").style.display = "block";
          document.getElementById("Status_RefererWarning").style.display = "block";
          document.LoginForm.Username.focus();
        }
      else
        document.getElementById("Status_NoFlashInstalled").style.display = "block";
    else
      document.getElementById("Status_NoAJAXSupport").style.display = "block";
  }
  else
    document.getElementById("Status_AllInstalled").style.display = "block";
}

