<!--
function ConfirmAction(oper)
    {
     if (oper == "post")
      {
			if (LoginValidation(document.forms[0]))
				{
				document.forms[0].submit();
				}
      }
   }
    
function detectBrowser(){
	var agt=navigator.userAgent.toLowerCase();
	
  if (agt.indexOf("opera") != -1)
  {
	alert(' Inventory Pro Online does not the support Opera Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
	return (false);
	}
 if (agt.indexOf("staroffice") != -1)
 {
 alert(' Inventory Pro Online does not the support Star Office Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
 return (false);
 }
 if (agt.indexOf("webtv") != -1) 
{
 alert(' Inventory Pro Online does not the support WebTV Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}

if (agt.indexOf("beonex") != -1) 
{
alert(' Inventory Pro Online does not the support Beonex Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}

if (agt.indexOf("chimera") != -1) 
{
alert(' Inventory Pro Online does not the support Chimera Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}
if (agt.indexOf("netpositive") != -1) 
{
 alert(' Inventory Pro Online does not support the Net Positive Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
 return (false);
 }
 
if (agt.indexOf("phoenix") != -1) 
{ 
alert(' Inventory Pro Online does not support the Pheonix Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}
//if (agt.indexOf("safari") != -1) 
//{ alert(' Inventory Pro Online does not support the Safari Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
//return (false);
//}
if (agt.indexOf("skipstone") != -1) 
{
 alert(' Inventory Pro Online does not support the SkipStone Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
 return (false);
 }
 if (agt.indexOf("netscape") != -1) 
{
 alert(' Inventory Pro Online does not support the Netscape Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}

if (agt.indexOf("aol") != -1) 
{ 
alert(' Inventory Pro Online does not support the AOL Web Browser.\n Some Capabilities may not work properly.\n Please use Internet Explorer version 6.0+ or Firefox 2.0+');
return (false);
}

return (true);
}

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 (detectBrowser())
{
  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);
  }
   return (true);
}
return (false);
}
//-->
