/*########################################################################*\

	Developed by 		: © Maximum
	Version				: 1.0.0
	Creation Date		: 2/7/06
	Modification Date	: 2/7/06
	Creation by			: Jerry van Heerikhuize
	Modification by		: Jerry van Heerikhuize
	Description			: Print function
	File				: print.js
	ID					: 9931711E-3689-4EC3-AC00-E139D163636B

\*########################################################################*/

printarea = function() {
	
	/* set popheight and width */
	var popup_height = 500;
	var popup_width = 700;
	var w = window.open('','','height=' + popup_height + ',width=' + popup_width + ',toolbar=yes,scrollbars=yes')
	
	/* Center popup window */
	var intwidt;
	var intheight;

	intwidth = screen.availWidth;
	intheight = screen.availHeight;
	intwidth = parseInt (intwidth);
	intheight = parseInt (intheight);

	if (intwidth > 0 && intheight > 0){
		w.moveTo ( ( ( intwidth-popup_width ) / 2 ), ( ( intheight - popup_height ) / 2) );
		w.focus();
	}
		
	var printarea = document.getElementById("printarea");
	

	if (printarea == null) {
		
		alert("no print area defined");

	} else {
				
		w.document.open();
				
		w.document.write('<html>\n');
		w.document.write('<head>\n');
		w.document.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n');
		w.document.write('	<title>print</title>');
		w.document.write('</head>\n');
		w.document.write('<body onload="window.print();setTimeout(\'window.close()\', 5000);">\n');
		w.document.write('  	<div id="p-article">' + printarea.innerHTML+'</div>\n');
		w.document.write('</body></html>\n');
		
		w.document.close();

	}
	
};