var browserename = "browsing";
var defbrowse = "<br />" + browserename + " - text/HTML document";
var defmgt = "<br />filemgt - text/HTML document";
var defstate = "<br />statement - text/HTML document";
var defexp = "<br />exploits - DIR 1 file(s)";
var defentertain = "<br />entertainment - DIR 2 file(s)";
var here = "..<br /><br />No files to display<br /><br />";
var defshut = "<br />shutdown - text/HTML document<br /><br />";
var exploits = "..<br />" + defshut;
var entertain = "..<br /><br />dosbox - text/HTML document<br />entertain - text/HTML document<br /><br />";
var hidden = "..<br /><br />about - text/HTML document<br /><br />";
var allowshut = "no";
var allowfun = "no";
var allowcd = "yes";
var allowbrowsing = "yes";
var allowmanage = "yes";
var allowstate = "yes";
var allowhide = "no";
var allowbox = "no";
var allowtain = "no";
var delbrowse = "no";
var delmanage = "no";
var delstate = "no";
var delshut = "no";   
var delbox = "no";
var deltain = "no";
var admins = "no";
var one = "1";
var numfile = "0";
var name = "";
var call = []
    call[1] = "empty"
    call[2] = "empty"
    call[3] = "empty"
    call[4] = "empty"
    call[5] = "empty";
var proper = []
    proper[1] = ".'/\'."
    proper[2] = ".'/\'."
    proper[3] = ".'/\'."
    proper[4] = ".'/\'."
    proper[5] = ".'/\'.";
var dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.<br /><br />";
function onDirUpdate()
{
     dir = '..<br />' + defbrowse + '' + defmgt + '' + defstate + defexp + '<br />here - DIR 0 file(s)' + defentertain + '<br />' + call[1] + '<br />' + call[2] + '<br />' + call[3] + '<br />' + call[4] + '<br />' + call[5] + '<br /><br /><br />To view a text/HTML document, type the document\'s name in the field above.<br /><br />';
}
function onDirUpdateExpl()
{
    if ( allowshut == "no" )
        {
            dir = "..<br /><br />No files to display";
        }
    else if ( allowshut == "yes" )
        {
            dir = exploits;
        }
}
function onChange(input)
{
     if ( dir == entertain )
       {
         document.getElementById('input').innerHTML = "<B>C:\\JoyOfDOS\\Entertainment\\&gt;<input type='text' name='cmd' value='' style='color: CCCCCC; background-color: 000000; border: 1px solid grey;' return false;></B>";
         window.document.theform.cmd.focus();
       }        
     else if ( dir == here )
       {
         document.getElementById('input').innerHTML = "<B>C:\\JoyOfDOS\\Here\\&gt;<input type='text' name='cmd' value='' style='color: CCCCCC; background-color: 000000; border: 1px solid grey;' return false;></B>";
         window.document.theform.cmd.focus();
       }
     else if ( dir == exploits )
       {
         document.getElementById('input').innerHTML = "<B>C:\\JoyOfDOS\\Exploits\\&gt;<input type='text' name='cmd' value='' style='color: CCCCCC; background-color: 000000; border: 1px solid grey;' return false;></B>";
         window.document.theform.cmd.focus();
       }
     else if ( dir == hidden )
       {
         document.getElementById('input').innerHTML = "<B>C:\\JoyOfDOS\\Hidden\\&gt;<input type='text' name='cmd' value = '' style='color: CCCCCC; background-color: 000000; border: 1px solid grey;' return false;></B>";
         window.document.theform.cmd.focus();
       }
     else if ( allowcd == "yes" )
       {
         document.getElementById('input').innerHTML = "<B>C:\\JoyOfDOS\\&gt;<input type='text' name='cmd' value='' style='color: CCCCCC; background-color: 000000; border: 1px solid grey;' return false;></B>";
         window.document.theform.cmd.focus();
       }
}
 
function onSave()
             {
                 file = document.all.text.value;
                 name = prompt("Enter file name:","");
                 numfile = numfile/1 + 1/1;
                 
                 if ( name == "" )
                   { 
                      name = "nameless";
                   }
                 else if ( document.all.text.value == "" )
                   { 
                      file = " ";
                   } 
                   if (numfile <= 5 )
                     {
                        call[numfile] = name;
                        proper[numfile] = file;
                        document.getElementById('output').innerHTML = "File " + name + " saved.<br /><br />" + document.all.output.innerHTML;
                        window.document.theform.cmd.focus();
                     }
                   else if ( numfile > 5 )
                     {
                       document.getElementById('output').innerHTML = "<font color=\"red\">Maximum file limit exceeded.</font><br /><br />Use 'del' to make room for new files.<br /><br />" + document.all.output.innerHTML;
                       window.document.theform.cmd.focus();
                     }
                   onDirUpdate();
          }   
