function getObject(objectId)
{
	if (document.all && !document.getElementById)
		return document.all(objectId);
	else
		return document.getElementById(objectId);
}

function printAndShowPreview()
{
//	DA: IE bug - cannot change input type in runtime. Breaks whole method;
//	getObject("exitPPBtn").type = "button";
//	getObject("printBtn").type = "button";
//	getObject("exitPPBtn").setAttribute("type","button");
//	getObject("printBtn").setAttribute("type","button");

	getObject("screenCss").disabled = true; 
	
	var newCssLink = document.createElement("link");
	newCssLink.href = "files/gasOilPrintPreview.css";
	newCssLink.rel = "stylesheet";
	newCssLink.type = "text/css";
	newCssLink.media = "screen";
	document.body.appendChild(newCssLink);
	print();
	showButtons();
}
function previewOnly()
{
	getObject("screenCss").disabled = true; 
	var newCssLink = document.createElement("link");
	newCssLink.href = "files/gasOilPrintPreview.css";
	newCssLink.rel = "stylesheet";
	newCssLink.type = "text/css";
	newCssLink.media = "screen";
	document.body.appendChild(newCssLink);
	showButtons();
}
function printNoCSS()
{
	getObject("screenCss").disabled = true; 
	print();
	showButtons();
}
function showButtons()
{
	//Works, but button is printed anyway
	getObject('printPreviewFooter').innerHTML = 'If this page contains photographs and text, or text only, it is optimized for you to <strong>Print this page</strong> directly.<br />If you are trying to print a large diagram, please <strong>Exit print preview</strong> and use <strong>Printable PDF (Recommended)</strong>.<br /><br /><input id="printBtn" type="button" value="Print this page" onclick="print();" /><input id="exitPPBtn" type="button" value="Exit print preview" onclick="history.go(0);" />';
}

