<!--
//**********************************************************************************
// "Internal" function to remove all spaces ensures user input values correctly
//**********************************************************************************
function removeSpaces(s) {
 var tempVal=""
 for(var i=0;i<s.length;++i) {
  var c=s.charAt(i)
  if(c!=" ") tempVal += c
 }
 return tempVal
}

//**********************************************************************************
// "Internal" function to help ensure user input processed correctly
//**********************************************************************************
function checkInvalidChars(s) {
  var errFlag=""
  var firstChar=s.charAt(0);
  for(var i=0;i<s.length;++i) {
	var thisChar=s.charAt(i);
	// check if it contains an invalid character
	if (thisChar=="'") errFlag += thisChar;
	if (thisChar==" ") errFlag += thisChar;
	if((thisChar=="'") || (thisChar==" ")){
	  errFlag += thisChar
	}
  }
  return errFlag;
}

function FrontPage_Form1_Validator(theForm)
{
  var AdminId = removeSpaces(theForm.username.value);
  theForm.username.value = AdminId;
  if (AdminId == "")
  {
    alert("Please enter a value for the \"Admin ID\" field.");
    theForm.username.focus();
    return (false);
  }
 var errFlag = checkInvalidChars(AdminId);
  if (errFlag.length > 0)
  {
    alert("The \"Admin ID\" field contains an invalid character, spaces and apostrophes are not allowed.");
    theForm.username.focus();
    return (false);
  }

  var thisPassword = removeSpaces(theForm.password.value);
  theForm.password.value = thisPassword;
  if (thisPassword == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  errFlag = checkInvalidChars(thisPassword);
  if (errFlag.length > 0)
  {
    alert("The \"Password\" field contains an invalid character, spaces and apostrophes are not allowed.");
    theForm.password.focus();
    return (false);
  }

  return (true);
}


//-->