function Validate(theForm) {
  for(var i=0; i<theForm.length; i++ ) {
    with(theForm.elements[i]) { 
      if( type=="text" ) {
        if( value.length==0) {
          focus();
          return false; 
        }
      }
    }
  }
  return true;
}

function zkontroluj_forum(theForm)
{
  if (!Validate(theForm)) {
    alert('Vyplňte prosím potřebné údaje!');
    return false;
  }
  if (theForm.jmeno.value.toLowerCase()==$admin_nick){
    alert('Nejste oprávněn(a) použít tento nick!');
    return false;
  }
  return true;
}

function zkontroluj_email(adresa)
{
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;
  return adresa.search(re) == 0;
}


function zkontroluj_formular(theForm)
{
  if (!Validate(theForm)) {
    alert('Vyplňte prosím potřebné údaje!');
    return false;
  }
  if (!zkontroluj_email(theForm.email.value))
  {
    alert("E-mail adresa není zadána správně!");
    return false;
  }
  return true;  
}

