function ShowImage(jmeno, sirka, vyska, popis) {
  wokno=window.open("", "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width="+sirka+",height="+vyska);
  wokno.document.write("<html><head><title>"+popis+"</title></head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
  wokno.document.write("<img src=\""+jmeno+"\" width="+sirka+" height="+vyska+" border=0 alt=\""+popis+"\" onClick=\"window.close();\">");
  wokno.document.write("</body></html>");
}  

function ShowPageImg(jmeno, sirka, vyska, popis) {
  wokno=window.open("", "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width="+sirka+",height="+vyska);
  wokno.document.write("<html><head><title>"+popis+"</title></head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
  wokno.document.write("<img src=\""+jmeno+"\" width="+sirka+" height="+vyska+" border=0 alt=\""+popis+"\" onClick=\"window.close();\">");
  wokno.document.write("</body></html>");
}  

function isEmail(string) {
  if(string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
    return true;
  else return false;
}
function ValidateForm(form) {
    var ret=true;
    var mail=true;
    var help=false;
		for(i=0;i<form.length;i++) {
      var swap=form.elements[i];
      //alert(swap.name +'='+ swap.value + ' | '+ swap.type);
      if((swap.type=='text' || swap.type=='textarea') && (swap.value=='' &&  swap.name.substring(0,6)=='check_')) {	
        ret=false;
      }
      /*if(swap.type=='radio') {
        if(!swap.checked) { help=true;}
        else if(!help) {help=false;}
      }*/
      if(swap.name=='email' && !isEmail(swap.value)){ mail=false;}
    }
    if(!ret) alert("Formulář nebylo možno odeslat. Pravděpodobně jste nevyplnili některé povinné pole.")
    //if(help && ret) { alert("Formulář nebylo možno odeslat. Pravděpodobně jste nevyplnili některé povinné pole."); ret=false;}
    if(!mail && ret) { alert("Zadali jste špatnou emailovou adresu. Zkuste to prosím znova."); ret=false;}
    return ret;
  }

function ShowAkce() {
  document.getElementById('frameakce').style.display='block';
}
function CloseAkce() {
  document.getElementById('frameakce').style.display='none';
}

function HideDialog() {
  var div = document.getElementById("propagation");
  div.className="front-panel-off";
}
