/* $Id: Printable.js,v 1.1 2006/01/26 14:47:12 baileyjs Exp $ Author: Jeremy Bailey Date: 11/09/2005 Company: SourceOne Network, Inc Description: Prints the content of the page opener using Javascript. This prevents the query string and FORM posting problem of the the past. The basic idea is that we grab all the HTML from our parent, then look for the / tags. Everything between them is GOOD content, everything outside is header/footer. We do some string magic and write to the contents of our own div, and voila, we have just the content! */ function AlariusPrintable() { var PrintWindow; AlariusPrintableWin = window.open("","Printable","width=600,height=400,left=200,scrollbars,resizable"); PrintWindow=AlariusPrintableWin.document.open(); PrintWindow.writeln('\n\n' + document.title + ' '); for (var i=0; i <= document.styleSheets.length-1; i++) { PrintWindow.writeln(''); } PrintWindow.writeln('\n'); PrintWindow.writeln('\n'); PrintWindow.writeln('
'); PrintWindow.writeln('Print This Page  '); PrintWindow.writeln('
'); PrintWindow.writeln('
' + AlariusPrintableCopyContent() + '
'); PrintWindow.writeln('\n\n'); PrintWindow=AlariusPrintableWin.document.close(); // We had a problem with the disable link script running too soon, before the links populated // So, we "delay" it by shoving it through setTimeout(); window.setTimeout('AlariusPrintableDisableActions()', 0); AlariusPrintableWin.focus(); } function AlariusPrintableCopyContent() { var Content,startpos,endpos,offset,starttag,endtag; // IE and Firefox treat the content differently, so we need different tags and offsets var ie8orbelow = false; if(document.all) { if(document.documentMode) { ie8orbelow = document.documentMode <= 8 ? true : false; } else { var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null) { rv = parseFloat( RegExp.$1 ); if ( rv < 9.0 ) ie8orbelow = true; } else ie8orbelow = true; } } if(ie8orbelow) { starttag = '