function zobrazInfo(){
	GetTag('info').style.display="block";
	GetTag('pocet').style.display="block";
	GetTag('area').style.margin="0em 0em .3em .3em";
	GetTag('enter').disabled = "disabled";
}
function pocet(Id, Max){
	
    area = GetTag('txtVzkaz'+Id);
    //alert('txtVzkaz'+Id);
    //alert(Max);
	alength = area.value.length;
	if(alength > 100){
		area.value = area.value.substr(0,Max);
		GetTag('pocetZnaku'+Id).innerHTML="max";
		GetTag('pocetZnaku'+Id).style.color="red";
	} else {
		GetTag('pocetZnaku'+Id).innerHTML=alength;
		GetTag('pocetZnaku'+Id).style.color="black";
	}
	if(alength >= 1) {
		GetTag('enter').disabled = "";
	} else {
		GetTag('enter').disabled = "disabled";
	}
	
}
function overPrazdnePole( Pole, Zprava ) {
if( Pole.value =="" ) {
        if(GetTag) {
		Upozorneni(Pole,Zprava,"");
        } else {
            	alert(Zprava);
        }
        return false;
    } else {
        return true;
    }
}
function Upozorneni(Pole,Hlaska,puvodniHodnota){
	Pole.style.color="red";
	Pole.value=Hlaska;
	setTimeout("SkryjUpozorneni('"+Pole.name+"','"+puvodniHodnota+"')",1000);
}
function SkryjUpozorneni(Pole,puvodniHodnota){
	GetTag(Pole).style.color="black";
	GetTag(Pole).style.textalign="left";
	GetTag(Pole).value=puvodniHodnota;
	GetTag(Pole).focus();
}

function overeniFormulare(){
  if(!overPrazdnePole(GetTag('toj'),"Nutno zadat jméno")) return false;
	if(!overEmail(GetTag('toe')))return false;
	if(!overPrazdnePole(GetTag('tpj'),"Nutno zadat jméno")) return false;
	if(!overEmail(GetTag('tpe')))return false;
	return true;
}
function overEmailovouAdresu(adresa)
{
  var filtr = /^([_a-z0-9+\-][_a-z0-9\.%+\-]*@((?:[a-z0-9\-]+\.)+(?:[a-z]{2,4}|museum)))+$/;
  var vysledek = filtr.test(adresa);
  return (vysledek);
}
function overEmail(txtEmail)
{
  if (txtEmail.value == ""  || txtEmail.value == "zde@existujici.email")
  {
    Upozorneni(txtEmail,"Nutno vyplnit adresu",txtEmail.value);  
    txtEmail.focus();
    return (false);
  }
  if (txtEmail.value.length > 40)
  {
    Upozorneni(txtEmail,"Přílią dlouhá adresa",txtEmail.value);
    txtEmail.focus();
    return (false);
  }
  if (!overEmailovouAdresu(txtEmail.value))
  {
    Upozorneni(txtEmail,"Není platná adresa",txtEmail.value);
    txtEmail.focus();
    return (false);
  }
  return (true);
}
