function ImgWinOpen(file,title,w,h)
{
     look='';
     sbars = 0;
     resize = 0;
     if(w > screen.availWidth)
     {
     		w = screen.availWidth-30;
     		sbars = 1;
     		resize = 1;
     }
     if(h > screen.availHeight)
     {
     		h = screen.availHeight-60;
     		sbars = 1;
     		resize = 1;
     }

	  look = 'scrollbars='+sbars+', resizable='+resize+', width='+w+',height='+h+'';
     newWin = window.open(file,'newWindow','toolbar=0,location=0,'+look);
	  newWin.document.write("<html><head><title>"+title+"</title></head>");
	  newWin.document.write("<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0 margin=0 onClick='window.close();' style='cursor:pointer;'><img src=" +file+ " / alt='Kliknij, aby zamkną? okno'>");
	  newWin.document.write("</body></html>");
	
}

var okienko = null;
function otworzOkienko(url, title, width, height) {
    if(okienko && okienko.open && !okienko.closed){okienko.resizeTo(width+10,height+30);}else{okienko = window.open("","Powiększenie",'width='+width+',height='+height); void(0);}
    var x = (screen.width-width)/2;
    var y = (screen.height-height)/2;
    okienko.moveTo(x,y);
    okienko.document.open();
    okienko.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD><BODY bgcolor='#ffffff' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><center><img src="+url+" width="+width+" height="+height+"></center></BODY></HTML>");
    okienko.document.close();
    okienko.focus();
}

function displayWindow(url, width, height) {
    var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
}

