function isNumeric(str)
// returns true if str is numeric
// that is it contains only the digits 0-9
// returns false otherwise
// returns false if empty
{
  var len= str.length;
  if (len==0)
    return false;
  var p=0;
  var ok= true;
  var ch= "";
  while (ok && p<len)
  {
    ch= str.charAt(p);
    if ('0'<=ch && ch<='9')
      p++;
    else
      ok= false;
  }
  return ok;
}




function isAlphNumPlus(str, plus)
// returns true if str is alphabetic with addition of characters in plus
// that is only A-Z a-z or space or any of the characters in the string plus
// returns false otherwise
// returns false if empty
{
  var len= str.length;
  if (len==0)
    return false;

  var p=0;
  var ok= true;
  var ch= "";
  while (ok && p<len)
  {
    ch= str.charAt(p);
    if (  ('A'<=ch && ch<='Z')
        ||('a'<=ch && ch<='z')
        ||('0'<=ch && ch<='9')
//        ||(ch==" ")
        ||(plus.indexOf(ch,0)>-1)
       )
      p++;
    else
      ok= false;
  }
  return ok;
}



// Function to ensure a text area field is filled out.
function TextAreaRequired(formid,Field) {

//  var length = document.getElementById(Field).value.length;
//  var length = document.forms['ExtendP'].Comments.value;
  var length = eval("document.forms['" + formid + "']." + Field + ".value.length");
  if (length == 0) {
    return false;
  } else {
    return true;
  }
}
