var gAutoPrint = true; // Tells whether to automatically call the print function

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</HE>\n<BODY style="background-color:#FFFFFF">\n';

var printReadyElem = document.getElementById("printReady");

if (printReadyElem != null)
{
html += "<table align='center' cellpadding=0 cellspacing=0 border='0'>";
html += "<tr><td width='595' height='161'>"
html += "<img alt='' height='161' src='/Images/print/1.gif' width='595' />";
html += "</td></tr>"
html += "<tr><td align='center'height='100%' dir='ltr' width='611px'  style='padding:0 0 0 0'>"
html += "<div align='right' width='570px' style='padding:10 10 10 10' dir=rtl>";
html += printReadyElem.innerHTML ;
html += "</div>";
html += "</td></tr>"
//html += "<tr><td width='611px' style='font-family:Tahoma;font-size:11px;' background='/images/print/2.gif' height='5' align='center'>Copyright nusrah.org,2008.All Right Reserved.Powered By Digital Chains</td></tr>"
//html += "<tr><td width='611px' height='5'><img alt='' height='2' src='/Images/print/5.jpg' width='611' /></td></tr>"
//html += "<tr><td width='595' height='24'>"
//html += "<img alt='' height='24' src='/Images/print/2.gif' width='595' />";
//html += "</td></tr>"
//html += "<tr><td width='595' height='33'>"
//html += "<img alt='' height='45' src='/Images/print/3.gif' width='595' />";
//html += "</td></tr>"

html += "</table>";
}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BO>\n</HT>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}