var gAutoPrint = true; // Flag for whether or not to automatically call the print function

//  'Purpose			- Loads a printable version of the web page
//	'Inputs				- booRemoveLinks: set to 'Y' if you want hyperlinks to be removed from the printout
//	'Programmer Name	- DF
//	'Date				- 06/06/2004

function printSpecial(booRemoveLinks)
{
	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 += '\n</HE' + 'AD>\n<BODY>\n';

		html += "<div>"
		var bannerTags = document.getElementById("banner");
		html += "<img src='" + bannerTags.src + "_print.gif'  width='725' height='100' border='0'>";
//		html += "<img src='" + bannerTags.src + "'  width='725' height='100' border='0'>";
		html += '</div>'

		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '<script>';
//		html += '	document.getElementById("printLink").innerText = "";';

		html +=		"	var HrefTags = document.links.length; "
		html +=		"	for(var i=0; i<HrefTags; i++) "
		html +=		"	{	"
	
		//remove all links from print out
		if (booRemoveLinks == "Y") // remove all hyperlinks from the printed page.
		{
			html +=		"		document.links[i].innerText = '';	"
		}
		else // close window when hyperlink clicked on.
		{	
			html +=		"		document.links[i].href = 'javascript:window.close();';	"
		}
			
		html +=		"	};	"
		html += '</script>';	
		
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

