var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var printReadyElem = document.getElementById("printReady");
		var printReadyElem1 = document.getElementById("printReady1");
		var printReadyElemURL = document.getElementById("printURL");

		var html = '<html><head><title>Print Page</title>';
		html += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href= "/css/nfpa.css" rel="stylesheet" type="text/css"></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="612" border="0" cellspacing="0" cellpadding="0" bordercolor=green align="center">';
		html += '<tr><td><img src="/images/spc.gif" width="16" height="15"></td>';
		html += '<td><img src="/images/spc.gif" width="6" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="50" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="22" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="7" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="225" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="19" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="144" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="86" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="19" height="1"></td>';
		html += '<td><img src="/images/spc.gif" width="16" height="1"></td>';
		html += '</tr>';
		html += '<tr><td colspan="11"><img src="/images/spc.gif" width="1" height="2"></td></tr>';
		html += '<tr><td colspan="2"><img src="/images/spc.gif" width="1" height="1"></td>';
		html += '<td colspan="8" class="bgblue"><img src="/images/spc.gif" width="1" height="5"></td>';
		html += '<td><img src="/images/spc.gif" width="1" height="1"></td>';
		html += '</tr><tr><td colspan="11"><img src="/images/spc.gif" width="1" height="3"></td></tr>';
		html += '<tr><td colspan="2"><img src="/images/spc.gif" width="1" height="1"></td>';
		html += '<td colspan="4" align="left" valign="top" class="breadcgrey">';
		html += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
		html += '<tr>&nbsp;</td>';
		html += '<td colspan="5" align="left" valign="top">';
		//<!--bredcrumb here>-->
		if (printReadyElem != null)
		{
				printReadyElem.innerHTML = printReadyElem.innerHTML.replace("width=426","width=100%");
				printReadyElem.innerHTML = printReadyElem.innerHTML.replace("width=600","width=100%");
				html += printReadyElem.innerHTML;

		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}

		html += '</td></tr></table></td>'
		html += '<td>&nbsp;</td>';
		html += '</tr><tr><td colspan="2"><img src="/images/spc.gif" width="1" height="1"></td><td colspan="8">'
		//<!--	body part-->

		var printReadyElem1 = document.getElementById("printReady1");
		
		if (printReadyElem1 != null)
		{
				printReadyElem1.innerHTML = printReadyElem1.innerHTML.replace("width=426","width=100%");
				html += printReadyElem1.innerHTML;

		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}


		var printReadyElemURL = document.getElementById("printURL");

		if (printReadyElemURL != null)
		{
				printReadyElemURL.innerHTML = printReadyElemURL.innerHTML.replace("#ffffff","#000000");
				html += printReadyElemURL.innerHTML;
		}
		else
		{
				
		}

		html += '</td><td>&nbsp;</td></tr>';
		html += '<tr><td colspan="2"><img src="/images/spc.gif" width="1" height="1"></td>';
		html += '<td colspan="8" align="right" valign="top" class="copytxt"></td>';
		html += '<td><img src="/images/spc.gif" width="1" height="15"></td>';
		html += '</tr><tr>';
		html += '<td colspan="2"><img src="/images/spc.gif" width="1" height="1"></td>';
		html +='<td colspan="8" class="bgblue"><img src="/images/spc.gif" width="1" height="2"></td>';
		html += '<td><img src="/images/spc.gif" width="1" height="1"></td></tr>';
		html += '<tr><td colspan="11"><img src="/images/spc.gif" width="1" height="3"></td></tr>';
		html += '<td colspan="11"><img src="/images/spc.gif" width="1" height="15"></td></tr>';
		html += '</table><br></body></html>';

		var printWin = window.open("","printSpecial","scrollbars=yes,resizable=yes,width=600,height=402,top=60,left=40");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
		{
			printWin.print();
			//printWin.close();	
		
		}
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}
