function openWin(obrazek, width, height)
  {
    var winWidth = width;
    var winHeight = height;
    var leftPosition = (screen.width) ? (screen.width-winWidth)/2 : 0;
    var topPosition = (screen.height) ? (screen.height-winHeight)/2 : 0;
    var popupWin, argstr = "width=" + winWidth + ",height=" + winHeight + ",top=" + topPosition + ",left=" + leftPosition + ",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0";
    var htmlBegin = "<html>\n<head>\n<title>OBRÁZEK</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\">\n<style>\n";
    htmlBegin = htmlBegin + "BODY { COLOR: #999999; BACKGROUND-COLOR: #000000; margin-top: 0px; margin-left: 0px; MARGIN: 0px; font-family: Arial, Tahoma; font-size: 12pt; }\n";
    htmlBegin = htmlBegin + "TD { FONT-WEIGHT: normal; FONT-SIZE: 10px; }\n</style>";
    htmlBegin = htmlBegin + "<script language=\"JavaScript\">\n";
    htmlBegin = htmlBegin + "function hideLoadingPage() {\n"
    htmlBegin = htmlBegin + "if (document.getElementById) { document.getElementById('hidepage').style.visibility = 'hidden'; }\n";
    htmlBegin = htmlBegin + "else { if (document.layers) { document.hidepage.visibility = 'hidden'; }\n";
    htmlBegin = htmlBegin + "else { document.all.hidepage.style.visibility = 'hidden'; } } }\n";
    htmlBegin = htmlBegin + "</script>\n";
    htmlBegin = htmlBegin + "</head>\n<body>\n";
    htmlBegin = htmlBegin + "</head>\n<body onload=\"hideLoadingPage()\">\n";
    htmlBegin = htmlBegin + "<div id=\"hidepage\" style=\"position: absolute; left:0px; top:0px; height: 100%; width: 100%;\">";
    htmlBegin = htmlBegin + "<table width=100% height=100%><tr><td align=center><p><img src=\"images/loading.gif\"></p><p>načítám obrázek...</p></td></tr></table></div>";
    htmlBegin = htmlBegin + "<table width=\"100%\" height=\"100%\" border=\"0\" cellSpacing=\"0\" cellPadding=\"0\"><tr><td align=\"center\">";
    var htmlEnd = "</td></tr></table></body>\n</html>";
    var img = obrazek;
    img = "<img src=\""+img+"\" border=0 onclick=\"window.close()\" style=\"CURSOR: pointer\" alt=\"Kliknutím zavřete okno\">\n";
    popupWin = window.open("", "galeria", argstr);
    popupWin.document.open("text/html", "replace");
    popupWin.document.write(htmlBegin);
    popupWin.document.write(img);
    popupWin.document.write(htmlEnd);
    popupWin.document.close();
    popupWin.focus();
  }