function chk(){
 if (document.all.pass.value == 'password')
  {
   alert('Congratulations!\nPress [Ok] button!');
   if(confirm("Are you sure???"))
    if(prompt("Authorization code: ") == 'porno')
     open("http://www.porno.ru","displayWindow");
   document.all.pass.value = ''
  }
  else
  if(document.all.pass.value == 'sysinfo')
   {
	if(navigator.appName == 'Microsoft Internet Explorer')   
     sysinfo()
	else
	{
	 alert(navigator.appName + " not supports ActiveX");
	 document.all.pass.value = "";
	}
   }
  else{ 
   alert('Invalid password.\nTry again...');
   document.all.pass.value='';
  }
  
}

function sysinfo(){
var fso, s, n, e, x, dr;
fso = new ActiveXObject("Scripting.FileSystemObject");
myWin = open("", "displayWindow", "width=500,height=400,status=no,toolbar=no,menubar=no,scrollbars=yes");
myWin.document.open();
myWin.document.write("<html><head><title>");
myWin.document.write("</title></head><body>");
myWin.document.write("<center><font size=+3>");
myWin.document.write("System information: <br>");
myWin.document.write("</font></center>");
myWin.document.write("Browser: "+navigator.appName+"<br>");
myWin.document.write("Version: "+navigator.appVersion+"<br>");
myWin.document.write("Windows folder: " + fso.GetSpecialFolder(0) + "<br>");
myWin.document.write("System folder: " + fso.GetSpecialFolder(1) + "<br>");
myWin.document.write("Temporary folder: " + fso.GetSpecialFolder(2) + "<br>");

  e = new Enumerator(fso.Drives);
  s = "";
  for (; !e.atEnd(); e.moveNext())
  {
    x = e.item();
	//_dr = x.DriveLetter + ":\\"
	
	//alert(_dr);
    s = s + x.DriveLetter;
    s += ":\\ - ";
    if (x.DriveType == 3)
      n = x.ShareName;
    else if (x.IsReady)
	 {
      n = x.VolumeName + "<br>";
	  dr = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(x.DriveLetter + ":\\")));
	  n = n + " FileSystem: " + dr.FileSystem + "<br>"; 
	  switch (dr.DriveType)
       {
        case 0: t = "Unknown"; break;
        case 1: t = "Removable"; break;
        case 2: t = "Fixed"; break;
        case 3: t = "Network"; break;
        case 4: t = "CD-ROM"; break;
        case 5: t = "RAM Disk"; break;
       }
	  n = n + " Type: " + t  +  "<br>" + " SN: " + dr.SerialNumber + "<br>";
	  n = n + "Total size: " + Math.round(dr.TotalSize/Math.pow(1024, 2)) + " Mb <br>";
	  n += "Free space: " + Math.round(dr.FreeSpace/Math.pow(1024, 2)) + " Mb <br>";
	  n += "Available space: " + Math.round(dr.AvailableSpace/Math.pow(1024, 2)) + "Mb <br>";
	 }
    else
      n = "[Drive not ready]";
		
    s +=  n + "<br>";
  }
myWin.document.write("<center><font size=+1>");
myWin.document.write("Storage devices:") 
myWin.document.write("</font></center>");
myWin.document.write(s + "<br><hr>");


//tmp = "Имя браузура: "+navigator.appName;
//myWin.document.write(tmp);
myWin.document.write("</body></html>");

// закрити документ - (але не вікно!)
myWin.document.close();
}
