

var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printFriendly()

{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD><link href=Style-print.css rel=stylesheet media=all type=text/css>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=350 valign="top"><a href=index.php><img src=images/logo-print.jpg width=417 height=134 border=0></a></td><td><div align=right><p><font face=Arial, Verdana, helvetica, sans-serif size=2><br>1040 North Kings Highway, Suite 200<br>Cherry Hill, New Jersey 08034<br>Telephone (800) 790-1550 <br>www.heggelaw.com</p></p></div></td></tr></table>\n';

		
		var printPageElem = document.getElementById("printFriendly");
		
		if (printPageElem != null)
		{
				html += "<link href=Style-print.css rel=stylesheet media=all type=text/css>";
				html += printPageElem.innerHTML;
		}
		else
		{
			alert("Could not find the printFriendly section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printFriendly");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the printer friendly feature works\nonly in javascript enabled browsers.");
	}
}

