
// Print ready script used to create a page with content only
// html must have <div class="print_ready"> tags around content
function print_ready() {
	if (document.getElementById != null){
		var html = '<HTML>\n<HEAD>\n';
		if (document.getElementsByTagName != null){
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0){
				html += headTags[0].innerHTML;
			}
		}
		html += '<style type="text/css">body {background-color:#ffffff;}</style>';
		html += '\n</HE' + 'AD>\n<BODY><div align=\'left\'>\n';
		var printReadyElem = document.getElementById("print_ready");
		if (printReadyElem != null)	{
			html += printReadyElem.innerHTML;
		}else{
			alert("Could not find the print ready section in the HTML");
			return;
		}
		html += '\n</div></BO' + 'DY>\n</HT' + 'ML>';
		var printWin = window.open("","print_ready");
		printWin.document.open();
		printWin.document.write(html);		
	}else {
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}
