function checko (o,t,nm) {
  sn=o.value.length;
  if (t==1) {
    if (sn==0) {
      alert ('Please fill in all required fields!'+' ('+nm+')');
      return false;
    } else {
      return true;
    }
  } else if (t==2) {
    ok=0;
    for (i=0;i<sn;++i) {
      c=o.value.substr(i,1);
      if (ok==0) {
        if ((c=='@') && (i>=1)) { ok=1; }
      } else if (ok==1) {
        if ((c=='.') && (i>=3)) { ok=2; }
      }
    }
    if (ok==2 && sn>=6) {
      return true;
    } else {
      alert('Invalid e-mail address!'+' ('+nm+')');
      return false;
    }
  } else if (t==3) {
    ok=1;
    for (i=0;i<sn;++i) {
      c=o.value.substr(i,1);
      if (!(c>='0' && c<='9') && (c != '.')) { ok=0; break; }
    }
    if (ok) {
      return true;
    } else {
      alert('Invalid number!'+' ('+nm+')');
      return false;
    }
  }
}
