function makepage(src)
{
// 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>" +
"<head>" +
"<title>Temporary Printing Window</title>" +
"<scr" + "ipt>" +"function step1(){ " +" setTimeout('step2()', 10);" +"}" +
"function step2() {" +
" window.print();" +
" window.close();" +
"}" +
"</scr" + "ipt>" +
"</head>" +
"<body onLoad='step1()'>" +
"<img src='" + src + "'/>" +
"</body>" +
"</html>";
}
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;
link = "about:blank";
var pw = window.open(link, "_new");
pw.document.open();
pw.document.write(makepage(src));
pw.document.close();
}
