function Validate(theForm) {
  var arr_length=required.length;
  for(var i=0; i<theForm.length; i++ ) {
    with(theForm.elements[i]) {
      for(var j=0; j<arr_length; j++ ) {
        if( required[j]==name ) {
          if( value.length==0) {
             focus();
             return false;
          }
        }
      }
    }
  }
  return true;
}

function check_form(theForm)
{
  if (! Validate(theForm)) {
    alert('Vyplntě všechny potřebné údaje!');
    return false;
  }
  theForm.submit();  
}

