/*
	Autore: Andrea Barducci
	Script: print.js
	Applicazione: Framework
	Versione: 1.00
	Data: 10/08/2009
	Scopo: Funzioni per la stampa
	Copyright (c) 2009 CicoNET di Danilo Cicognani
*/

function PrintPage(pageUrl)
{
	iframeid = 'ifr' + i++;

	strHTML = '<iframe id="' + iframeid + '" name="' + iframeid + '" src="' + pageUrl + '" class="print';
	if($.browser.msie)
		strHTML += 'IE';
	strHTML += '"></iframe>';

	$(strHTML).bind( "load", function(event) { 
		event.target.contentWindow.focus();
		event.target.contentWindow.print();
		//non si puo' rimuovere in firefox perche' al comando print() non si ferma quindi se il doc e' lungo lo elimina prima che sia stampato
		//$("#" + iframeid).remove();
		})
	.appendTo( document.body ); 
}
