/*
 
This are the Javascript funcions for Abipecs.org.br

*/

// Funcao abre janela dos relatórios em Pop UP

function popup_rel(URL){

var popup_form = window.open(URL,'Relatorios', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700 height=550,top=30,left=0');
}



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 style=\"background:none;margin:50px;\">\n';
		html += '<h4>Impresso de www.abipecs.org.br</h4>';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Nao foi possivel encontrar a sessao printReady em seu 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("Desculpe-nos, infelizmente esta opcao esta disponivel apenas em browsers modernos.");
	}
}
