var gAutoPrint = false;

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<link rel="stylesheet" type="text/css" href="scripts/main.css" />\n';
html += '</HEAD>\n<body onload="window.resizeTo(660,640)">\n';
html += '<center>\n';
html += '<table cellpadding=0 cellspacing=0 border=0 width=620><tr>\n';
html += '<td><img src="root_images/challenge_logo_print.gif" width="339" height="76" alt="Challenge" hspace="10"></td>\n';
html += '<td align="right" valign="bottom"><form><input type="button" value="Print" onClick="window.print()" style="margin-right: 10px;"><input type="button" value="Close" onClick="javascript:window.close();" style="margin-right: 10px;"></td>\n';
html += '</tr></form></table><hr size="1" width="600">\n';
html += '<table cellpadding=10 cellspacing=0 border=0 width=620><tr><td class="maintext" width="620">\n';

		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
html += '<tr><td align="right" valign="bottom"><form><input type="button" value="Print" onClick="window.print()" style="margin-right: 10px;"><input type="button" value="Close" onClick="javascript:window.close();"></td></form>\n';
html += '<table cellpadding="0" cellspacing="0" border="0" width="620"><tr>\n';
html += '<td width="620" height="20" bgcolor="#D2232A" class="copyright" align="center">© 2007, PS21 Office, PMO, Public Service Division. All Rights Reserved.</td>\n';
html += '</tr></table>\n';
html += '</center>\n';
html += '\n</BODY>\n</HTML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the Print-Ready feature is only available in Internet Explorer 5 and later or Netscape version 6 and later.");
	}
}