﻿ function validate_lookup(theForm){
  
  if (theForm.idx.value == ""){
   alert("Please check the tracking number.");
   theForm.idx.focus();
   return (false);
   }

  var checkOK = "0123456789";
  var checkStr = theForm.idx.value;
  var allValid = 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
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please check the tracking number.");
    theForm.idx.focus();
    return (false);
  }
  
  
  if (theForm.cid.value == ""){
   alert("Please check the account number.");
   theForm.cid.focus();
   return (false);
   }

  var checkOK = "0123456789";
  var checkStr = theForm.cid.value;
  var allValid = 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
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please check the account number.");
    theForm.cid.focus();
    return (false);
  }
  

  return (true);
}



 function validate_anonymous(theForm){
  
  if (theForm.feedback.value == ""){
   alert("Please enter some feedback.");
   theForm.idx.focus();
   return (false);
   }  

  return (true);
}



