﻿function PrintDiv(DivName,CssPath,Width,Height)
{
    var Prop="resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,height="+Height+",width="+Width;
    
    var Content = document.getElementById(DivName).innerHTML;
    
    var NewWin = window.open("","",Prop);
    NewWin.document.open();
    NewWin.document.write('<html><head><title>IRC Print Doc</title>');
    NewWin.document.write('<LINK href="'+CssPath+'" type="text/css" rel="stylesheet">');
    NewWin.document.write('</head>');
    NewWin.document.write('<body onLoad="self.print()"><center>');
    NewWin.document.write(Content);
    NewWin.document.write('</center></body></html>');
    NewWin.document.close(); 
    NewWin.focus(); 
}

function PrintHTML(HTML,CssPath,Width,Height)
{
    var Prop="resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,height="+Height+",width="+Width;
      
    var NewWin = window.open("","",Prop);
    NewWin.document.open();
    NewWin.document.write('<html><head><title>IRC Print Doc</title>');
    NewWin.document.write('<LINK href="'+CssPath+'" type="text/css" rel="stylesheet">');
    NewWin.document.write('</head>');
    NewWin.document.write('<body onLoad="self.print()"><center>');
    NewWin.document.write(HTML);
    NewWin.document.write('</center></body></html>');
    NewWin.document.close(); 
    NewWin.focus(); 
}

function PrintCV()
{
    var QRST = "AjaxActions.aspx?action=GetCvHTML";
    var HTML = ($.ajax({url:QRST,async: false}).responseText);
    PrintHTML(HTML,'','740px','500px')
}
