<script language ="javascript">

  function PrintIt(){
    window.print()
  }
 

  /*  Hide and reveal controls that should not print.         */
    function window.onbeforeprint(){
                var oControl;
                oControl = document.getElementById('button1');
                if (oControl != null){oControl.style.visibility="hidden";}
     }

     function window.onafterprint(){
               var oControl;
                oControl = document.getElementById('button1');
                if (oControl != null){oControl.style.visibility="visible";}
        }
 
 
</script>