


hs.Expander.prototype.printHtml = function ()
{
    var pw = window.open("about:blank", "_new");
    pw.document.open();
    pw.document.write(this.getHtmlPrintPage());
    pw.document.close();
    return false;
};
hs.Expander.prototype.getHtmlPrintPage = function()
{
    // We break the closing script tag in half to prevent
    // the HTML parser from seeing it as a part of
    // the *main* page.
    var body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body')
        || this.innerContent;

    return "<html>" +
        "<head>" +
        "<title>Temporary Printing Window</title>" +
        "<script>" + "function step1() {" +
        "  setTimeout('step2()', 10);" +
        "}" +
        "function step2() {" +
        "  window.print();" +
        "  window.close();" +
        "}" +
        "</scr" + "ipt>" +
        "</head>" +
        "<body onLoad='step1()'>" +
        body.innerHTML +
        "</body>" +
        "</html>";
};