// Funktion für den Druckaufruf

var gAutoPrint = true; // Flag for whether or not to automatically call the print function

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</HE' + 'AD>\n<BO' + 'DY style="background-color:#ffffff; background-image:none;">\n<DIV style="width:640px;">';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Keine Markierung zum Drucken hinterlegt!");
			return;
		}
			
		html += '</div>\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial","width=640,height=400,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Leider unterstützt ihr Browser den Druckauftrag nicht!");
	}
}
