How to call a onclick print funtion and forget it : I wrote a print function and it opening a new tab window for print and then that print button keep active untill I don't close that window by cancel or print. During that I am unable to call my other javascript function on parent page. So my question is , is it possible to open a print window and that print button become inactive again, and windows keep open to print? below is my funtion.

    function g_print_div(in_div_id)
    {

     div_id = in_div_id || 'idprint';
           var divElements = document.getElementById(div_id).innerHTML;
      var oldPage = document.body.innerHTML;

        var printWindow = window.open();
        printWindow.document.write('<html>');

        printWindow.document.write("<link rel='stylesheet' type='text/css' href='/static/css/print.css') %]' />");

        printWindow.document.write('<body >');
        printWindow.document.write(divElements);
        printWindow.document.write('</body></html>')
                  printWindow.print();
 
        printWindow.document.close();
        printWindow.close();
    }

calling with onclick='g_print_div();' funtion, If there is any other method to accomplish this, then let me know.

Thanks