function checkformadd() {
var retval;
var msg;
msg = "Nektere z polozek nebyly spravne vyplneny!\n\n";
retval = true;

// kontrola yadani poctu hracu - pri chybe vypise do daneho pole "?" a nastavi na nej fokus
if ( document.g_reg_add_form.p1.value == "" || !(/[0-9]/.test(document.g_reg_add_form.p1.value))) {
  document.g_reg_add_form.p1.value = "?";
  document.g_reg_add_form.p1.focus();
  msg += "[ Pocet hracu ]\t\t-pouze cislice (nebo \"0\").\n";
  retval = false;
}

// kontrola yadani poctu hracu - pri chybe vypise do daneho pole "?" a nastavi na nej fokus
if ( document.g_reg_add_form.p2.value == "" || !(/[0-9]/.test(document.g_reg_add_form.p2.value))) {
  document.g_reg_add_form.p2.value = "?";
  document.g_reg_add_form.p2.focus();
  msg += "[ Pocet hracu ]\t\t-pouze cislice (nebo \"0\").\n";
  retval = false;
}

if (document.g_reg_add_form.name.value == "" || document.g_reg_add_form.name.value == "?") {
  document.g_reg_add_form.name.value = "?";
  document.g_reg_add_form.name.focus();
  msg += "[ Jmeno ]\t\t\t-nevyplneno\n";
  retval = false;
}
if (document.g_reg_add_form.surename.value == "" || document.g_reg_add_form.surename.value == "?") {
  document.g_reg_add_form.surename.value = "?";
  document.g_reg_add_form.surename.focus();
  msg += "[ Prijmeni ]\t\t-nevyplneno\n";
  retval = false;
}
var x = document.g_reg_add_form.phone.value;
if ( x == "" || /\D/.test(x) || x.length != 9) {
  document.g_reg_add_form.phone.value = "?";
  document.g_reg_add_form.phone.focus();
  msg += "[ Telefon ]\t\t-pouze cislice-BEZ MEZER (xxxyyyzzz)!.\n";
  retval = false;
}

// code string
var x = document.g_reg_add_form.codestring.value;
if ( x == "" || /\D/.test(x) || x.length != 5) {
  document.g_reg_add_form.codestring.value = "?";
  document.g_reg_add_form.codestring.focus();
  msg += "[ Kontrolni kod ]\t\t-Opiste kontrolni kod.\n";
  retval = false;
}

if ( !(retval) ) { window.alert(msg); }
return retval;
}
