<!--
//**********************************************************************************
// "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 OrgVal = theForm.Organization.value;
  if (OrgVal == "")
  {
    alert("Please enter a value for the \"Organization\" field.");
    theForm.Organization.focus();
    return (false);
  }
  
  var errFlag = checkInvalidChars(OrgVal);
  if (errFlag.length > 0)
  {
    alert("The \"Organization\" field contains an invalid character: apostrophes are not allowed.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.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);
}


//-->