// JavaScript Document

var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial()
{
	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';
		
		var printReadyElem = document.getElementById("global");
		
		//var printTitleElem = document.getElementById("printTitle");
		
		var printHeader = "<table width='750'><tr><td valign='top' align='right'><img border='0' src='imagens/banners/logoimprimir.png'><br><font color='#999999' size='1' face='Calibri'><strong>fechar</strong></font></div><a href='javascript:window.close()' title='Fechar'><img border='0' src='imagens/logos/fechar.png'></a></td></tr></table><br>";
		//var printFooter = "<br><img src='/img_base/rodape_print.jpg'>";
		var printInterv ="<br><img src='imagens/logos/fnd_2.gif'><br><br>";
		
		if (printReadyElem != null)//,printTitleElem != null)
		{
				html += printHeader;
				//html += printTitleElem.innerHTML;
				//html += printInterv;
				html += printReadyElem.innerHTML;
				//html += printFooter;
		}
		else
		{
			alert("Could not find the printReady or printTitle section in the HTML");
			return;
		}
			
		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("A função de impressão só está disponível em browsers modernos");
	}
}

