var isDOM = (document.getElementById);
var isIE4 = (document.all && !isDOM);
var isNS4 = (document.layers);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}

function showImg(href, x, y, title, pclose) {
  x+=30;
  if (!title) title = '';
  var swidth = screen.width, sheight = screen.height;
  var min_x = 100, min_y = 100, max_x = swidth - 10, max_y = sheight - 190;
  var iwidth = x > max_x ? max_x : x < min_x ? min_x : x, iheight = y > max_y ? max_y : y < min_y ? min_y : y;
  iwin = (iwidth != x || iheight != y) ? window.open("", "", "width=" + (iwidth + 50) + ",height=" + (iheight + 86)+ ",menubar,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40") : window.open("", "", "width=" + (iwidth + 50) + ",height=" +(iheight + 86) + ",screenX=20,screenY=40,left=20,top=40");
  iwin.document.writeln('<html>\n<head>');
  iwin.document.writeln('  <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
  iwin.document.writeln('  <title>' + title + '</title>');
  iwin.document.writeln('</head>');
  iwin.document.writeln('<body>');
  iwin.document.writeln('  <div style="text-align: center;">');
  if (title) iwin.document.writeln('<b>' + title + '</b><br />');
  iwin.document.writeln('    <a class="window" href="javascript:self.close()">');
  iwin.document.writeln('<img src="' + href + '" width="' + x + '" height="' + y + '" border="0" alt="' + title + '" title="' + title + '" /><br />');
  if (pclose) iwin.document.writeln('<small>' + pclose + '</small>');
  iwin.document.writeln('    </a><br />');
  iwin.document.writeln('  </div>');
  iwin.document.writeln('</body>');
  iwin.document.writeln('</html>');
  iwin.document.close();
  iwin.focus();
  return false;
}


