var curWindowHeight;
var curWindowWidth;

		function getWindowWidth() {
			var windowWidth = 0;
			if (typeof(window.innerWidth) == 'number') {
				windowWidth = window.innerWidth;
			}
			else {
				if (document.documentElement && document.documentElement.clientWidth) {
					windowWidth = document.documentElement.clientWidth;
				}
				else {
					if (document.body && document.body.clientWidth) {
						windowWidth = document.body.clientWidth;
					}
				}
			}
			return windowWidth;
		}
		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight= document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setWidth() {
			if (document.getElementById) {
				var windowWidth = getWindowWidth();
				curWindowWidth = windowWidth;
				var navigationElement = document.getElementById('navigation');
				var navigationWidth = navigationElement.offsetWidth;
				if (windowWidth > 0) {
					var containerElement = document.getElementById('container');
					if (windowWidth > 800) {
						containerElement.style.width = (windowWidth) + 'px';
					}
					else {
						containerElement.style.width = 800 + 'px';
					}
					var contentElement = document.getElementById('pagecontent');
					if (windowWidth - navigationWidth > 690) {
						contentElement.style.width = (windowWidth - navigationWidth) + 'px';
					}
					else {
						contentElement.style.width = 690 + 'px';
					}
					var bottomElement = document.getElementById('bottom');
					if (windowWidth - navigationWidth > 690) {
						bottomElement.style.width = (windowWidth - navigationWidth) + 'px';
					}
					else {
						bottomElement.style.width = 690 + 'px';
					}
				}
				var windowHeight = getWindowHeight();
				curWindowHeight = windowHeight;
				var mainmenuElement = document.getElementById('mainmenu');
				var mainmenuHeight = mainmenuElement.offsetHeight;
				var mainElement = document.getElementById('mainfake');
				var mainHeight = mainElement.offsetHeight;
/*				var mainwideElement = document.getElementById('mainwide');
				var mainwideHeight = mainwideElement.offsetHeight; */
				var maxHeight = 400;
				if (windowHeight > maxHeight) {
					maxHeight = windowHeight;
				}
				if (mainmenuHeight > maxHeight) {
					maxHeight = mainmenuHeight;
				}
				if (mainHeight > maxHeight) {
					maxHeight = mainHeight;
				}
/*				if (mainwideHeight > maxHeight) {
					maxHeight = mainwideHeight;
				} */
				containerElement.style.height = (maxHeight) + 'px';
				navigationElement.style.height = (maxHeight) + 'px';
				contentElement.style.height = (maxHeight - 3) + 'px';
				var vertbarElement = document.getElementById('vertbar');
				vertbarElement.style.height = (maxHeight - 3) + 'px';
			}
		}
		window.onload = function() {
			setWidth();
		}
		window.onresize = function() {
			setWidth();
		}
