function text_to_mapa(txt1,txt2){
        document.getElementById('text_mapa').innerHTML=txt1;
        //document.all['tl_mapa'].innerHTML=txt2;
}
function text_to_oval_vnitrni(txt){
        document.getElementById('oval_vnitrni').innerHTML=txt;
        //document.all['tl_mapa'].innerHTML=txt2;
}
function popup(w,h)
{
 okno1=window.open("","Okno1",'toolbar=0, statusbar=1, location=0, scrollbars=0,width='+w+',height='+h+',resizable=1,top=20,left=20');
 okno1.resizeTo(w,h);
 okno1.focus();
}


function focusset(k,o,m)
{
if (k != "nic")
 {
 document.forms[0].id_okres.focus();
 }
if (o != "nic")
 {
 document.forms[0].id_mesto.focus();
 }
if (m != "nic")
 {
 document.forms[0].email.focus();
 }

}

// -------------- validace -------------
function validuj_login()
{
 if (document.forms[0].user.value == "")
 {
 alert("Vyplňte prosím přihlašovací jméno!");
 document.forms[0].user.focus();
 return false;
 }
 else if (document.forms[0].pass.value == "")
 {
 alert("Vyplňte prosím heslo!");
 document.forms[0].pass.focus();
 return false;
 }
 return true;
}

function validuj_reg(a)
{
 pom = 1;
 for (var x=0; x<=a; x++)
  {
   if (document.forms[1].elements[x].id == "*")
    {
     if (document.forms[1].elements[x].value == "")
      {
       alert("Vyplňte prosím povinné položky označené (*)!");
       document.forms[1].elements[x].focus();
       pom = 0;
      }
     if (document.forms[1].elements[x].value == "nic")
      {
       alert("Vyplňte prosím povinné položky označené (*)!");
       document.forms[1].elements[x].focus();
       pom = 0;
      }
    }
   if (pom==0) { break; }
  }
 if (pom==0) { return false; } else { return true; }
}


function recount_descr(x,t,maxlength) {
  myval = 0+ x.value.length;
  document.getElementById(t).innerHTML = myval;
  if (myval > maxlength ) {
      x.value= x.value.substring(0,maxlength);
      document.getElementById(t).innerHTML = maxlength;
  }
}
