var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printOffer(title)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n</HEAD>\n<BODY>\n';
			html += '<img src="/images/boutons/back.gif" align="left" border="0" alt="Back" style="cursor:hand" '+'onClick="javascript:window.close()">';
			html += '<br><center><H1>'
			html += title 
			html += '</H1><center><br>'

			var printId = document.getElementById("detail");
			if (printId != null)
			{
				html += printId.innerHTML;
			}
		html += '<img src="/images/boutons/back.gif" align="left" border="0" alt="Back" style="cursor:hand" '+'onClick="javascript:window.close()">';
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';


		var printWin = window.open(); //= window.open("","Adecco.ch Work details");
			printWin.document.open();
			printWin.document.write(html);
			printWin.document.close();
			if (gAutoPrint)
				printWin.print();


//		if (document.getElementsByTagName != null){}
	}
	else
	{
		alert("Sorry, the print feature is only available in modern browsers.");
	}
}
