var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '\n<HTML>\n<HEAD>\n<link href="global.css" rel="stylesheet" type="text/css">\n';

//		if (document.getElementsByTagName != null)
//		{
//			var headTags = document.getElementsByTagName("head");
//			if (headTags.length > 0)
//				html += headTags[0].innerHTML;
//		}
		
		html += '\n<style>body { background-color: #FFFFFF; }</style></HEAD>\n<BODY class="body" style="margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;" bgcolor="#FFFFFF">\n<span class="body"><table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><img src="images/print-header.gif" width="647" height="95"></td></tr><tr><td style="padding-left: 20px; padding-top: 20px; padding-right: 20px; padding-bottom: 20px;">';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Sorry, This page cannot be printed.");
			return;
		}
			
		html += '\n</span>\n</td></tr></table></BODY>\n</HTML>';
		
		var printWin = window.open("","printSpecial", "height=450,width=720,status=yes,scrollbars=yes");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the printer friendly version cannot be displayed.");
	}
}
