var gAutoPrint = true;

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		html += '\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">\n';
		html += '\n</HE' + 'AD>\n<BODY BGCOLOR=white class="wydruk"><FONT FACE=Verdana SIZE=2>\n';
		html += '\n<TABLE WIDTH=500 BORDER=0 CELLPADDING=0 CELLSPACING=0>\n';
		html += '\n<TR>\n';
		html += '\n<TD WIDTH=50% ALIGN=LEFT>\n';
		html += '\n<IMG SRC=images/logo_druk.gif BORDER=0 ALIGN=LEFT>\n';
		html += '\n</TD>\n';
		html += '\n<TD WIDTH=50% ALIGN=RIGHT><A HREF=javascript:void(0); OnClick=javascript:self.close(); class=more>Zamknij okno</A></TD>\n';
		html += '\n</TR></TABLE><BR>\n';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Blad drukowania");
			return;
		}
			
		html += '\n</FONT></BO' + 'DY>\n</HT' + 'ML>';
		pwidth = 595;
		pheight = 400;
		var printWin = window.open("","printSpecial","height="+pheight+",width="+pwidth+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=0,left=0");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Niestety moŻliwość automatycznego drukowania dostępna jest w nowszej wersji przegladarki.");
	}
}

