function displayPrinting() {
    var printDiv = document.getElementById("printButtonDiv");
    printDiv.innerHTML = "<p style='padding:0px;'>Printing Coupon...</p>";
}
function displayPrinted() {
    var printDiv = document.getElementById("printButtonDiv");
    printDiv.innerHTML = "<p style='padding:0px;'>Coupon Printed.</p>";
}
function printURL(url) {
    displayPrinting();
    if (window.print && window.frames && window.frames.printerIframe) {
        var html = "";
        html += "<html>";
        html += "<body>";
        html += "<iframe name=\"urlToPrint\" src=\"" + url + "\"></iframe>";
        html += "</body></html>";
        var ifd = window.frames.printerIframe.document;
        ifd.open();
        ifd.write(html);
        ifd.close();
    } else {
        if (confirm("To print a page with this browser " + "we need to open a window with the page.  Please print the contents of the browser window that opens before closing it.  You will not be able to open this window again.")) {
            var win = window.open("", "printerWindow", "width=600,height=300,resizable,scrollbars,toolbar,menubar");
            var html = "";
            html += "<html>";
            html += "<frameset rows=\"100%, *\" " + "onload=\"opener.printFrame(window.urlToPrint);\">";
            html += "<frame name=\"urlToPrint\" src=\"" + url + "\" />";
            html += "<frame src=\"about:blank\" />";
            html += "</frameset></html>";
            win.document.open();
            win.document.write(html);
            win.document.close();
        }
    }
}
function printFrame(frame) {
    if (frame.print) {
        frame.focus();
        frame.print();
    }
}