function printPartOfPage(elementId)

{

 var printContent = document.getElementById(elementId);
var currentDate = new Date()
  var day = currentDate.getDate()
  var month = currentDate.getMonth()+1
  var year = currentDate.getFullYear()
  
 

 var printWindow = window.open('', '', 'left=50000,top=50000,width=0,height=0,scrollbars=1');

 printWindow.document.writeln('<HTML><HEAD><title>Print Preview</title>')
    printWindow.document.writeln('<link href="stylesheets/style.css" rel="stylesheet" type="text/css">')
//    printWindow.document.writeln('<LINK href=PrintStyle.css ' + 
//                        'type="text/css" rel="stylesheet" media="print">')
    printWindow.document.writeln('<base target="_self"></HEAD>')

    //Adding Body Tag
    printWindow.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" onload=print();');
    printWindow.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    printWindow.document.writeln('<form method="post">');

    //Creating two buttons Print and Close within a HTML table
    printWindow.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
   // printWindow.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
  //  printWindow.document.writeln('onclick="javascript:location.reload(false);window.print();">');
  //  printWindow.document.writeln('<INPUT ID="CLOSE" type="button" ' + 
                      //  'value="Close" onclick="window.close();">');
    printWindow.document.writeln('</TD></TR><TR><TD>');
    printWindow.document.writeln(' <table width=100% border=0 cellspacing=0 cellpadding=3><tr><td class=heading><div align=center><span class=Rheading><img src=../images/logo_print.png width=40 height=40>All India Marwari Yuva Manch</span></div></td></tr>');
    printWindow.document.writeln(' <tr><td class=Rsubheading><div align=center>3432/13, Hasan Building, IInd Floor, Nicholson Road, Kashmere Gate, Delhi-110 006</div></td></tr>');
    printWindow.document.writeln(' <tr><td class=impname><div align=center>Phone: 011-23911641,23931641,24504812 Email: mayumhq@gmail.com, info@aimym.com </div></td></tr>');   
    printWindow.document.writeln(' <tr><td class=impname><div align=right>Report Date:');
   printWindow.document.writeln(day + "/" + month + "/" + year); 
   printWindow.document.writeln(' </div></td></tr></table>');    
   printWindow.document.writeln('</TD></TR><TR><TD align=center>'); 
     printWindow.document.writeln(document.getElementById(elementId).innerHTML);
    printWindow.document.writeln('</TD></TR></TABLE>');

    //Writing print area of the calling page
   
    //Ending Tag of </form>, </body> and </HTML>
    printWindow.document.writeln('</form></body></HTML>');

// printWindow.document.write(printContent.innerHTML);

 printWindow.document.close();

 printWindow.focus();

 //printWindow.print();

 //printWindow.close();

} 

//function printPartOfPage(elementId,heading)

//{

// var printContent = document.getElementById(elementId);

// var printWindow = window.open('', '', 'left=50000,top=50000,width=0,height=0,scrollbars=1');

// printWindow.document.writeln('<HTML><HEAD><title>Print Preview</title>')
//    printWindow.document.writeln('<link href="stylesheets/style.css" rel="stylesheet" type="text/css">')
////    printWindow.document.writeln('<LINK href=PrintStyle.css ' + 
////                        'type="text/css" rel="stylesheet" media="print">')
//    printWindow.document.writeln('<base target="_self"></HEAD>')

//    //Adding Body Tag
//    printWindow.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
//    printWindow.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
//    //Adding form Tag
//    printWindow.document.writeln('<form method="post">');

//    //Creating two buttons Print and Close within a HTML table
//    printWindow.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
//    printWindow.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
//    printWindow.document.writeln('onclick="javascript:location.reload(false);window.print();">');
//    printWindow.document.writeln('<INPUT ID="CLOSE" type="button" ' + 
//                        'value="Close" onclick="window.close();">');
//   printWindow.document.writeln('</TD></TR><TR><TD>');
//    printWindow.document.writeln(' <table width=100% border=0 cellspacing=0 cellpadding=3><tr><td class=heading><div align=center><span class=Rheading>All India Marwari Yuva Manch</span></div></td></tr>');
//    printWindow.document.writeln(' <tr><td class=Rsubheading><div align=center>'+heading+'3432/13, Hasan Building, IInd Floor, Nicholson Road, Kashmere Gate, Delhi-110 006</div></td></tr>');
//    printWindow.document.writeln(' <tr><td class=impname><div align=center>Phone: 011-23911641,23931641,24504812 Email: mayumhq@gmail.com, info@aimym.com </div></td></tr></table>');   
//    printWindow.document.writeln('</TD></TR><TR><TD align=center>'); 
//    printWindow.document.writeln(document.getElementById(elementId).innerHTML);
//    printWindow.document.writeln('</TD></TR></TABLE>');

//    //Writing print area of the calling page
//   
//    //Ending Tag of </form>, </body> and </HTML>
//    printWindow.document.writeln('</form></body></HTML>');

//// printWindow.document.write(printContent.innerHTML);

// printWindow.document.close();

// printWindow.focus();

// //printWindow.print();

// //printWindow.close();

//} 
