
var subWindow;

// funkcja otwiera okienko o podanej wielkosci z obrazkiem 'url'
function openSubWindow(url, title, width, height)
{
	if(!subWindow || subWindow.closed)
	{
		subWindow = window.open("", "", "width=" + width + ",height=" + height);
		if(!subWindow.opener)
		{
			subWindow.opener = window;
		}
		
		var subBody = "<html><head><title>" + title + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\"></head>\n" +
				"<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onBlur=\"window.close();\">\n";

		subBody += "<img src=\"" + url + "\">\n";

		subBody += "</body></html>";
		
		subWindow.document.write(subBody);
		subWindow.document.close();
	}
	else
	{
		subWindow.focus();
	}
}
