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 <p align="center"><br /><input type="button" value="Close Window" onClick="self.close()" style="color:#ffffff; border-color:#2E69AE; border-width:5px; background-color:#2E69AE; >';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}

html += '\n</HE' + 'AD>\n<BODY>\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 += '</BO' + 'DY>\n</HT' + 'ML>';

var printWin = window.open("","printSpecial", width="200", height="200");
printWin.document.write(html);
if (gAutoPrint)
printWin.print();
printWin.document.close();
}
else
{
alert("Sorry, the print ready feature is only available in modern browsers.");
}
}



