
function FrontPage_Form1_Validator(theForm)
{
var checkOK = "0123456789,:. ";
  var checkStr = theForm.txtvalue.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == " " && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != " ")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the cost / budget field.");
    theForm.txtvalue.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid figure in the cost / budget field.");
    theForm.txtvalue.focus();
    return (false);
  }
  
 
 var checkOK = "0123456789";
  var checkStr = theForm.txtcarid.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == " " && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != " ")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the Item Number field.");
    theForm.txtcarid.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid figure in the Item Number field.");
    theForm.txtcarid.focus();
    return (false);
  }

}