function onView()
{
    document.all.output.innerHTML = document.all.text.value + "<br /><br />" + document.all.output.innerHTML;
    window.document.theform.cmd.focus();
}
function onparse(output)
{
    if (window.document.theform.cmd.value.toLowerCase() == "help")
    {
	if ( admins == "no" )
	    {
		help_user = "cls - Clears screen.<br />cd - moves to file/folder<br />dir - Displays files/folders in current directory.<br />del - Files are 'deleted' until reload<br />ver - Displays version<br />echo - Echos any text you input. try 'echo hello'<br />edit - Brings up simple text editor.<br>bugs - A list of known bugs<br />date - Gives the current date and time.<br />calc - A simple calculator<br />quit - Re-directs to http://www.google.com<br />source - Gives the source of joy.js<br />archives - Lists source from older versions<br />test - Displays a list of compatible browsers<br />/? - Quick help. Type '/?' after a command for sample syntax<br /><br />";
		document.getElementById(output).innerHTML = help_user + document.all.output.innerHTML;
		window.document.theform.cmd.value = "";
	    }
	else if ( admins == "yes" )
	    {
		help_admin = "cls - Clears screen.<br />cd - moves to file/folder<br />dir - Displays files/folders in current directory.<br />del - Files are 'deleted' until reload<br />ver - Displays version<br />echo - Echos any text you input. try 'echo hello'<br />edit - Brings up simple text editor.<br>bugs - A list of known bugs<br />date - Gives the current date and time.<br />quit - Re-directs to http://www.google.com<br />source - Gives the source of joy.js<br />archives - Lists source from older versions<br />test - Displays a list of compatible browsers<br />/? - Quick help. Type '/?' after a command for sample syntax<br />makelog - A list of progresses, and new features.<br />printvars - Gives the value of all vars.<br /><br /><br />Hope you like it!";
		document.getElementById(output).innerHTML = help_admin + document.all.output.innerHTML;
		window.document.theform.cmd.value = "";
	    }
	    window.document.theform.cmd.focus();
    }
    else if ( window.document.theform.cmd.value == "/?" )
        {
            quickhelp = "The '/?' command is used as an ammendment to commands so that the system will echo a quick description of how to use said command.<br /><br />Example syntax: 'COMMAND' /?<br /><br />Replace 'COMMAND' with the command you would like additional help with. eg 'cd /?'<br /><br />";
            document.getElementById(output).innerHTML = quickhelp + document.all.output.innerHTML;
            window.document.theform.cmd.value = "";
            window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cls")
        {
            document.getElementById(output).innerHTML = " ";
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cls /?" )
        {
            quickhelp_cls = "The 'cls' command clears the screen. Sample syntax: cls (No args)<br/ ><br />";
            document.getElementById(output).innerHTML = quickhelp_cls + document.all.output.innerHTML;
            window.document.theform.cmd.value = "";
            window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "here" )
        {
            if ( allowcd == "yes" )
                {
                    dirhere = "'here' is a directory, try 'cd here'<br /><br />";
                    document.getElementById(output).innerHTML = dirhere + document.all.output.innerHTML;
                    window.document.theform.cmd.value = "";
                    window.document.theform.cmd.focus();
                }
            else {
                losthere = "'here' No such command or filename.<br /><br />";
                document.getElementById(output).innerHTML = losthere + document.all.output.innerHTML;
                window.document.theform.cmd.value = "";
                window.document.theform.cmd.focus();
                }
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cd" )
        {
            cdwhere = "No directory specified.<br /><br/ >Type 'dir' for a list of files and directories.<br /><br />";
            document.getElementById(output).innerHTML = cdwhere + document.all.output.innerHTML;
            window.document.theform.cmd.value = "";
            window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cd /?" )
        {
            quickhelp_cd = "The 'cd' command moves the shell to a new directory so that different files can be viewed, edited and deleted.<br />Sample syntax: cd 'DIR' <br /><br />In the example above, 'DIR' should be replaced with the name of the directory you wish to view. To go up one directory, 'DIR' should be replaced with '..' eg 'cd ..' would move you back one directory.<br /><br />";
            document.getElementById(output).innerHTML = quickhelp_cd + document.all.output.innerHTML
            window.document.theform.cmd.value = "";
            window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cd here")
     {
	 if ( allowcd == "yes" )
	     {
		 window.document.theform.cmd.value = "";
		 dir = here;
		 allowcd = "no";
		 allowfun = "no";
		 allowshut = "no";
		 allowbrowsing = "no";
		 allowmanage = "no";
		 allowstate = "no";
         onChange(input);
	     }
	  else if ( allowcd == "no" )
	     {
	        nocd = "No DIR named 'here' in this directory.<br /><Br />Type dir for a list of availible files and directories.<br /><br />";
	        document.getElementById(output).innerHTML = nocd + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	     }
	     window.document.theform.cmd.focus();
     }
    else if ( window.document.theform.cmd.value.toLowerCase() == "exploits" )
          {
              if ( allowcd == "yes" )
                  {
                      dir_exploits = "'exploits' is a directory, try typing 'cd exploits'<br /><br />";
                      document.getElementById(output).innerHTML = dir_exploits + document.all.output.innerHTML;
                      window.document.theform.cmd.value = "";
                      window.document.theform.cmd.focus();
                  }
              else {
                noexploits = "'exploits' No such command or filename.<br /><br />";
                document.getElementById(output).innerHTML = noexploits + document.all.output.innerHTML;
                window.document.theform.cmd.value = "";
                window.document.theform.cmd.focus();
                }
          }
    else if ( window.document.theform.cmd.value.toLowerCase() == "cd exploits" )
	  {
	      if ( allowcd == "yes" )
		  {
		      dir = exploits;
		      if ( delshut == "yes" )
			  {
			      allowshut = "no";
			  }
		      else if ( delshut == "no" )
			  {
			      allowshut = "yes";
			  }
		      allowbrowsing = "no";
		      allowmanage = "no";
		      allowstate = "no";
		      window.document.theform.cmd.value = "";
		      allowcd = "no";
		      allowfun = "no";
		      allowhide = "no";
              onChange(input);
		  }
		else if ( allowcd == "no" )
		{
		    nodir_exploits = "No DIR named 'exploits' in this directory.<br /><br />Type 'dir' for a list of availible files and directories.<br /><br />";
		    document.getElementById(output).innerHTML = nodir_exploits + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	  }
      else if ( window.document.theform.cmd.value.toLowerCase() == "entertainment" )
          {
                  if ( allowcd == "yes" )
                      {
                          dir_entertain = "'entertainment' is a directory, try 'cd entertainment'<br /><Br />";
                          document.getElementById(output).innerHTML = dir_entertain + document.all.output.innerHTML;
                          window.document.theform.cmd.value = "";
                          window.document.theform.cmd.focus();
                      }
                  else {
                    lostentertain = "'entertainment' No such command or filename.<br /><br />";
                    document.getElementById(output).innerHTML = lostentertain + document.all.output.innerHTML;
                    window.document.theform.cmd.value = "";
                    window.document.theform.cmd.focus();
                    }
          }
      else if ( window.document.theform.cmd.value.toLowerCase() == "cd entertainment" )
	  {
	      if ( allowcd == "yes" )
		  {
		      dir = entertain;
		      allowfun = "yes";
		      if ( delbox == "yes" )
			  {
			      allowbox = "no";
			  }
		      else if ( delbox == "no" )
			  {
			      allowbox = "yes";
			  }
		      if ( deltain == "yes" )
			  {
			      allowtain = "no";
			  }
		      else if ( deltain == "no" )
			  {
			      allowtain = "yes";
			  }
		      allowbrowsing = "no";
		      allowmanage = "no";
		      allowstate = "no";
		      window.document.theform.cmd.value = "";
		      allowcd = "no";
		      allowshut = "no";
		      allowhide = "no";
              onChange(input);
		  }
		else if ( allowcd == "no" )
		{
		    nodir_entertain = "No DIR named 'entertainment' in this directory.<br /><br />Type 'dir' for a list of availible files and directories.<br /><br />";
		    document.getElementById(output).innerHTML = nodir_entertain + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	  }
      else if ( window.document.theform.cmd.value.toLowerCase() == "cd hidden" )
	  {
	      if ( allowcd == "yes" )
		  {
		      dir = hidden;
		      allowhide = "yes";
		      allowcd = "no";
		      allowshut = "no";
		      allowfun = "no";
		      allowbrowsing = "no";
		      allowmanage = "no";
		      allowstate = "no";
		      window.document.theform.cmd.value = "";
		      onChange(input);
		  }
		  else if ( allowcd == "no" )
		    {
		        nodir_hide = "No DIR named 'hidden' in this directory.<br /><br />Type 'dir' for a list of availible files and directories.";
		        document.getElementById(output).innerHTML = nodir_hide + document.all.output.innerHTML;
		        window.document.theform.cmd.value = "";
		    }
		  window.document.theform.cmd.focus();
	  }
      else if ( window.document.theform.cmd.value.toLowerCase() == "cd .." )
	  {
	       onDirUpdate();
	       window.document.theform.cmd.value = "";
	       allowshut = "no";
	       allowfun = "no";
	       if ( delbrowse == "yes" )
		   {
		       allowbrowsing = "no";
		   }
	       else if ( delbrowse == "no" )
		   {
		       allowbrowsing = "yes";
		   }
	       if ( delmanage == "yes" )
		   {
		       allowmanage = "no";
		   }
	       else if ( delmanage == "no" )
		   {
		       allowmanage = "yes";
		   }
	       if ( delstate == "yes" )
		   {
		       allowstate = "no";
		   }
	       else if ( delstate == "no" )
		   {
		       allowstate = "yes";
		   }
	       allowcd = "yes";
	       allowhide = "no";
           onChange(input);
           window.document.theform.cmd.focus();
        }
      else if ( window.document.theform.cmd.value.toLowerCase() == "dir")
	{
	    document.getElementById(output).innerHTML = dir + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "dir /?" )
	{
	    quickhelp_dir = "The 'dir' command displays the files and directories within the current directory, or the specified directory.<br /><br />Sample syntax: dir (No args)<br /><Br />The above example would display files and directories within the current directory. To view files and directories of another directory, simply add the directory name to the end of the command.<br /><Br />Sample syntax dir 'DIR' (Where 'DIR' is the directory name.)<br /><br />";
	    document.getElementById(output).innerHTML = quickhelp_dir + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "ver" )
	{
	    ver = "Version 3.5 BETA of JoyOfDOS.5u.com<br />'Shell' written in JavaScript.<br />http://www.joyofdos.5u.com/joy.js for source code, or type 'source'.<br /><br />Email bug reports to:<br />Graveworm.TheMachine@gmail.com.<br /><Br />Written for Mozilla Firefox (3.0+)<br /><Br />";
	    document.getElementById(output).innerHTML = ver + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "ver /?" )
        {
            quickhelp_ver = "The 'ver' command displays the current version of the shell.<br /><Br />Example syntax: ver (No args)<br /><br />";
            document.getElementById(output).innerHTML = quickhelp_ver + document.all.output.innerHTML;            
            window.document.theform.cmd.value = "";
            window.document.theform.cmd.focus();
        }   
      else if ( window.document.theform.cmd.value.toLowerCase() == "browsing" )
	{
	    if ( allowbrowsing == "yes" )
		{
		   var browsing = "This article is a brief introduction to browsing through the DOS shell, as an added bonus, I will describe which features of browsing through the DOS shell are and aren't supported via this website. Note: This website is meant only to help ease users into using the DOS shell by implementing very basic commands that are usually used by the DOS shell.<br /><br />If you don't know what the DOS shell is (in Windows it's the command prompt as a full featured DOS shell does not exist in Windows, press ALT + ENTER to make it fullscreen) press the Windows-logo key + R, this will bring up a 'Run command' box. Type cmd, or COMMAND.COM either way, this will launch the command prompt.<br /><br />To get a list of files and folder in the directory you are currently in, try typing 'dir' and pressing ENTER. This command is short for directory, and gives you a list of all the files and folders within the current folder. To get a list of files and folders inside a new folder, type: 'dir foldername' where foldername is the name of the folder you are trying to look inside of. To go back one directory or folder, type cd .. (Try in the field above, typing 'cd entertainment' and then 'dir', now type 'cd ..' and then 'dir'.<br /><br />To move the shell to a new folder, you would use the 'cd' command. Try typing 'cd C:\\' this command should change the (C:\\...\\>) to (C:\\>) and put your shell in the root of the default hard drive C:.<br /><br />Note: You do not have to type the whole folder/file name out in the DOS shell. By typing part of a file/folder name and pressing TAB, this will enable autocomplete which will finish filling out part or all of the remaining file/folder name.<br><br>(Note: Autocomplete not supported by this website.)<br /><br />";
	     document.getElementById(output).innerHTML = browsing + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
		}
	    else if ( allowbrowsing == "no" )
		{
		    lostbrowse = "'browsing' No such command or file name.";
		    document.getElementById(output).innerHTML = lostbrowse + document.all.output.innerHTML
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	 }
      else if ( window.document.theform.cmd.value.toLowerCase() == "filemgt" )
	{
	    if ( allowmanage == "yes" )
		{
	    var filemgt = "This article is a brief introduction to file management in the DOS shell, please note, that <b />SOME</b /> file management commands are supported by this site (BETA v1.5) the 'del' command will delete files until the page is reloaded. File management is the moving, creating, and deleting of files. All of which can be carried out in the DOS shell. Open up the DOS shell (By hitting Windows-logo key + R and typing 'cmd'.) and type 'edit' for a simple example of how to create files through the DOS shell. By typing 'edit' you will be presented with a blue screen with a menu atop a notepad-like editor. This is extremely useful for text files, and batch files, I suppose you could also edit HTML this way. To edit a specific file name you can type: 'edit filename.extension' (Note that this site does not support editing specified filenames.) Eg. 'edit file.txt' then, when you are done editing said file, it will automatically save as 'file.txt' to the current directory.<br /><br />To move files to new folders, or locations, you can either copy them to a new folder, using the 'copy' command Eg. 'copy file.txt C:\\folder\\file.txt' this command would leave a copy of 'file.txt' in the current folder as well as a copy of the file in 'C:\\folder\\'. An alternative would be using the 'move' command. Eg. 'move file.txt C:\\folder\\.<br /><br />Deleting files can be done using one of two commands, both accomplishing the same thing. The commands 'del' and 'erase' will both delete a specified file. Eg. 'del file.txt' or 'erase file.txt'. <br /><br />";
	    document.getElementById(output).innerHTML = filemgt + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
		}
	    else if ( allowmanage == "no" )
		{
		    lostfilemgt = "'filemgt' No such command or file name.<br /><br />";
		    document.getElementById(output).innerHTML = lostfilemgt + document.all.output.innerHTML
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "edit" )
	{

	 var edit = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' ></textarea><br /><a href=\"#\" onClick=\"onSave()\";>Save</a> | <a href=\"#\" onClick=\"onView()\">View as HTML</a><br /><br />"
	    document.getElementById(output).innerHTML = edit + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "edit /?" )
	    {
	        quickhelp_edit = "The 'edit' command brings up a simple text editor.<br/ ><br />Example syntax: edit (No args.)<br /><Br />In this shell you have the ability to save up to five files via the edit console. Please note: file management (Saving, and deleting) is only supported by Mozilla Firefox (v3.0+)<br /><Br />";
	        document.getElementById(output).innerHTML = quickhelp_edit + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();
	    }
      else if ( window.document.theform.cmd.value.toLowerCase() == "bugs" )
	{
	    bugs = "Email bug reports to: Graveworm.TheMachine@gmail.com.<br /><br /><br />Version 3.5 BETA bugs:<font color=\"yellow\"> This is the version of the shell you're using.</font><br />Added a 'GUI' for the 'del' command. Type 'del' without any arguments for the GUI.<br />Added quickhelp for commands. Type '/?' after a command for a quick explanation of said command.<br /><br />Version 3.0 Stable bugs:<br />Text input does not autofocus when directories are changed.(FIXED)<br />Still working with edit/rename code; getting better.<br />Changed function handler from onKeyUp to onSubmit. In laymans terms, you can use the enter key without the page reloading.<br /><br />Version 2.5 BETA bugs:<br />You may have noticed seeing \".'/'.\" in the directory. Those are the five files you're allowed to save. I'm trying to add them dynamically to the directory, however, the save file command is not currently working.(Command is working IN MOZILLA FIREFOX 11-4-09, just need to finish re-writing some code)<br />Added calculator.<br />Fixed completely ability to save up to five files (works in firefox.)<br />Added parsing for lazy input. (toLowerCase()). Need to format calculator.<br /><br />Version 2.0 stable bugs:<br />Added ability to save one file via edit console. Currently, you can create one file, view it and delete it. You cannot see it by using the dir command, but I'm working on it.<br /><br />Version 2.0 RC bugs:<br />Bugs in the new 2.0 RC version are minimal. Mostly things I'm not even sure how they happened, and are far too scarce for me to document every single one.<br /><br />Version 1.5 BETA bugs:<br />'del' command completely fixed.<br />Still fixing the haunting 'No such command or file name' (Fixed via removing it completely.) while user's type.<br />Pressing 'enter' no longer reloads page. (Sometimes it does...buggy at best.)<br /><br />Version 1.0 Stable bugs:<br />Added a 'del' feature, dir does display deleted files (update 4-29-09) Fixed directory displaying deleted files, still buggy, but by using cd .. you can see the actual list of useable files; when in root folder, use 'dir ..' trying to fix. Very buggy. (using 'cd ..' after deleting a file will bar it from the directory list.<br />'cd' bug almost completely gone.<br />Trying to make C:\\JoyOfDOS\\&gt; location dynamic.<br />'dir' works dynamically.<br />Added feature to look inside other directorys without cding eg. 'dir exploits' will show contents of folder 'exploits'<br />'No such command or file name' still pops up as user is typing.<br />Source object now black text on blue background.<br />Fixed ability to look at files from different folders.<br /><br />Version RC 0.5 bugs:<br />dir command not working with 'cd'.<br />\"onChange not defined\"<br />Too much tinkering with 'cd', took it back to 'nowhere to cd to'.<br />'cd here' not yet implemented.<br />Source object is all black.<br />Couldn't figure out keycode JavaScript event. Left the handler with onKeyUp.<br /><br /><br />Dev Shell bugs:<br />Used onKeyUp instead of onSubmit, onClick.<br />Fixed magic echo bug (Ability to echo without using echo command eg. 'e .... wrote .. to 'output.'<br />'cd' command?<br />Made edit shell work.<br />Decided on Layout<br />Wrote some articles.<br /> <br />";
	    document.getElementById(output).innerHTML = bugs + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "bugs /?" )
	    {
	        quickhelp_bugs = "The 'bugs' command displays bugs, fixes, and the version of the shell you're using.<br /><br />Example syntax: bugs (No args.)<br/ ><br />";
	        document.getElementById(output).innerHTML = quickhelp_bugs + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();
	    }
      else if ( window.document.theform.cmd.value.toLowerCase() == "statement" )
	{
	    if ( allowstate == "yes" )
		{
	    var statement = "The aim of JoyOfDOS.5u.com is to teach the user concepts in DOS by immersing them in an environment that mimcs that of the DOS shell. We believe this will give the user an advantage when they are actually using the DOS shell.<br /><br />There are bugs, they will be fixed on an as noticed basis. We hope you enjoy your stay at JoyOfDOS.5u.com.<br /><br />(For information about submitting bug reports, type 'bugs' in the field above.)<br /><br />Thank you for visiting Joy Of DOS.<br /><br />";
	    document.getElementById(output).innerHTML = statement + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
		}
	    else if ( allowstate == "no" )
		{
		    loststate = "'statement' No such command or file name.<br /><Br />";
		    document.getElementById(output).innerHTML = loststate + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "entertain" )
	{
	    if ( allowfun == "yes" )
		{
		    if ( allowtain == "yes" )
			{
			    var entertainment = "This article is a quick list of entertainment in DOS. There are several games that can be found over the internet which run on the DOS platform. Some, not all of these games are quite fun. A personal favorite of mine is Commander Keen. A simple web-search can yeild what is known as a 'shareware' version of the game, which is generally the first 'episode' in a series, or a Demo which is generally the first level of a game. <a href='http://dosgames.com/'>DOSgames.com</a> has several shareware, freeware, and demos on thier site.<br><br>In Windows, many features of these DOS games may not be supported. For this, we would have to use DOSbox. DOSbox is a DOS shell emulator for Windows, Mac, and Linux/UNIX. It is free to download and fixes many compatibility issues caused by Windows.<br><br>Type 'dosbox' in the input above to learn more.<br /><br />";
			    document.getElementById(output).innerHTML = entertainment + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		}
	    else if ( allowtain == "no" )
		{
		    lostentertain = "'entertain' No such command or file name.";
		    document.getElementById(output).innerHTML = lostentertain + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "about" )
	{
	    if ( allowhide == "yes" )
		{
		    var about = "This is an about article.<br /><br />So you've read the source file and saw 'cd hidden' congratulations. Since you have the competence to read the source, I'd like to ask you if you have any answers for me. That is to say: if you have noted any bugs and fixed them, please send me the solutions. (type 'bugs' for information about bug reports.) IDK what else to tell ya.<br /><br />";
		    document.getElementById(output).innerHTML = about + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( allowhide == "no" )
		{
		    lostabout = "'about' No such command or file name.";
		    document.getElementById(output).innerHTML = lostabout + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "dosbox" )
	{
	    if ( allowbox == "yes" )
		{
	    var dosbox = "DOSbox is an open source project dedicated to running DOS applications and games that are majorly no longer supported by Windows, DOSbox is also availible for Mac, Windows, and Linux/UNIX. This article will serve as a 'how-to' for installation and running applications.<br /><br />Download DOSbox from <a href='http://www.dosbox.com/'>here</a>. For Windows, simply download the *.exe installer and let the setup guide you through the installation. I have no Mac experience, so, for the time being, this will remain blank. For Linux/UNIX, check for distro specific installations, or download source. (Note: For source, you must have GCC and the various dependancies.)<br /><br />If you are running Debian/Ubuntu, for example, you can download DOSbox by typing:<br />#sudo apt-get install dosbox.xx.x //where xx servers as the version number.//<br />The latter code will install DOSbox through the terminal, the alternative would be to serach for DOSbox through synaptic.<br />Installing from source:<br />Download source from <a href='http://www.dosbox.com'>dosbox.com</a> extract it. (In the example, I have 'extracted' it to 'dosbox')<br /><br />#cd dosbox<br />#./configure<br />#sudo make<br />#sudo make install<br />(Note: If you're not running Debian/Ubuntu, use su to run commands as root in place of sudo.)<br /><br />If your computer has all the nessicary dependancies, this should work fine. Otherwise, if you have a package manager, install dosbox through your package manager instead.<br /><br />Using DOSbox:<br />So, now you've got DOSbox installed, and you've got some DOS games/applications you want to run. Open up DOSbox, you should be presented with a terminal displaying 'Z:\\>' and you're thinking, I know! I'll just cd C:\\. Wrong, with DOSbox, you have to 'mount' a drive or folder, if you try to mount 'c' as 'C:\\' you will be warned about how that is not reccomended. So, the simple solution would be, put all of your DOS games and apps into a folder called 'dos' in your C: drive. Eg. C:\\dos\\. Then go back over to DOSbox and type:<br />Z:\\&gt;mount c C:\\dos<br />Which should mount the folder 'dos' as the C: drive, you can change the current drive by typing:<br /><br />Z:\\>C:<br /><br />Which will change the \"Z\" to a \"C\".<br /><br />C:\\&gt;<br /><br />";
	    document.getElementById(output).innerHTML = dosbox + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
		}
	    else if ( allowfun == "no" )
		{
		    lostdosbox = "'dosbox' No such command or file name.<br /><br />";
		    document.getElementById(output).innerHTML = lostdosbox + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "shutdown" )
	{
	    if ( allowshut == "yes" )
		{
	   var shutdown = "The command shutdown.exe is a command in Windows that is used to shut down the system. In this article, I will look over the command shutdown.exe and view it's potential as an exploit.<br /><br />First, let's have a quick look at the command shutdown.exe. If you were to open up the command prompt and type 'shutdown.exe' nothing would happen. This is because the command 'shutdown.exe' is dependant on switches. For example, if you typed 'shutdown.exe -l' in the command prompt, you would be logged off of your current session. The switches for shutdown.exe are: -s (Shuts down a user's computer.) -r (Reboots a user's computer.) -l (Logs a user off of their current session.) -f (Forces shutdown.) -t (Sets a timer in seconds for shutdown, Eg. shutdown.exe -r -t 20 would reboot a user's computer in 20 seconds. NOTE: The timer option is only usable with -r and -s switches.) -c (Leaves a comment for a user. Eg. shutdown.exe -r -t 20 -c Hello would reboot a user's computer in 20 seconds displaying the comment 'hello'. NOTE: Comments can only be used with timers.) There are also some misc. options that I will not go in to at this time, most of which are for remote computers.<br /><br />So how can this command be exploited for malicious purposes? Batch scripting. Batch files are basically text documents with the extension *.bat instead of *.txt so that Windows will recognize them as a file that runs in the command prompt. Here's a simple example of a batch script:<br /><textarea name='ex' style='color: grey;background-color: blue;height:70;width:200;border: 1px solid black;'>@echo off \ndir</textarea><br />If you were to save the example as dir.bat, every time you were in the same directory as 'dir.bat' in the command prompt, you could type dir.bat so that it would carry out the command 'dir'. Although the example isn't very useful, every time Windows starts up, it checks the C:\\documents and settings\\(username or)all users\\start menu\\programs\\startup\\ for a file called AUTOEXEC.BAT, if it finds this file, it carrys out whatever command is contained within. So you could write a simple batch file that would shut down a user's computer, but how would you place it in the startup folder without having two batch files? The answer is, by using C++. I have written four versions of the shutdown.exe exploit in C++. Only two of which are relevant. <br /><a href='version1.html'>Version 1</a><br />and<br /><a href='version21.html'>Version 2.1</a><br />Both of these place a batch file in the C:\\...\\startup folder called AUTOEXEC.BAT. Version 2.1 customizes the batch file before placing it in said folder. Version 1 simply places a batch file that looks like this:<br /><textarea name='shut' style='color: grey;background-color: blue;height: 90px;width: 150px;border: 1px solid black;'>@echo off \nshutdown.exe -l \nexit</textarea><br />in the startup folder which logs a user off every time they log into their session.<br /><br />";
	   document.getElementById(output).innerHTML = shutdown + document.all.output.innerHTML;
	   window.document.theform.cmd.value = "";
		}
	    else if ( allowshut == "no" ) 
		{
		    lostshutdown = "'shutdown' No such command or file name.<br /><br />";
		    document.getElementById(output).innerHTML = lostshutdown + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
      else if ( window.document.theform.cmd.value.toLowerCase() == "date" )
	{
	    var today = Date();
	    document.getElementById(output).innerHTML = today + "<br /><br />" + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "date /?" )
	    {
	        quickhelp_date = "The 'date' command displays the current date and time.<br /><br />Example syntax: date (No args.)";
	        document.getElementById(output).innerHTML = quickhelp_date + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();
	    }
      else if ( window.document.theform.cmd.value.toLowerCase() == "source" )
	{
	    thesource = "Or visit <a href='joy.js'>this link.</a><br /><B><object data='joy.js' style='color: grey;background-color: blue;border: hidden;' width='400' height='375'></object></B><br /><br /><a href='http://www.joyofdos.5u.com/joy3.rar'>Download source (V3.0S)</a><br /><br />";
	    document.getElementById(output).innerHTML = thesource + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "source /?" )
	    {
	        quickhelp_source = "The 'source' command displays the file joy.js in a textarea similar to the edit console. There is also an option to view the file joy.js directly.<br /><br />Example syntax: source (No args)";
	        document.getElementById(output).innerHTML = quickhelp_source + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();
	    }
      else if ( window.document.theform.cmd.value.toLowerCase().indexOf("e") == 0 )
	{
	    if ( window.document.theform.cmd.value.toLowerCase().indexOf("c") == 1 )
		{
		    if ( window.document.theform.cmd.value.toLowerCase().indexOf("h") == 2 )
			{
			    if ( window.document.theform.cmd.value.toLowerCase().indexOf("o") == 3 )
				{
		    echome = window.document.theform.cmd.value.substr(4);
		    document.getElementById(output).innerHTML = echome + "<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		    window.document.theform.cmd.focus();
		                }
			}
		}

	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "dir here" )
	{
	    document.getElementById(output).innerHTML = here + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "dir exploits" )
	{
	    document.getElementById(output).innerHTML = exploits + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "dir entertainment" )
	{
	    document.getElementById(output).innerHTML = entertain + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "dir .." )
	{
	    root_dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.<br /><Br />";
	    document.getElementById(output).innerHTML = root_dir + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "backdoor" )
	{
	    backdoor = "Sorry, we locked it up this time.<br /><br />Try copying/pasting/modifying this:<br /><br />echo &lt;a href=\"javascript:function onborder(output) { document.getElementById(output).style.border = '20px double blue'}\" onMouseOver=\"onborder('output')\";&gt;Link text.&lt;/a&gt;<br /><br />Don't ask me why, but you have to click it and then mouse over it, apparently. Anyway, this works because the 'echo' command modifys the 'innerHTML' attribute of the div 'output'. So if you were to insert HTML code into the field above using the echo command, it would be parsed. Have fun.<br /><br />Or you could try this useless bit of JavaScript, maybe if you play with the variables enough, you can 'cheat' to cd directly or something. Anyway, here's the code I mentioned. <br /><br />echo &lt;a href='javascript:alert(dir);' return false;&gt;link text&lt;/a&gt;  This command will alert what the variable 'dir' has been set to show in this directory. Have fun learning!<br /><br />You can change all sorts of things by manipulating variables. For the most part, you'll need to start like this (To exploit the echo command) &lt;a href=\"javascript:var-name = 'value';alert(var-name);\" /&gt;link text&lt;/a&gt;<br />Now, the basic idea is that by using links, you can change the value of variables, by using the a href's ability to use JavaScript. Getting the variable names is basically as easy as typing 'source'. The only real 'work' you'd need to do, would be to figure out exactly what each variable does, and most are named very simply. Alert is only used so that the page does not re-load in the process, which would make your variable manipulation useless.<br /><br />Making links that manipulate variables via prompt boxes. I'll give ONE example, the rest are up to you. <br /><br />&lt;a href=\"javascript:dir = prompt('Change dir.','');dir;alert(dir);\" />link text&lt;/a&gt; <br /><br />This link (using echo exploit) will change what you see every time you view the directory.<br /><br /><Br />New backdoor tip. Just for those of you who haven't played around with the shell that much. (I highly recommend you do, that's why it's here.)<br /><br />You can edit the value of document.theform.cmd.value (The text input above) via links using HTML links with JavaScript.<br /><Br />If you don't know already, by typing echo (above) and following your echo command by any HTML commands for a link you would use something like so: &lt;a href=\"http://www.website.com\"&gt;link text&lt;/a&gt; Now, to change values in this shell, you must use JavaScript, since this site was written with JavaScript. To do something simple with JavaScript from a link, you could type something like this: &lt;a href=\"javascript:alert('text');\"&gt;link text&lt;/a&gt; This example would act like a link and when clicked, would carry out some JavaScript. A similar way to do the same thing would be to type: &lt;a href=\"#\" onClick=\"alert('text');\"/&gt;link text&lt;/a&gt;<br /><Br />Okay. Now if you wanted to change the value of what you see in the div output, what you're looking at right now is text outputted to 'output'. To access this via JavaScript and through a link, I'd type: &lt;a href=\"javascript:document.getElementById('output').innerHTML = 'text';alert('text');\"/&gt;link text&lt;/a&gt; The alert is necessary. Without the alert, the page would be reloaded and whatever you wanted to do would be lost. This example is however different than editing the text input (document.theform.cmd) above.<Br /><Br />To accomplish changing the value of the text input above, type: &lt;a href=\"javascript:document.theform.cmd.value = 'text';alert('text');/&gt;link text&lt;/a&gt;\"<br /><br />Here's a fun one, creating phantoms! Try copying and pasting this above: echo &lt;a href=\"javascript:function onphantom() { document.theform.cmd.value = 'SPOOKY!!!'; }function offphantom() { document.theform.cmd.value = '';}\" onMouseOver=\"onphantom()\"; onMouseOut=\"offphantom();\"&gt;linkme&lt;/a&gt;<br /> This code uses functions to create 'phantom' text in the cmd text input and removes it when the mouse leaves the link. (For some reason, you have to click, then mouse over.)<br /><br />";
	    document.getElementById(output).innerHTML = backdoor + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del" )
	{
	            if ( allowcd == "yes" )
	                {
	                    delroot = "Please select a file below:<br /><br />System files:<br /><a href='javascript:var allowbrowsing = \"no\";defbrowse = \"\";onDirUpdate();alert(\"File browsing deleted.\");'>" + defbrowse + "</a><br /><a href='javascript:var allowmanage = \"no\";defmgt = \"\";onDirUpdate();alert(\"File filemgt deleted\");'>" + defmgt + "</a><br /><a href='javascript:var allowstate = \"no\";defstate = \"\";onDirUpdate();alert(\"File statement deleted\");'>" + defstate + "</a><br />User files:<br /><br /><a href='javascript:call[1] = \"empty\";proper[1] = \"\";numfile = 0;onDirUpdate();alert(\"File deleted.\");'>" + call[1] + "</a><br /><a href='javascript:call[2] = \"empty\";proper[2] = \"\";numfile = 1;onDirUpdate();alert(\"File deleted.\");'>" + call[2] + "</a><br /><a href='javascript:call[3] = \"empty\";proper[3] = \"\";numfile = 2;onDirUpdate();alert(\"File deleted\");'>" + call[3] + "</a><br /><a href='javascript:call[4] = \"empty\";proper[4] = \"\";numfile = 3;onDirUpdate();alert(\"File deleted\");'>" + call[4] + "</a><br /><a href='javascript:call[5] = \"empty\";proper[5] = \"\";numfile = 4;onDirUpdate();alert(\"File deleted\");'>" + call[5] + "</a><br /><Br />";
	                    document.getElementById(output).innerHTML = delroot + document.all.output.innerHTML;
	                    window.document.theform.cmd.value = "";
	                }
	            else if ( allowcd == "no" )
	                {
	                    if ( dir == exploits )
	                        {
	                            delexp = "Please select a file below:<br /><br />System files:<br /><a href='javascript:allowshut = \"no\";defshut = \"\";onDirUpdateExpl();alert(\"File shutdown deleted.\");'>" + defshut + "</a><br /><Br />";
	                            document.getElementById(output).innerHTML = delexp + document.all.output.innerHTML;
	                            window.document.theform.cmd.value = "";
	                         }
	                     else if ( dir == "..<br /><br />No files to display" )
	                        {
	                            nohope = "No files to delete.<br /><Br />";
	                            document.getElementById(output).innerHTML = nohope + document.all.output.innerHTML;
	                            window.document.theform.cmd.value = "";
	                        }
	                     else {
	                        document.getElementById(output).innerHTML = "Not yet implemented. <br /><Br /><br />...says the lazy dev team...<Br /><br />" + document.all.output.innerHTML;
	                        window.document.theform.cmd.value = "";
	                        }
	                }
	                window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "del /?" )
	{
	    quickhelp_del = "The 'del' command is used to delete files. With no filename following the del command, a 'GUI' is displayed that can be used to delete any file in the current directory, or user created files.<br /><br />Example syntax: del 'FILENAME' <br /><br />The above example would delete a specific file where 'FILENAME' would be replaced by the name of the file you wish to delete.<br /><Br />Example syntax: del (No args.)<Br /><br />The second example would bring up a simple 'GUI' for deleting files.<br /><br />";
	    document.getElementById(output).innerHTML = quickhelp_del + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	 }
    else if ( window.document.theform.cmd.value.toLowerCase() == "del all" )
	{
	    if ( admins == "no" )
		{
		    notadmin = "Admin's permission required...........<br /><br />";
            document.getElementById(output).innerHTML = notadmin + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( admins == "yes" )
		{
		    defbrowse = "";
		    defmgt = "";
		    defstate = "";
		    defexp = "";
		    defentertain = "";
		    here = "";
		    exploits = "";
		    entertain = "";
		    hidden = "";
		    allowshut = "";
		    allowfun = "";
		    allowcd = "";
		    allowbrowsing = "";
		    allowmanage = "";
		    allowstate = "";
		    allowhide = "";
		    allowbox = "";
		    allowtain = "";
		    delbrowse = "";
		    delmanage = "";
		    delstate = "";
		    delshut = "";
		    delbox = "";
		    deltain = "";
		    dir = "..<br /><br />No files to display";
		    yesadmin = "All files deleted.<br /><br />";
		    document.getElementById(output).innerHTML = yesadmin + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "revive all" )
	{
	    if ( admins == "yes")
		{
		    defbrowse = "yes";
		    defmgt = "yes";
		    defstate = "yes";
		    defexp = "yes";
		    defentertain = "yes";
		    here = "yes";
		    exploits = "yes";
		    entertain = "yes";
		    hidden = "yes";
		    allowshut = "yes";
		    allowfun = "yes";
		    allowcd = "yes";
		    allowbrowsing = "yes";
		    allowmanage = "yes";
		    allowstate = "yes";
		    allowhide = "yes";
		    allowbox = "yes";
		    allowtain = "yes";
		    delbrowse = "yes";
		    delmanage = "yes";
		    delstate = "yes";
		    delshut = "yes";
		    delbox = "yes";
		    deltain = "yes";
		    revived = "All files successfully revived. (All variable values set to 'yes.')<br /><br />";
		    document.getElementById(output).innerHTML = revived + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( admins == "no" )
		{
		    lostrevive = "'revive all' No such command or file name.<br /><br />";
		    document.getElementById(output).innerHTML = lostrevive + document.all.output.innerHTML
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
		    
    else if ( window.document.theform.cmd.value.toLowerCase() == "del browsing" )
	{
	    if ( allowbrowsing == "yes" )
		{
		    if ( delbrowse == "yes" )
			{
			    lostbrowse = "No such file 'browsing'<br /><br />";
			    document.getElementById(output).innerHTML = lostbrowse + document.all.output.innerHTML
			    window.document.theform.cmd.value = "";
			}
		    else if ( delbrowse == "no" )
			{
			    nobrowsenow = "File 'browsing' deleted.<br /><br />";
			    document.getElementById(output).innerHTML = nobrowsenow + document.all.output.innerHTML;
			    allowbrowsing = "no";
			    delbrowse = "yes";
			    defbrowse = "";
			    dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
			    window.document.theform.cmd.value = "";
			}
		}
	    else if ( allowbrowsing == "no" )
		{
		    lostbrowsing = "'browsing' No such command or file name.<br /><Br />";
		    document.getElementById(output).innerHTML = lostbrowsing + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del filemgt" )
	{
	    if ( allowmanage == "yes" )
		{
		    if ( delmanage == "yes" )
			{
			    nofilemgt = "No such file 'filemgt'<br /><br />";
			    document.getElementById(output).innerHTML = nofilemgt + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		    else if ( delmanage == "no" )
			{
			    killfilemgt = "File 'filemgt' deleted.<br /><br />";
			    document.getElementById(output).innerHTML = killfilemgt + document.all.output.innerHTML;
			    allowmanage = "no";
			    delmanage = "yes";
			    defmgt = "";
			    dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
			    window.document.theform.cmd.value = "";
			}
		}
	    else if ( allowmanage == "no" )
		{
		    filemgtnotfound = "No such file 'filemgt'<br /><br />";
		    document.getElementById(output).innerHTML = filemgtnotfound + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del statement" )
	{
	    if ( allowstate == "no" )
		{
		    nostatement = "No such file 'statement'<br /><br />";
		    document.getElementById(output).innerHTML = nostatement + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( allowstate == "yes" )
		{
		    if ( delstate == "yes" )
			{
			    loststate1 = "No such file 'statement'<br /><br />";
			    document.getElementById(output).innerHTML = loststate1 + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		    else if ( delstate == "no" )
			{
			    killstate = "File 'statement' deleted.<br /><Br />";
			    document.getElementById(output).innerHTML = killstate + document.all.output.innerHTML;
			    allowstate = "no";
			    delstate = "yes";
			    defstate = "";
			    dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
			    window.document.theform.cmd.value = "";
			}
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del shutdown" )
	{
	    if ( allowshut == "yes" )
		{
		    if ( delshut == "yes" )
			{
			    lostshut1 = "No such file 'shutdown'<br /><br />";
			    document.getElementById(output).innerHTML = lostshut1 + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		    else if ( delshut == "no" )
			{
			    killshut = "File 'shutdown' deleted.<br /><b/>";
			    document.getElementById(output).innerHTML = killshut + document.all.output.innerHTML;
			    delshut = "yes";
			    allowshut = "no";
			    dir = "..<br /><br />No files to display";
			    exploits = "..<br /><br />No files to display";
			    defexp = "<br />exploits - DIR 0 file(s)";
			    window.document.theform.cmd.value = "";
			}
		}
	    else if ( allowshut == "no" )
		{
		    document.getElementById(output).innerHTML = lostshut1 + document.all.output.innerHTML
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del dosbox" )
	{
	    if ( allowfun == "yes" )
		{
		    if ( delbox == "yes" )
			{
			    lostthebox = "No such file 'dosbox'<br /><Br />";
			    document.getElementById(output).innerHTML = lostthebox + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		    else if ( delbox == "no" )
			{
			    killbox = "File 'dosbox' deleted.<br /><Br />";
			    document.getElementById(output).innerHTML = killbox + document.all.output.innerHTML;
			    delbox = "yes";
			    allowbox = "no";
			    window.document.theform.cmd.value = "";
			    if ( deltain == "yes" )
				{
				    defentertain = "<br />entertainment - DIR 0 file(s)";
				    dir = "..<br /><br />No files to display";
				    entertain = "..<br /><br />No files to display";
				}
			    else if ( deltain == "no" )
				{
				    defentertain = "<br />entertainment - DIR 1 file(s)";
				    entertain = "..<br /><br />entertainment - text/HTML document";
				    dir = entertain;
				}
			}
		}
	    else if ( allowfun == "no" )
		{
		    document.getElementById(output).innerHTML = lostthebox + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del entertain" )
	{
	    if ( allowfun == "yes" )
		{
		    if ( deltain == "no" )
			{
			    killentertain = "File 'entertain' deleted.<br /><br />";
			    document.getElementById(output).innerHTML = killentertain + document.all.output.innerHTML;
			    deltain = "yes";
			    allowtain = "no";
			    window.document.theform.cmd.value = "";
			    if ( delbox == "yes" )
				{
				    defentertain = "<br />entertainment - 0 file(s)";
				    dir = "..<br /><br />No files to display";
				}
			    else if ( delbox == "no" )
				{
				    defentertain = "<br />entertainment - 1 file(s)";
				    entertain = "..<br /><br />dosbox - text/HTML document";
				    dir = entertain;
				}
			}
		    else if ( deltain == "yes" )
			{
			    nomoreentertain = "No such file 'entertainment'<br /><Br />";
			    document.getElementById(output).innerHTML = nomoreentertain + document.all.output.innerHTML;
			    window.document.theform.cmd.value = "";
			}
		}
	    else if ( allowfun == "no" )
		{
		    document.getElementById(output).innerHTML = nomoreentertain + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "del about" )
	{
	    if ( allowhide == "yes" )
		{
		    whereisadmin = "You do not have permission to delete hidden files.<br /><br />";
		    document.getElementById(output).innerHTML = whereisadmin + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( allowhide == "no" )
		{
		    noabout = "No such file 'about'<br /><br />";
		    document.getElementById(output).innerHTML = noabout + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "makelog")
	{
	    if ( admins == "yes" )
		{
		    makelog = "11-18-09<br />Added code to home.html that gave user ability to hit enter without page reloading. IT WORKS!!!<br />Added quick help for all command except 'echo'.<br />When 'del' is entered without any filename following it, it displays all the files in the current directory as links. When you click a link, it deletes a file. Also updated to 3.5 BETA.<br /><Br />11-7-09<br />Started editing the rename function. Will finish later today. Perhaps I'll make it so that no duplicate files can exist. (Hopefully, but this is just an idea for now.)<br /><Br />11-5-09<br />FINALLY wrote code to make C:\\JoyOfDOS\\&gt;\'s location dynamic. Now I just want to figure out how to give the text input focus when the innerHTML of input is changed.<br /><Br />11-4-09<br />Wrote code that updates user-created files in directory (function onSave(text)) and changed View as HTML link code. (it is also now a function.)<br />Just have to finish re-writing dir code.<br /><Br />11-2-09<br />Began adding user-created files to dir, need to add dir to every modification (edit and view links [save/rename])<br /><Br />9-27-09<br />Today this project is five months old! I've been doing a little editing, and added to 'backdoor'<br /><Br />8-05-09<br />Formatted calculator. Decided on a very simple layout.<br /><br />8-04-09<br />Added a calculator command, need to format it to fit in with JoyOfDOS style. Need to add toLowerCase, updated shell for bad input.<br /><br />7-29-09<br />Fixed many bugs that were created this morning in my tired attempt to fix the save file functions. Now, when you delete a file, only that slot will be written to upon creating new files. And some code cleanup, fixed the bug of name = \"\"; (When name=\"\", every time cmd is = to '', the shell displays: 'No such file.' )<br /><br />7-28-09<br />Ability to save up to five files completely working. Trying to enable editing.<br />And I used arrays ^.^<br />Currently, the user has the ability to create five unique files, via edit console, view them via command line, and modify them via view command.<br />Added an archive of old versions via source.<br /><br />7-27-09<br />Attempted to further make multiple file saving work by making the variable 'name' into an array. So far, no luck, but it looks neater...sorta.<br /><br />7-26-09<br />Tried to add the ability to save up to five files, and \"broke\" the save function in the process. Working on it!<br /><br />7-25-09<br />Ability to save files fixed, you can save one file, and delete it. typing the saved file's name will display the text that was entered into the edit box. So far, you can view and delete the file, however, you cannot see the file via directory listing (dir).<br /><br />7-24-09<br />Well, it's been a while, but I've decided to attempt to update the edit command so users can 'save' files (only 1 file so far.) Haven't figured it all out yet, but there is a 'save' link beneath the edit textarea. At this point in time, it does not properly work.<br /><br />5-16-09<br />Development of the so-dubbed \"Crude life engine\" is making progress. http://www.joyofdos.5u.com/life.html Somewhat similar to JoyOfDOS's scripting style. This game is so far, very early in the developmental stages and only has a few rooms so far. It is nowhere near a complete release, however it is playable up until the third room.<br /><br />5-11-09<br />Realize that the need for the \"No such command or file name\" to pop up anyhow. Removed completely, or until further notice. Announce Release Candidate 2.0 *(without finalization.)*<br /><br />5-10-09<br />After admin's nervous breakdown, we managed to explain that our interest had shifted from wrting the shell (until new ideas arose) to exploiting the innerHTML attribute. We added a feature (that when admins = yes) prints the value of every variable used (except articles). I've been amused for days with this random (censor)*stuff*.<br />I've added an admin's tool (del all) to set all variables blank (Except dir which displays \"No files to display\" and entertainment for some reason.) This tool can be used for learning which variables need to be manipulated, helping pinpoint a variable's usage.<br /><br />No update for long time make admin nervous...(5-9-09)<br/><br/>4-30-09<br />Completely fixed the 'del' not being completely dynamic by re-declaring the variable 'dir' every time a user deletes a file. (FINALY!!!!!!!) Added a simple script to 'newjoy.html' (home) to disallow enter from reloading the page. (Apparently it's buggy.)<br /><br />4-29-09<br />Deleting files no longer show up with the 'dir' command if you use 'cd ..' after deleting a file then using the 'dir' command. I've made it so that directorys display properly how many files are inside. However, you do need to use either the 'cd ..' (then) 'dir' command or the 'dir ..' command to view the updated directory. Announced Version 1.5 BETA, although it suffers the same bugs so far.<br /><br />4-28-09<br />Began adding simple psuedo file management allowing for the deletion of the text/HTML documents that are in the directory by default. Going to make 'dir' work so that they do not show up once deleted. 'dir' still for the most part displays deleted files. Not sure what the issue is.<br /><br />4-27-09<br />So far, making the location dynamic has proven to be more difficult than I'd imagined. I attempted to use a seperate function with the same event handler. onKeyup=\"onparse('output')\"; onKeyup=\"onGo('input')\"; <br />Need to stop \"No such command or file name\" bug.<br />I'll write more articles later.<br /><br />Awaiting solutions to bugs before announcing version 1.5 (fixed).<br /><br />";
		    document.getElementById(output).innerHTML = makelog + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		    
		}
	    else if ( admins == "no" )
		{
		    nomake = "'makelog' No such command or filename.<br/ ><Br />";
		    document.getElementById(output).innerHTML = nomake + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value == "makelog /?" )
	{
	    if ( admins == "no" )
	    {
	        document.getElementById(output).innerHTML = nomake + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	    }
	    else if ( admins == "yes" )
	    {
	        quickhelp_makelog = "The 'makelog' command simply displays dates on which certain features were added or fixed beginning from 4-27-09<br /><Br />Example syntax: makelog (No args.)<br /><br />";
	        document.getElementById(output).innerHTML = quickhelp_makelog + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	    }
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == call[1] )
	{
        usrfile1 = "User file: " + call[1] + "<br /><br />" + proper[1] + "<br /><br />"; 
        document.getElementById(output).innerHTML = usrfile1 + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "del " + call[1] )
	{
	    proper[1] = "";
	    window.document.theform.cmd.value = "";
	    document.getElementById(output).innerHTML = "File deleted.<br /><br />" + document.all.output.innerHTML;
	    numfile = "0";
        call[1] = "empty";
        dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
        window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "del " + call[2] )
	{
	    proper[2] = "";
	    window.document.theform.cmd.value = "";
	    document.getElementById(output).innerHTML = "File deleted.<br /><br />" + document.all.output.innerHTML;
	    numfile = "1";
        call[2] = "empty";
        dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
        window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "del " + call[3] )
	{
	    proper[3] = "";
	    window.document.theform.cmd.value = "";
	    document.getElementById(output).innerHTML = "File deleted.<br /><br />" + document.all.output.innerHTML;
	    numfile = "2";
        call[3] = "empty";
        dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
        window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "del " + call[4] )
	{
	    proper[4] = "";
	    window.document.theform.cmd.value = "";
	    document.getElementById(output).innerHTML = "File deleted.<br /><br />" + document.all.output.innerHTML;
	    numfile = "3";
        call[4] = "empty";
        dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
        window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "del " + call[5] )
	{
	    proper[5] = "";
	    window.document.theform.cmd.value = "";
	    document.getElementById(output).innerHTML = "File deleted.<br /><br />" + document.all.output.innerHTML;
	    numfile = "4";
        call[5] = "empty";
        dir = "..<br />" + defbrowse + "" + defmgt + "" + defstate + defexp + "<br />here - DIR 0 file(s)" + defentertain + "<br />" + call[1] + "<br />" + call[2] + "<br />" + call[3] + "<br />" + call[4] + "<br />" + call[5] + "<br /><br /><br />To view a text/HTML document, type the document's name in the field above.";
        window.document.theform.cmd.focus();
        }
    else if ( window.document.theform.cmd.value == call[2] )
	{
	     usrfile2 = "User file: " + call[2] + "<br /><br />" + proper[2] + "<br /><br />";
	     document.getElementById(output).innerHTML = usrfile2 + document.all.output.innerHTML;
         window.document.theform.cmd.value = "";
         window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == call[3] )
	{
	    usrfile3 = "User file: " + call[3] + "<br /><br />" + proper[3] + "<br /><br />";
	    document.getElementById(output).innerHTML = usrfile3 + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == call[4] ) 
	{
        usrfile4 = "User file: " + call[4] + "<br /><br />" + proper[4] + "<br /><br />";
        document.getElementById(output).innerHTML = userfile4 + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == call[5] )
	{
	     usrfile5 = "User file: " + call[5] + "<br /><br />" + proper[5] + "<br /><br />";
	     document.getElementById(output).innerHTML = userfile5 + document.all.output.innerHTML;
	     window.document.theform.cmd.value = "";
	     window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "view " + call[1] )
	{
	    if ( proper[1] == "" )
		{
		    document.getElementById(output).innerHTML = "File is empty. Use edit command to make a new file.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( proper[1] != "" )
		{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + proper[1] + "</textarea><br /><a href=\"javascript:proper[1] = document.all.text.value;alert( call[1] + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:call[1] = prompt('Enter new file name:','');alert('File name changed.');onDirUpdate();\">Rename file</a><br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "view " + call[2] )
	{
	    if ( proper[2] == "" )
		{
		    document.getElementById(output).innerHTML = "File is empty. Use edit command to make a new file.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( proper[2] != "" )
		{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + proper[2] + "</textarea><br /><a href=\"javascript:proper[2] = document.all.text.value;alert( call[2] + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:call[2] = prompt('Enter new file name:','');alert('File name changed.');onDirUpdate();\">Rename file</a><br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";  
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "view " + call[3] ) 
	{
	    if ( proper[3] == "" )
		{
		    document.getElementById(output).innerHTML = "File is empty. Use edit command to make a new file.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( proper[3] != "" )
		{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + proper[3] + "</textarea><br /><a href=\"javascript:proper[3] = document.all.text.value;alert( call[3] + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:call[3] = prompt('Enter new file name:','');alert('File name changed.');onDirChange();\">Rename file</a><br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "view " + call[4] )
	{
	    if ( proper[4] == "" )
		{
		    document.getElementById(output).innerHTML = "File is empty. Use edit command to make a new file.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( proper[4] != "" )
		{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + proper[4] + "</textarea><br /><a href=\"javascript:proper[4] = document.all.text.value;alert( call[4] + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:call[4] = prompt('Enter new file name:','');alert('File name changed.');onDirChange();\">Rename file</a><br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value == "view " + call[5] )
	{
	    if ( proper[5] == "" )
		{
		    document.getElementById(output).innerHTML = "File is empty. Use edit command to make a new file.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
	    else if ( proper[5] != "" )
		{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + proper[5] + "</textarea><br /><a href=\"javascript:proper[5] = document.all.text.value;alert( call[5] + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:call[5] = prompt('Enter new file name:','');alert('File name changed.');onDirChange();\">Rename file</a><br /><br /> " + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}   
		window.document.theform.cmd.focus();
	}
     else if ( window.document.theform.cmd.value == "copy " + call[1] )
	{
	    cp1 = call[1];
	    cp1 = "copy_" + cp1;
	    contents1 = proper[1];
	    document.getElementById(output).innerHTML = "File " + cp1 + " copied." + document.all.output.innerHTML;
	    window.document.theform.cmd.focus();
    }
    else if ( window.document.theform.cmd.value.toLowerCase() == "view browsing" )
	{
		    document.getElementById(output).innerHTML = "<textarea name='text' style='color: grey; background-color: blue; width: 400; height: 375; border: 1px solid black;' >" + browsing + "</textarea><br /><a href=\"javascript:browsing=document.all.text.value;alert( browserename + ' successfully re-written.');\">Save modified</a> | <a href=\"javascript:browserename = prompt('Enter new file name:','');dir = '..<br />' + browsername + defmgt + defstate + defexp + '<br />here - DIR 0 file(s)' + defentertain + '<br /><br /><br />To view a text/HTML document, type the document's name in the field above.';alert('File name changed.' + browserename);\">Rename file</a><br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "view /?" )
    {
        quickhelp_view = "The 'view' command is used to edit user-created files.<br /><br />Example syntax: view 'FILENAME' <br /><br />In the above example, 'FILENAME' should be replaced with the name of the file you wish to view. This will bring up said file in a textarea where you can save the modified version, or rename the file. Please note: File management (Saving, and deleting) is only supported in Mozilla Firefox (v3.0+)<br /><br />";
        document.all.output.innerHTML = quickhelp_view + document.all.output.innerHTML;
        window.document.theform.cmd.value = "";
        window.document.theform.cmd.focus();
    }
   else if ( window.document.theform.cmd.value.toLowerCase() == "archives" )
	{
	    archives = "Since JoyOfDOS is an open source project, I've made archives of the source, unfortunately, I started making archives at version 2.0 Stable. So older less functional versions of the shell have not been preserved to show progress.<br /><br />[Type 'ver' above to find out which version of the shell you're using.]<br /><br /><a href='http://www.joyofdos.5u.com/oldjoy.rar'>Dev-Shell</a><br />I found an old snippet of code that turned out to be <i>the very first</i> version of JoyOfDOS to ever surface<br />Features:<br /><p align='center'>help command, echo command, cls command</p><br /><Br /><a href=\"http://www.joyofdos.5u.com/joy.rar\">Version 2.0 Stable</a><br />Features:<br /><p align=\"center\">Shell moves through four folders<br />Shell has several tutorial files<br />Shell is designed to introduce users to DOS by immitating the DOS environment<br />Users can delete most 'shell' files.<br />Project is open source.</p><br /><br /><a href=\"http://www.joyofdos.5u.com/joy1.rar\">Version 2.5 BETA</a><br ><a href=\"http://www.joyofdos.5u.com/joy1_2.rar\">Version 2.5 BETA w/fixed file management and calculator.</a><br />Features:<br /><p align=\"center\">All features of 2.0 + fixed file saving of user-created files, user can create, rename, edit, delete five user-made files.</p><br /><br /><a href=\"joy3.rar\">Version 3.0 Stable</a><br />Features:<br /><p align='center'>All the features of 2.5 plus some major and minor editing.</p><br /><br />";
	    document.all.output.innerHTML = archives + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "archives /?" )
	{
	    quickhelp_archives = "The 'archives' command displays all downloadable versions of this site. All archives are in *.rar format.<br /><br />Example syntax: archives (No args.)<br /><br />";
	    document.getElementById(output).innerHTML = quickhel_archives + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "calc" )
	{
	    calc = "<input type='text' name='doit' value='' style='color:white;background-color:black;border:1px solid white;margin-left:6%;margin-bottom:2%;text-align:right;'><br /><br /><input type='button' name='one' value='1' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:6%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 1;'/><input type='button' name='two' value='2' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 2;'/><input type='button' name='three' value='3' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 3;'/><input type='button' name='four' value='4' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 4;'/><input type='button' name='five' value='5' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 5;'/><input type='button' name='clear' value='CE' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:left;' onClick='javascript:document.all.doit.value = \"\";'/><br /><input type='button' name='six' value='6' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:6%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 6;'/><input type='button' name='seven' value='7' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 7;'/><input type='button' name='eight' value='8' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 8;'/><input type='button' name='nine' value='9' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript: document.all.doit.value = document.all.doit.value + 9;'/><input type='button' name='zero' value='0' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + 0;'/><input type='button' name='add' value='+' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + \" + \";'/><br /><input type='button' name='sub' value='-' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:6%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + \" - \";'/><input type='button' name='mult' value='*' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + \" * \";'/><input type='button' name='div' value='/' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + \" / \";'/><input type='button' name='dec' value='.' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:document.all.doit.value = document.all.doit.value + \".\";'/><input type='button' name='sqrt' value='&radic;' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:square = Math.sqrt(document.all.doit.value/1);document.all.doit.value = square;'/><input type='button' name='equal' value='=' style='height:20px;width:20px;color:white;background-color:black;border:1px solid white;margin-left:3%;margin-bottom:3%;text-align:center;' onClick='javascript:num = document.all.doit.value.split(\" \");if (num[1] == \"+\") { answer = num[0]/1 + num[2]/1;document.all.doit.value = answer;}else if (num[1] == \"-\") { answer = num[0]/1 - num[2]/1; document.all.doit.value = answer;}else if (num[1] == \"*\"){ answer = num[0]/1 * num[2]/1;document.all.doit.value = answer;}else if (num[1] == \"/\") { answer = num[0]/1 / num[2]/1; document.all.doit.value = answer;}'/><br /><br /><input type='button' name='help' value='Help' style='color:white;background-color:black;border:1px solid white;margin-left:16%' onClick='javascript:alert(\"Sample problem: 5 * 1. There must be a space imbetween the number and operator; 5 * 9, not 5*9. Only one problem at a time can be done.\");'><br /><br />";
	    document.getElementById(output).innerHTML = calc + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "calc /?" )
	{
	    quickhelp_calc = "The 'calc' command brings up a simple calculator.<br /><br />Example syntax: calc (No args.)<br /><br />";
	    document.getElementById(output).innerHTML = quickhelp_calc + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "quit" )
	{
	    location.href = "http://www.google.com/";
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "quit /?" )
	{
	    quickhelp_quit = "The 'quit' command re-directs your browser to http://www.google.com/<br /><br />Example syntax: quit (No args.)<br /><br />";
	    document.getElementById(output).innerHTML = quickhelp_quit + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "activate admin" )
	{
	    
	    adminon = "Hello, sir.<br /><br />Currently pending 0 fixes. :) <br /><br />Pending 0 solutions. :)<br /><br />Currently, the dev team is working on 1 side project. The \"Crude life engine\", so far, there are four rooms and one boss with three different enemies and two different weapons. http://www.joyofdos.5u.com/life.html (Needs update from dev team.) <font color=\"red\"><br />(Project is dead.)</font><Br /><br />Type makelog for a list of progresses.<br /><br />Goodbye, sir.<br/ ><Br />";
	    document.getElementById(output).innerHTML = adminon + document.all.output.innerHTML;
	    admins = "yes";
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	}
    else if ( window.document.theform.cmd.value.toLowerCase() == "printvars" )
	{
	    if ( admins == "yes" ) 
		{
		    document.getElementById(output).innerHTML = "defbrowse = " + defbrowse + "<br />defmgt = " + defmgt + "<br />defstate = " + defstate + "<br />defexp = " + defexp + "<br />defentertain = " + defentertain + "<br />here = " + here + "<br />exploits = " + exploits + "<br />entertain = " + entertain + "<br />hidden = " + hidden + "<br />allowshut = " + allowshut + "<br />allowfun = " + allowfun + "<br />allowcd = " + allowcd + "<br />allowbrowsing = " + allowbrowsing + "<br />allowmanage = " + allowmanage + "<br />allowstate = " + allowstate + "<br />allowhide = " + allowhide + "<br />allowbox = " + allowbox + "<br />allowtain = " + allowtain + "<br />delbrowse = " + delbrowse + "<br />delmanage = " + delmanage + "<br />delstate = " + delstate + "<br />delshut = " + delshut + "<br />delbox = " + delbox + "<br />deltain = " + deltain + "<br />dir =" + dir + "<br />call[1] = " + call[1] + "<br />call[2] = " + call[2] + "<br />call[3] = " + call[3] + "<br />call[4] = " + call[4] + "<br />call[5] = " + call[5] + "<br />admins = yes<br /><br />End of list.<br /><br />" + document.all.output.innerHTML;
		    window.document.theform.cmd.value = "";
		}
		window.document.theform.cmd.focus();
	}
	else if ( window.document.theform.cmd.value.toLowerCase() == "test" )
	    {
	        browsers = "This site was written for Mozilla Firefox (V3.0+), however, if you are using a different browser, please check for compatibility below.<br />Browsers in green are completely compatible.<br /><br /><font color='green'>Mozilla Firefox 3.0+<br />Opera 9.0+</font><br /><br />Browsers in yellow are partially compatible.<br /><br /><font color='yellow'>Google chrome</font><br /><br />Browswers in red are not supported.<br /><br /><font color='red'>Internet explorer (ALL VERSIONS)<br />Netscape</font><br /><br />";
	        document.getElementById(output).innerHTML = browsers + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();

	    }
	else if ( window.document.theform.cmd.value.toLowerCase() == "test /?" )
	    {
	        quickhelp_test = "Displays a list of compatible browsers. List is color-coded for simplicity.<br /><br />Example syntax: test (No args.)<br /><br />";
	        document.getElementById(output).innerHTML = quickhelp_test + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "";
	        window.document.theform.cmd.focus();
	    }
	else if ( window.document.theform.cmd.value.toLowerCase() == "why?" )
	    {
	        document.getElementById(output).innerHTML = "Why not?<br /><br />" + document.all.output.innerHTML;
	        window.document.theform.cmd.value = "I don't know";
	        window.document.theform.cmd.focus();
	    }
	else if ( window.document.theform.cmd.value == "" )
	    {
	        return false;
	        window.document.theform.cmd.focus();
	    }
	else if ( window.document.theform.cmd.value == " " )
	    {
	        return false;
	        window.document.theform.cmd.focus();
	    }
	else {
	    command = window.document.theform.cmd.value.split(" ");
	    document.getElementById(output).innerHTML = "'" + command[0] + "' No such command or file name.<br /><br />" + document.all.output.innerHTML;
	    window.document.theform.cmd.value = "";
	    window.document.theform.cmd.focus();
	    }
}

//joy.js by RabbidGeorge
//bugfixes always in progress
//Version 3.5 BETA
//n00bz0r web programming 2009
//Written for Mozilla Firefox
//Compatible with Opera.
