// Open printer friendly page function printPage() { var oBody = null; if(document.getElementById) { if(document.getElementById('cygeditToolContainer') !== null) { alert('\'Print this page\' function will trigger a javascript error for BCM enabled (draft) pages - please note that this does not occur on live pages'); } oBody = document.getElementById('InformationPane'); } else if(document.all) { oBody = document.all.InformationPane; } // If there is no InformationPane, it may be one of the type of page that has no menu pane, so get the next level up in the nested panesets if(oBody==null) { if(document.getElementById) { oBody = document.getElementById('ContentPane'); } else if(document.all) { oBody = document.all.ContentPane; } } if(oBody !== null) { // Parse out external links as these will get evaluated twice otherwise var s = oBody.innerHTML; //Remove script tags s=s.replace(/<[Ss][Cc][Rr][Ii][Pp][Tt].*<\/[Ss][Cc][Rr][Ii][Pp][Tt]>/g,""); // Open new window var newWin = window.open(); newWin.document.open(); // Write stylesheet if not netscape (which breaks if you do) if(navigator.appName !== 'Netscape') { // Get all the stylesheets that are in use on the page and write each one into the print page var aLinks = document.all.tags("LINK"); for(i=0; i'); } } // Write container newWin.document.write('
'); // Write header newWin.document.write(''); newWin.document.write(''); newWin.document.write('

'); // Write body newWin.document.write(s); // Close container newWin.document.write('
'); newWin.document.close(); // Open print dialog of not netscape if(navigator.appName !== 'Netscape') { newWin.print(); } } else { alert("Could not find content area. Please contact webmaster."); } }