function printerfriendly(displayhtml)
{
  generator=window.open('/print.html','name','height=400,width=500,menubar=yes,titlebar=yes,scrollbars=1,resizable=yes');
  start_erase = displayhtml.lastIndexOf('<P style', displayhtml.indexOf('pflink'));
  end_erase = displayhtml.indexOf('</P>', displayhtml.indexOf('pflink'))+4;
  mystring = displayhtml.replace(displayhtml.substring(start_erase, end_erase),'') + '<center><input type="button" value="Close" onclick="javascript:window.close()"></input><input type="Button" value="Print" onclick="javascript:window.print()"></input></center>';

  generator.document.open();
  generator.document.write('<html>');
  generator.document.write('<head>');
  generator.document.write('</head>');
  generator.document.write('<body>');
  generator.document.write(mystring);
  generator.document.write('</body>');
  generator.document.write('</html>');
  generator.document.close();
}

