<!--
function ConfirmAction(oper)
    {
     if (oper == "post")
      {
       if (LoginValidation(document.forms[0]))
          {
          document.forms[0].submit();
          }
      }
    }

function DrawLoginForm(companyNeeded, companyName, userName, fieldSize, color)
{
  document.write('<form action="LoginValidation.asp?c=%2Fipol%5Fdev%2Flogin%2Easp"' +
                 ' method="POST" onsubmit="return LoginValidation(this)" name="LoginForm">\n');
  document.write('<font color="' + color + '" class="Small"><center>\n');
  document.write('<input type="hidden" name="sC" value="G">\n');

  if (companyNeeded)
  {
    document.write('Company:<br>');
    document.write('<input type="text" name="Company" size="' + fieldSize);
    document.write('" maxlength="20" value="' + companyName + '"><br>\n');
  }
  else
    document.write('<input type="hidden" name="Company" value="' + companyName + '">');

  document.write('Name:<br>');
  document.write('<input type="text" name="UserName" size="' + fieldSize);
  document.write('" maxlength="255" value="' + userName + '"><br>\n');
  document.write('Password:<br>');
  document.write('<input type="password" name="UserPassword" size="' + fieldSize);
  document.write('" maxlength="20"><br><br>\n');
  document.write('<input type="submit" value="Login">\n');
  document.write('</center></font>\n');
  document.write('</form>\n');
}

function LoginValidation(theForm)
{
  var iPos, i;

  if (theForm.Company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }
  if (theForm.Company.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }
  if (theForm.Company.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }
  if (theForm.UserName.value == "")
  {
    alert("Please enter a value for the \"UserName\" field.");
    theForm.UserName.focus();
    return (false);
  }
  if (theForm.UserName.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"UserName\" field.");
    theForm.UserName.focus();
    return (false);
  }
  if (theForm.UserName.value.length > 255)
  {
    alert("Please enter at most 255 characters in the \"UserName\" field.");
    theForm.UserName.focus();
    return (false);
  }
  if (theForm.UserPassword.value == "")
  {
    alert("Please enter a value for the \"UserPassword\" field.");
    theForm.UserPassword.focus();
    return (false);
  }
  if (theForm.UserPassword.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"UserPassword\" field.");
    theForm.UserPassword.focus();
    return (false);
  }

  if (theForm.UserPassword.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"UserPassword\" field.");
    theForm.UserPassword.focus();
    return (false);
  }

  if (theForm.Company.value.toUpperCase() == 'OTS')
  {
    iPos = theForm.action.search('.asp');
    if (iPos > 0)
    {
      for (i = iPos; i >= 0; i--)
        if (theForm.action.substr(i, 1) == '\/')
        {
          i++;
          break;
        }
      theForm.action = 'http://www.otsglm.net/' + theForm.action.substr(i);
    }
  }

  return (true);
}
//-->
