// <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">

charset="windows-1250"

function JmenoOK(txt)
{ // shodna funkce je i v PHP
  if (txt.length==0) return 'Není zadáno jméno stránky!    \n';
  if (txt.length>20) return 'Maximální délka jména je 20 znaků!    \n';
  for(var i=0;i<txt.length;i++) if (nam_tab.indexOf(txt.charAt(i))<0) return 'Jméno obsahuje nepovolené znaky!    \n';
  return "";
}

function HesloOK(dlg,heA,heB)
{ // shodna funkce je i v PHP
  if (dlg=='N')
  { // zakládání nebo editace
    if (heA!=heB) return 'Nesouhlasí kontrola hesla!    \n';
    if (heA.length==0) return 'Není zadáno heslo!    \n'; 
    if (heA.length<5) return 'Minimální délka hesla je 5 znaků!    \n';
  }
  if (heA.length>20) return 'Maximální délka hesla je 20 znaků!';
  for(var i=0;i<heA.length;i++) if (hes_tab.indexOf(heA.charAt(i))<0) return 'Heslo obsahuje nepovolené znaky!    \n';
  return "";
}

function KodHasOK(txt)
{ // jen počet znaků, v PHP se navíc i porovnává
  if (txt.length!=4) return 'Chybný kontrolní kód!    \n';
  return "";
}

function EmailOK(txt)
{
  ret='';
  if (txt!='')
  {
    txt=txt.toLowerCase();
    re=/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-z]{2,}){1}$/;
    if (txt.search(re)!=0) { ret='Chybná e-mailová adresa!    \n'; }
  }
  return ret;
}

function act(bmp,p)
{
  if (p==0) { bmp.style.background="#848484"; }
  if (p==1) { bmp.style.background="#0466CC"; }
}

function aca(bmp,p)
{
  if (p==0) { bmp.style.background=""; }
  if (p==1) { bmp.style.background="#0466CC"; }
}

function ace(bmp,p)
{
  if (p==0) { bmp.style.background="#E4E6E4"; }
  if (p==1) { bmp.style.background="#B7DBFF"; }
}

function acc(bmp,p)
{
  if (p==0) { bmp.style.background=""; }
  if (p==1) { bmp.style.background="#C7EBFF"; }
}

