﻿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>\n<head>\n';
        //if (document.getElementsByTagName != null)
        //{
        //var headTags = document.getElementsByTagName("head");
        //if (headTags.length > 0)



        html += '<link href=\"/news/style/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://arabia.msn.com/news/images/msnlogo.gif\" alt="\News\">'
        html += '</td></tr></table>\n';
        html += '<a href=\"javascript:window.close();\">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("artical");
        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 += parent.window.location.href;
        html += '<BR>';
        html += ''
        html += '<BR>';
        html += '<p class="\medium\"><strong>Copyright &copy; ' + yr + '  News. All rights reserved.</strong></p>';
        html += '</td></tr></table>\n';
        html += '<!-- Other Scripts --><script type="text/javascript" src="//secure-uk.imrworldwide.com/v60.js"></script><script language="javascript" type="text/javascript" src="http://arabia.msn.com/js/AnalyticsCode.js"></script><!-- Other Scripts -->';
        html += '\n</BO' + 'DY>\n</HT' + 'ML>';

        var printWin = window.open("", "MSNPrint");
        printWin.document.open();
        printWin.document.write(html);
        printWin.document.close();
        if (gAutoPrint)
            printWin.print();
    }
    else {
        alert("Sorry, the print ready feature is only available in modern browsers.");
    }
}

function getUrlMail() {
    var curpath = window.location.href;
    if (curpath.toString().indexOf("maghreb.") != -1) {
        window.open('/divertissements/sendmail.aspx?document=' + document.location, '_blank');
    }
    else {
        window.open('/entertainment/sendmail.aspx?document=' + document.location, '_blank');
    }
}
