﻿//
// © Copyright 2006 Hewlett-Packard
//
// Author:  Christian Kuhn-Küster
//
// Date         Revision    Comments
// -------------------------------------------------------------------------------------------------------
// 31.03.2006   1.0         Initial Release


// Print current window

function PrintCurrent(title)
{
    var innerHTML = document.documentElement.innerHTML;
    
    innerHTML = innerHTML.replace('media=print','media=all');
    innerHTML = innerHTML.replace('media="print"','media="all"');    

    innerHTML = innerHTML.replace('<body>','<body onLoad="if (window.name != \'PrintView\') { window.name=\'PrintView\'; location.reload(); } else { window.print(); }">');
    innerHTML = innerHTML.replace('<BODY>','<BODY onLoad="if (window.name != \'PrintView\') { window.name=\'PrintView\'; location.reload(); } else { window.print(); }">');

    printWindow = window.open('about:blank',title,'dependent=yes,location=no,menubar=no,toolbar=no,status=no,scrollbars=yes');

    printWindow.document.open();
    printWindow.document.write(innerHTML);
    printWindow.document.close();
}


