function onLoadHandler() {
	//jsVarResizeWindow = window.name.toString().toLowerCase().indexOf("survey") < 0; //not when window.open
	if(1 == jsVarPageNum) {
		var ignoreRePosition = false;

		var myW = window.outerWidth;
		var myH = window.outerHeight;
		if(myW == undefined || myW == null || myW < 1) {
			myW = document.body.clientWidth;
			myH = document.body.clientHeight + 100;
		}
		if(myW == undefined || myW == null || myW < 1) {
			myW = window.innerWidth + 20;
			myH = window.innerHeight + 100;
		}
		
		var scrW = screen.availWidth;
		var scrH = screen.availHeight;
		if(scrW == undefined || scrW == null || scrW < 1) {
			scrW = screen.width;
			scrH = screen.height;
		}

		if(jsVarWindowSize.indexOf("x") > 0) {
			myW = jsVarWindowSize.substring(0, jsVarWindowSize.indexOf("x"));
			myH = jsVarWindowSize.substring(jsVarWindowSize.indexOf("x") + 1);
			if(myW.indexOf("%") > 0) {
				myW = scrW * parseInt(myW.substring(0, myW.length - 1)) / 100;
			}
			if(myH.indexOf("%") > 0) {
				myH = scrH * parseInt(myH.substring(0, myH.length - 1)) / 100;
			}
			window.self.resizeTo(myW,myH);
			if(self.innerWidth != "undefined" && self.innerWidth >= myW) {
				self.resizeTo(self.innerWidth-(self.outerWidth-self.innerWidth), self.innerHeight-(self.outerHeight-self.innerHeight));
			}
		} else if(jsVarWindowSize == "fullscreen") {
			window.self.moveTo(0, 0);
			window.self.resizeTo(scrW, scrH);
			ignoreRePosition = true;
		}

		if(!ignoreRePosition) {
			if(jsVarWindowPosition.indexOf("x") > 0) {
				var myX = jsVarWindowPosition.substring(0, jsVarWindowPosition.indexOf("x"));
				var myY = jsVarWindowPosition.substring(jsVarWindowPosition.indexOf("x") + 1);
				if(myX.indexOf("%") > 0) {
					myX = ((scrW-myW) * parseInt(myX.substring(0, myX.length - 1)) / 100);
				}
				if(myY.indexOf("%") > 0) {
					myY = ((scrH-myH) * parseInt(myY.substring(0, myY.length - 1)) / 100);
				}
				if(myX < 0) myX = 0;
				if(myY < 0) myY = 0;
				if(myX > (scrW - myW)) myX = (scrW - myW);
				if(myY > (scrH - myH)) myY = (scrH - myH);
				window.self.moveTo(myX, myY);
			} else if(jsVarWindowPosition == "center") {
				if(scrW > 0 && scrH > 0) {
					window.self.moveTo(scrW/2 - myW/2, scrH/2 - myH/2);
				}
			}
		}
		if(document.getElementById("UserIdTextBox") != null) {
			document.getElementById("UserIdTextBox").select();
		}
	}

	if(jsVarShowRequired) {
		alert(jsVarRequiredText);
	}

	if(document.Form1 != null && document.Form1.ResWidth != null) {
		document.Form1.ResWidth.value  = screen.width;
		document.Form1.ResHeight.value = screen.height;
	}

	//try {
		// NOTE: This was a request from a customer, because the back-button had default focus.
		// The side-effect however is, that long pages starts scrolled down, because the focus scrolls the button into view !!!
		//document.getElementById("NextAndSendButton").focus();
	//} catch(ex) {}
}; //end function onLoadHandler()

function printPage() {
	var oldMainAreaWidth = document.getElementById("MainAreaTable").width;

	document.getElementById("topRow").style.display = "none";
	document.getElementById("bottomRow").style.display = "none";
	document.getElementById("MainAreaTable").width = "100%";
	document.getElementById("MainTable").style.height = "99%";
	document.getElementById("AnswerOverviewHeader").style.display = "";
	
	window.print();
	
	document.getElementById("topRow").style.display = "";
	document.getElementById("bottomRow").style.display = "";
	document.getElementById("MainAreaTable").width = oldMainAreaWidth;
	document.getElementById("MainTable").style.height = "100%";
	document.getElementById("AnswerOverviewHeader").style.display = "none";
	
	//return false; //prevent FireFox from sending form
}


