function imgcPopupImage(imgSrc,imgTitle,imgDesc,imgWidth,imgHeight,
	galDefinition) {

 var defs = new Array();
defs[1] = Array("T","Podgl±d obrazu","#FFFFFF","1","1","","","");

 defAutosize	= (defs[galDefinition][0] == "T");
 defTitle	= defs[galDefinition][1];
 defColor	= defs[galDefinition][2];
 defMarginLeft	= defs[galDefinition][3];
 defMarginTop	= defs[galDefinition][4];
 defBodyClass	= defs[galDefinition][5];
 defImgClass	= defs[galDefinition][6];
 defCSSFile	= defs[galDefinition][7];
 
 if (defCSSFile == "") {
 
    CSSFile = "/css/std.css";
 
 }
    
 if (defAutosize) {
     rozmiar = -1;
 } else {
     rozmiar = 1;
 }

  if (rozmiar == -1) {
     wWidth  = imgWidth+defMarginLeft*2;
     wHeight = imgHeight+defMarginTop*2;
     
     if (wWidth > screen.availWidth)   wWidth  = screen.availWidth;
     if (wHeight > screen.availHeight) wHeight = screen.availHeight;
     
     if ((imgWidth+defMarginLeft*2 > screen.availWidth) ||
	 (imgHeight+defMarginTop*2 > screen.availHeight)) {
	 wScroll = 'yes';
	 wResize = 'yes';
     } else {
	 wScroll = 'no';
	 wResize = 'no';
     }
     wTop    = (screen.availHeight - wHeight)/2;
     wLeft   = (screen.availWidth - wWidth)/2;
     if (imgDesc != "") {
	imgTitle = imgTitle + "\n" + imgDesc;
        imgDesc  = "";
     }
  } else if (rozmiar == 0) {
     wWidth  = screen.availWidth;
     wHeight = screen.availHeight;
     wTop    = 0;
     wLeft   = 0;
     wScroll = 'yes';
     wResize = 'yes';
  } else if (rozmiar > 0) {
     if (rozmiar == 1) { faktor = 0.9 }
     if (rozmiar == 2) { faktor = 0.6 }
     if (rozmiar == 3) { faktor = 0.4 }

     wWidth  = screen.availWidth * faktor;
     wHeight = screen.availHeight * faktor;
     wTop    = (screen.availHeight - wHeight)/2;
     wLeft   = (screen.availWidth - wWidth)/2;
     wScroll = 'yes';
     wResize = 'yes';
  }
  
  defTitle = defTitle.replace( /%1/g, imgTitle );

  iswnd = window.open('','','toolbar=no,scrollbars='+wScroll+',resizable='+wResize+',status=no,location=no,directories=no,width='+wWidth+',height='+wHeight+',menubar=no,left='+wLeft+',top='+wTop);

  iswnd.document.writeln("<HEAD><TITLE>"+defTitle+"</TITLE>");
  iswnd.document.writeln("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-2'>")
  iswnd.document.writeln("<LINK REL='stylesheet' TYPE='text/css' HREF='"+defCSSFile+"'>");
  iswnd.document.writeln("</HEAD>");

  iswnd.document.writeln("<BODY CLASS='"+defBodyClass+"' TOPMARGIN='"+defMarginTop
			+"' LEFTMARGIN='"+defMarginLeft+"' BGCOLOR='"+defColor+"'>");
  iswnd.document.writeln("<TABLE WIDTH='100%' CELLSPACING='0' CELLPADDING='0' BORDER=0>");

  iswnd.document.writeln("<TR><TD STYLE='cursor: pointer' valign='middle' align='center'>");
  iswnd.document.writeln("<img src='" + imgSrc + "' border='1' class='"+ 
    defImgClass +"' alt='" + imgTitle +"' width='"+
    imgWidth + "' height='" + imgHeight + "' onClick='window.close()'>");

  if (imgDesc != '') {

      iswnd.document.writeln("<p>" + imgDesc + "</p>");
  }
  
  iswnd.document.writeln("</TD></TR>");

  iswnd.document.writeln("</TABLE>");
  iswnd.document.writeln("</BODY></HTML>");

  return;
}


