function validate(formular)
{
	
	if (formular.email.value=="")
    {
        alert("E-mail nebyl zadán!");
        formular.email.focus();
        return false;
    }
	else if (window.RegExp)
    {
        re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
        if (!re.test(formular.email.value))
        {
            alert("Zadaný e-mail je ve špatném tvaru!");
            formular.email.focus();
            return false;
        }
    }
    else 
        return true;
}

function neprazdneHledani(formular, polozka){
	if(polozka=="hledanoNaFotce"){
  

      if (formular.hledanoNaFotce.value=="" || formular.hledanoNaFotce.value=="Klíčové slovo"){
                alert("Nezadali jste, koho či co chcete hledat!");
                formular.hledanoNaFotce.focus();
                return false;
            }else{
                return true;    
            }   
  
  }else{

    	if (formular.clen.value=="" || formular.clen.value=="Slovo či číslo"){
            alert("Nezadali jste, co chcete hledat!");
            formular.clen.focus();
            return false;
        }else{
            return true;    
        }   
  
  }
	

}

function kontrolaKomentare(formular){
	
	if (formular.jmeno.value=="" || formular.jmeno.value=="Jméno *" || formular.jmeno.value==" "){
        alert("Zadejte, prosím, vaše jméno");
        formular.jmeno.focus();
        return false;
 }else{
      if (formular.nadpis.value=="" || formular.nadpis.value=="Nadpis *" || formular.nadpis.value==" "){
        alert("Zadejte, prosím, nadpis komentáře");
        formular.nadpis.focus();
        return false;
      }else{
           if (formular.komentar.value=="" || formular.komentar.value=="Váš komentář *" || formular.komentar.value==" "){
        alert("Zadejte, prosím, text vašeho komentáře");
        formular.komentar.focus();
        return false;
           }else 
                return true;
        
           }  
      }
}

function helpOkno() {
window.open("","okno","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=300,height=580,resizable=1,left=15,top=20");
}

function odskrtni(id){
    if (document.getElementById) document.getElementById(id).checked = false;
}

function zaskrtni(id){
    if (document.getElementById) document.getElementById(id).checked = true;
}

function zasedit(id){
    if (document.getElementById) document.getElementById(id).disabled = true;
}

function odsedit(id){
    if (document.getElementById) document.getElementById(id).disabled = false;
}

function zobrazit_inline(id) {
  document.getElementById(id).className='visible_inline';
}
function zobrazit_block(id) {
  document.getElementById(id).className='visible_block';
}
function skryt(id) {
  document.getElementById(id).className='none';
}

function kontrolaFormAktivity(formular){
	
	if (formular.nazev.value=="" || formular.nazev.value==" "){
        alert("Zadejte, prosím, název aktivity");
        formular.nazev.focus();
        return false;
 }else{
      if (formular.popis.value=="" || formular.popis.value==" "){
        alert("Zadejte, prosím, popis aktivity");
        formular.popis.focus();
        return false;
      }else{
           if (formular.vlozil.value=="" || formular.vlozil.value==" "){
        alert("Zadejte, prosím, Vaše jméno");
        formular.vlozil.focus();
        return false;
           }else 
                return true;
        
           }  
      }
}
