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= "nbfspq_print.css" rel="stylesheet" type="text/css"></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="550" 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="200" 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><td width="90%" height="23" valign="middle" bordercolor="#000080" bordercolorlight="#C0C0C0" bordercolordark="#FF0000">';
		html +=  '<p align="center"><img border="0" src="images/Bar Inverted.jpg" width="451" height="27"></td></tr>';
		html +=  '<tr><td width="79%" height="20" valign="middle" bgcolor="#FFFFFF"><p align="center"><font color="#000080" face="Times New Roman" size="3"><b>National';
		html +=  ' Board on Fire Service Professional Qualifications</b></font></td> </tr>';
		html +=  '<tr><td width="79%" height="13" valign="top" bgcolor="#FFFFFF"><p align="center"><font color="#000080" face="Times New Roman" size="3"><b>Sponsors of the National Professional Qualifications System</b></font></td> </tr>';
		html +=  '<tr><td width="79%" height="11" valign="top" bgcolor="#FFFFFF"><p align="center"><img src="images/hor_lin2.gif" alt="hor_lin2.gif (3118 bytes)" width="448" height="27"></td> </tr>';
		html +=  '<tr><td style="border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: thin;"  height="2" valign="middle"><p align="center"><b><font face="Times New Roman" size="3" color="#CC3300">ProBoard Accreditation for Fire Service Training Organizations</font></b></td> </tr>';
		
		
		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;
		}


		html += '</td><td>&nbsp;</td></tr>';
		html += '</table><br></body></html>';

		var printWin = window.open("","printSpecial","scrollbars=yes,resizable=yes,width=800,height=600,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 later browsers.");
	}
}
