ie=false;
nn=false;
if(document.all) ie = true;
if(document.layers) nn = true;

function anonymousAccess()
{
	if(document.logon.ftp_user.value == 'anonymous')
	{
	  document.logon.ftp_user.value = '';
	  document.logon.ftp_user.focus();
	} else {
	  document.logon.ftp_user.value = 'anonymous';
	  document.logon.ftp_password.focus();
	}
};

function submitForm(action, file, file2)
{
  document.actionform.action.value = action;
  document.actionform.file.value = file;
  document.actionform.file2.value = file2;
  document.actionform.submit();
};

function changeMode(mode)
{
  document.actionform.mode.value = mode;
  document.putForm.mode.value = mode;
  mode==1?document.currentMode.showmode.value = "FTP_BINARY":document.currentMode.showmode.value = "FTP_ASCII";
};

function directDownload(size,msg){
	url = window.prompt(msg+" (Máximo "+size+" Kb)","http://");
	if (url && url.length>7)
	{
        	submitForm("direct_download",url);
	}
}

function goDir(msg)
{
  dirName = window.prompt(msg,"");
  if(dirName)
    {
	submitForm("cd",dirName);
    }
};

function createDir(msg)
{
  dirName = window.prompt(msg,"");
  if(dirName){
	submitForm("createdir", dirName);
  }
};

function renameFile(oldName,msg)
{
  newName = window.prompt(msg+" "+oldName,""+oldName);
  if(newName)
    {submitForm("rename", oldName, newName);}
};

function Confirmation(URL,msg)
{
  if (confirm(msg)){
      location = URL;
  }

};

function ConfirmationUnzip(URL,msg)
{
  if (confirm(msg)){
      location = String(URL);
  }
};

function changePassive()
{
        if(document.logon.passivenet.value == '0')
        {
          document.logon.passivenet.value = '1';
        } else {
          document.logon.passivenet.value = '0';
        }
};

