﻿function getPrint1(pagename)
{
    alert(pagename);
}
//Generating Pop-up Print Preview pag
function getPrint(print_area,pagename) {
    //Creating new page
    var pp = window.open('', '', 'width=600,height=400,top=0,left=0,screenX=10,screenY=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,dependent=no');
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<HTML><HEAD><title>Print Preview</title>') 
    //pp.document.writeln('<LINK href=Styles.css type="text/css" rel="stylesheet">')
    pp.document.writeln('<LINK href="/webncdr/Modernization/Utils/print.css" type="text/css" rel="stylesheet" media="print">')
    pp.document.writeln('<LINK href="/webncdr/Modernization/Utils/print.css" type="text/css" rel="stylesheet" media="screen">')
   // pp.document.writeln(' <script type="text/javascript" src="/webncdr/includes/CommonUtil.js" />')

    pp.document.writeln('<base target="_self"></HEAD>')
    
    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
    pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    pp.document.writeln('<form method="post">');
    pp.document.writeln('<TABLE width=75%><TR><TD align=center class="subtitle">');
    pp.document.writeln(pagename);
    pp.document.writeln('</TD></TR></TABLE>');
    //Creating two buttons Print and Close within a HTML table
    pp.document.writeln('<TABLE width=75%><TR><TD></TD></TR><TR><TD align=left>');
    pp.document.writeln('<INPUT ID="PRINT" class="button" type="button" value="Print" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print(); ">');   
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');
    pp.document.writeln('<TABLE width=75%><TR><TD></TD></TR><TR><TD align=right>');
    //Writing print area of the calling page
    pp.document.writeln(document.getElementById(print_area).innerHTML);
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');
        //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('<TABLE width=80%><TR><TD></TD></TR><TR><TD align=left>');
    pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" class="button" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print(); ">');
    pp.document.writeln('</TD><TD align="center">')
    pp.document.writeln('<A class="boldtext" href="Javascript:window.close();">Close Window</A>');
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');
    pp.document.writeln('</form></body></HTML>');
}
