function ImageZoom(imgName, wWidth, wHeight) {
  MarginWidth = 10; MarginHeight = 59;
  wTop = Math.round((screen.height - wHeight - MarginHeight) / 2) - MarginHeight;
  wLeft = Math.round((screen.width - wWidth) / 2);
  img = new Image(); img.src = imgName;
  ZoomPtr = window.open("", "Zoom", "width="+wWidth+",height="+wHeight+",top="+wTop+",left="+wLeft);
  ZoomPtr.resizeTo(wWidth + MarginWidth, wHeight + MarginHeight);
  with (ZoomPtr.document) {
    open();
    write('<html> \n <head> \n');
    write('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> \n');
    write('<title>Zoom</title> \n <style type="text/css"> \n body {margin: 0px;} \n </style> \n </head> \n');
    write('<body> \n <div align="center">');
    write('<a href="javascript:close();" title="Zavřít okno"><img src="'+img.src+'" width="'+wWidth+'" height="'+wHeight+'" border=0 alt="Zavřít okno"></a></div>');
    write('</body> \n </html> \n');
    close();
  }
  ZoomPtr.focus();
}

function NewWindow(url, winName, w, h) {
  PopupPtr = window.open(url, winName, "scrollbars=yes,resizable=yes,menubar=no,top=20,left=20,width=" + w + ",height=" + h);
  PopupPtr.focus();
}

function CenterWindow(w, h) {
  window.moveTo((screen.width - w)/2, (screen.height - h - 35)/2);
}

/*
function SetClass(frameName, Element, Style) {
  if(window.top != window.self) {
    frameName.document.getElementById(Element).className = Style;
  }
}
*/

function CheckForm(form) {
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
  if (form.email.value.search(re)) {
    alert('Vyplňte, prosím, správně pole "E-mail".');
    form.email.focus();
    return false;
  }
  if (form.mesto.value == '') {
    alert('Vyplňte, prosím, pole "Město".');
    form.mesto.focus();
    return false;
  }
  if (form.ulice.value == '') {
    alert('Vyplňte, prosím, pole "Ulice a číslo".');
    form.ulice.focus();
    return false;
  }
  if (form.jmeno.value == '') {
    alert('Vyplňte, prosím, pole "Jméno a příjmení".');
    form.jmeno.focus();
    return false;
  }
  if (form.firma.value == '') {
    alert('Vyplňte, prosím, pole "Firma".');
    form.firma.focus();
    return false;
  }
  re = /^[0-9]{3}[ ]{0,1}[0-9]{2}[ ]{0,1}[0-9]{3}$/
  if (form.ic.value.search(re)) {
    alert('Vyplňte, prosím, správně pole "IČ" [xxxxxxxx].');
    form.ic.focus();
    return false;
  }
/*
  re = /^[Cc][Zz][0-9]{8,10}$/
  if (form.dic.value.search(re)) {
    alert('Vyplňte, prosím, správně pole "DIČ" [CZxxxxxxxx].');
    form.dic.focus();
    return false;
  }
*/
  if (form.psc.value == '') {
    alert('Vyplňte, prosím, pole "PSČ".');
    form.psc.focus();
    return false;
  }
  re = /^[ 0-9\.\+\/\-]{8,}$/
  if (form.telefon.value.search(re)) {
    alert('Vyplňte, prosím, správně pole "Telefon".');
    form.telefon.focus();
    return false;
  }
  return true;
}

