var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial(){
	if (document.getElementById != null){
		html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';
		html += '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">\n';
		html += '<head>\n<title>Agendalux.lu</title>\n<meta http-equiv="content-type" content="text/html;charset=utf-8"/>';
		html += '<link rel="stylesheet" href="./datas/css/agendalux.css" type="text/css"/></head>\n<body>';
		html += '<img src="./datas/im/version_print.gif" border="0" alt="" />';
		html += '<table width="635" border="0" cellspacing="0" cellpadding="0" summary=""><tr><td class="center">\n';
		
		var contenu = document.getElementById("contenu");
		if (contenu != null){
			html += '<br/>\n<div id="contenu">'+contenu.innerHTML+'</div>\n';
		}
		
		var footer = document.getElementById("footer");
		if (footer != null){
			html += '<br/><br/>\n<div id="footer">'+footer.innerHTML+'</div>\n';
		}
		
		html += '</td></tr></table>\n';
		html += '</body>\n</html>';
		
		var printWin = window.open("","printSpecial","width=652, height=650, menubar=1, toolbar=0, directories=0, scrollbars=1, resizable=0");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		
		if (gAutoPrint)
			printWin.print();
		//if (!window.opera)
			//printWin.close();
	}
	else{
		alert("Désolé, cette fonctionnalité ne fonctionne qu'avec les navigateurs modernes.");
	}
}