function makepage(bodytext)
{
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.

  return "<html>\n" +
    "<head>\n" +
    "<title>UC San Diego News Center</title>\n" +
    "<link type='text/css' href='http://ucsdnews.ucsd.edu/styles/printmodule.css' rel='stylesheet' media='all' />" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    bodytext + "\n" +
    "</body>\n" +
    "</html>\n";
}

function printme(evt)
{
  if (!evt) {
    // Old IE
    evt = window.event;
  }    
  var image = evt.target;
  if (!image) {
    // Old IE
    image = window.event.srcElement;
  }
  src = image.src;
  doc = document.getElementById('center-wrap') //this is the Id that will be called for printing
  var bodytext = doc.innerHTML
  
  link = "about:blank";

  var pw = window.open(link, "_new");
  pw.document.open();
  pw.document.write(makepage(bodytext));
  pw.document.close();
}
