function validate(theForm)
{
if (theForm.Amount.value == "")
  {
    alert("Please enter the amount payable.");
    theForm.Amount.focus();
    return (false);
  }
 var checkOK = "1234567890";
  var checkStr = theForm.Amount.value;
  var allValid = true;
  var validGroups = true;
  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 (!allValid)
  {
    alert("Please enter only digits into the amount payable field\n\nEg. 1500\n\nNOT 1500.00 or R1500");
    theForm.Amount.focus();
    return (false);
  }
if (theForm.Ecom_BillTo_Postal_Name_First.value == "")
  {
    alert("Please enter your first name.");
    theForm.Ecom_BillTo_Postal_Name_First.focus();
    return (false);
  }
if (theForm.Ecom_BillTo_Postal_Name_Last.value == "")
  {
    alert("Please enter your last name.");
    theForm.Ecom_BillTo_Postal_Name_Last.focus();
    return (false);
  }
if (theForm.Ecom_BillTo_Online_Email.value == "")
  {
    alert("Please enter your Email address.");
    theForm.Ecom_BillTo_Online_Email.focus();
    return (false);
  }
  if (theForm.Ecom_BillTo_Online_Email.value.length < 6)
  {
    alert("The email address you entered is invalid");
    theForm.Ecom_BillTo_Online_Email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@_-.";
  var checkStr = theForm.Ecom_BillTo_Online_Email.value;
  var allValid = true;
  var validGroups = true;
  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 (!allValid)
  {
    alert("Please enter only letter, digit and \"@_-.\" characters in the Email field.");
    theForm.Ecom_BillTo_Online_Email.focus();
    return (false);
  }
  
  
  
  
if (theForm.Ecom_Payment_Card_Number.value == "")
  {
    alert("Please enter your credit card number.");
    theForm.Ecom_Payment_Card_Number.focus();
    return (false);
  }
 var checkOK = "1234567890";
  var checkStr = theForm.Ecom_Payment_Card_Number.value;
  var allValid = true;
  var validGroups = true;
  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 (!allValid)
  {
    alert("Please enter only digits into the credit card field.\n\nEg. 111111111111111\n\nNOT 1111 1111 1111 111 or 1111-1111-1111-1111");
    theForm.Ecom_Payment_Card_Number.focus();
    return (false);
  }
  
  if (theForm.Ecom_Payment_Card_Verification.value == "")
  {
    alert("Please enter your CVV/CVC2 number.");
    theForm.Ecom_Payment_Card_Verification.focus();
    return (false);
  }
  if (theForm.Ecom_Payment_Card_Verification.value.length >3)
  {
    alert("Please enter at most 3 digits into the  CVV/CVC2 field");
    theForm.Ecom_Payment_Card_Verification.focus();
    return (false);
  }
  
if (theForm.Ecom_Payment_Card_ExpDate_Month.selectedIndex <1)
  {
    alert("Please enter your credit cards expiry month.");
    theForm.Ecom_Payment_Card_ExpDate_Month.focus();
    return (false);
  }
 if (theForm.Ecom_Payment_Card_ExpDate_Year.selectedIndex <1)
  {
    alert("Please enter your credit cards expiry year.");
    theForm.Ecom_Payment_Card_ExpDate_Year.focus();
    return (false);
  }
  return (true);
}

