function openWin(url, winWidth, winHeight, winRes)

    {

      if (winRes==1) { stat="resizable=1,scrollbars=1"; }

                else { stat="resizable=0,scrollbars=0"; };

      // calculate centered window position

      winLeft = Math.round((screen.width-winWidth)/2);

      winTop  = Math.round((screen.availHeight-winHeight)/2);

      winDef = "left="+winLeft+",top="+winTop+",height="+winHeight+",width="+winWidth+",directories=no,location=no,menubar=no,status=no,toolbar=no,"+stat;

      window.open(url, "", winDef);

      return true;

    }
    
// funkce pro otevirani obrazku v novem okne
var poc = 0;
var iwinTitle = "ZAHRADA OLOMOUC s.r.o."
 
function showImage(imgName, imWidth, imHeight, iTitle)  
{ 
  if (poc!==0) { iwin.close(); }; 
 
  url = imgName;
  resStr = "resizable=0,scrollbars=0";
 
  // define window oversize
  winPlusWidth = 20;
  if (iTitle != "") winPlusHeight = 80;
  else  winPlusHeight = 30; 
  // calculate window size
  winHeight = imHeight + winPlusHeight;
  winWidth = imWidth + winPlusWidth;
  // test if the window is not too large
  heightOK = true;
  if (winHeight>screen.availHeight)
    { winHeight = screen.availHeight-80;
     resStr=",resizable=1,scrollbars=1";
   heightOK = false;
   }
  if (heightOK==false)
    { winWidth = winWidth+22;
   }         
  if (winWidth>screen.width)
    { winWidth = screen.width-80;
     resStr=",resizable=1,scrollbars=1";
   }         
 
  // calculate centered window position
  winLeft = Math.round((screen.width-winWidth)/2);
  winTop  = Math.round((screen.availHeight-winHeight)/2);
 
  iwin = window.open("", "", "left="+winLeft+",top="+winTop+",height="+winHeight+",width="+winWidth+",directories=no,location=no,menubar=no,status=no,toolbar=no"+resStr);
  iwin.document.write("<html><head><title>", iwinTitle, "</title>");
  iwin.document.write("<link rel='stylesheet' type='text/css' href='styl.css'>");
  iwin.document.write("</head>");
  iwin.document.write("<body>");
  iwin.document.write("<p><a href='' onClick=\"window.close(); return false;\"><img width=", imWidth," height=", imHeight," src=\"", url, "\" alt='Kliknutím na obrázek zavřete okno' border=0></a></p>");
  iwin.document.write("<p class='popis'>" + iTitle + "</p>");
  iwin.document.write("</body></html>");
  poc++;
  return true;
}      

     



