var gAutoPrint = true;
// Flag for whether or not to automatically call the print function
function PrintPage()
{
if (document.getElementById != null)
{

var html = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">'

html += '<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n';
html += '<link href=\"/Resources/Styles/Print.css \" rel=\"stylesheet\" type=\"text/css\">'
html += '\n</HE' + 'AD>\n<BODY>\n';

html += '<table width=\"750\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ><tr><td align="\center\">\n';
//html +='<img src=\"http://masrawy.com/newsimages/BW_logo.gif\" alt="\Masrawy\">'
html += '</td></tr></table>\n';
html += '<a href=\"javascript:window.close();\">اغلق هذه النافذة</a>'
html += '<hr align="\center\">'
html += '<table width=\"575\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align="\center\"><tr><td align=\"right\">\n';
var printReadyElem = document.getElementById("mclip");
if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady section in the HTML");
return;
}
var date = new Date();
var yr = date.getFullYear();
html += '</td></tr><tr><td align="\center\" class="\medium\">';
html += '<br><br>';
html += 'هذا المحتوى مطبوع من موقع دار الأنصار  و عنوانه على الصفحة التالية';
html += '<br><br>';
html += parent.window.location.href ;
html += '<BR>';
html += ''
html += '<BR>';
html += '<p class="\medium\"><strong>Copyright &copy; '+ yr +'  daralansar.com. All rights reserved.</strong></p>';
html += '</td></tr></table>\n';

html += '\n</BO' + 'DY>\n</HT' + 'ML>';
var printWin = window.open("","Print");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("عفواً هذه الخاصية متوفرة فى متصفحات الانترنت الحديثة فقط");
}
}