prevWidth = 0;

function beforePrinting() {
	// Handling der Browserbreite
	o = document.getElementById("ResizeContainer");
	o.style.width = "auto";
	// Handling der FormHints
	var allDivs = new Array();
	allDivs = document.getElementsByTagName('div');
	for (var i = 0; i < allDivs.length; i++) {
		if (allDivs[i].className == 'FormHint') {
			allDivs[i].style.display = 'block';
			allDivs[i].style.visibility = 'visible';
			allDivs[i].style.position = 'relative';
			allDivs[i].style.left = '';
			allDivs[i].style.top = '';
		}
	}
}

function afterPrinting() {
	// Handling der Browserbreite
	restoreWidth;
	// Handling der FormHints
	var allDivs = new Array();
	allDivs = document.getElementsByTagName('div');
	for (var i = 0; i < allDivs.length; i++) {
		if (allDivs[i].className == 'FormHint') {
			allDivs[i].style.visibility = 'hidden';
			allDivs[i].style.position = 'absolute';
			allDivs[i].style.display = 'none';
		}
	}
}

function restoreWidth() {
	o = document.getElementById("ResizeContainer");
//	o.style.width = prevWidth;
	o.style.width = (d = document)
				&& (fs = d.getElementById('CalibrationDiv').offsetWidth)
				&& (po = 2 * fs)
				&& (bo = 3)
				&& (min = 790 * fs)
				&& (max = 1149 * fs)
				&& (cw = d.body.clientWidth)
				&& (px = 'px')
				&& (cw - po >= max + bo ? max + px : cw - po <= min + bo ? min + px : 'auto')
}

window.onbeforeprint = beforePrinting;
window.onafterprint = afterPrinting;
window.onresize = restoreWidth;