function kontrola(formular) {

  if (formular.message.value=="") {
    alert("Musíte vyplnit vzkaz!");
    formular.message.focus();
    return false;
  }
  else if (formular.odesilatel.value!="")
  {
	  if (window.RegExp) {
    re = new RegExp("^[^@]+@[^.]+\..+$");
    if (!re.test(formular.odesilatel.value)) {
      alert("Zadaná adresa není správnou adresou elektronické pošty!");
      formular.odesilatel.focus();
      return false;
    }
  }
  }

  else {
    return true;
  }
}

function openWindow() {
    newwin=window.open('','okno','menubar=0,location=0,scrollbars=yes,width=540,height=540,resizable=1,top=0');
}

function openInNewWindow(url) {
  // Change "_blank" to something like "newWindow" to load all links in the same new window
  var newWindow = window.open(url, '_blank');
  newWindow.focus();
  return false;
}


  function testSubmit(form) {
  form.but.value=1
  
  if (form.jmeno.value == "")
     alert("Musíte zadat jméno !");
  else if (form.telefon.value == "")
     alert("Musíte zadat telefon !");
  else if (form.email.value == "")
     alert("Musíte zadat e-mail !");
  else
        form.submit();
  }
  
  function zmenaDat(form) {

   if (form.varianta[0].checked) {
       form.origmaxwidth.value=280
       form.origmaxheight.value=400
       form.thumbmaxwidth.value=170
       form.thumbmaxheight.value=110
   }
   else if (form.varianta[1].checked) {
          form.origmaxwidth.value=500
          form.origmaxheight.value=500
          form.thumbmaxwidth.value=160
          form.thumbmaxheight.value=102
   }
  }
  
  
  
