		var templateType = 'contentpage' //by default 'contentpage', in homepage.js it is set to 'homepage'
		var tableHeight = 0; 
		var bottomRowHeight = 0; 
		var sizearea8 = 0; 
		var sizearea7 = 0; 
		var sizearea9 = 0; 
		var sizearea3 = 0; 
		
		function doSize(booInit){
			try {
				doActualSize(booInit);
			} catch(e) {
			}
		}
		
		function doActualSize(booInit){
			
			if (booInit) {
				tableHeight = (document.getElementById('mainTable').offsetHeight); 
				bottomRowHeight = (document.getElementById('bottomRowContainer').offsetHeight); 
				sizearea8 = (document.getElementById('area8').offsetHeight); 
				sizearea7 = (document.getElementById('area7').offsetHeight); 
				sizearea9 = (document.getElementById('area9-10Table').offsetHeight); 
				sizearea3 = (document.getElementById('area3').offsetHeight); 
			
			}
			
			if (templateType == 'contentpage') 
				doSizeContentPage()
			
			if (templateType == 'homepage') 
				doSizeHomePage()
			
			if (templateType == 'homepage-alternative') 
				doSizeHomePageAlt()
			
		}

		function doSizeHomePage() {
			var oBottomRowcontainer = document.getElementById('bottomRowContainer');
			var newHeight = 0
			newHeight = (getWindowInnerHeight()-tableHeight+bottomRowHeight)			

			if (bottomRowHeight > 1 ) {
				//there is content present, so at least show this content
				if (newHeight < bottomRowHeight) {
					newHeight = bottomRowHeight
				}
			}
			
			
			if (newHeight < 0 ) {newHeight=0};
			
			if (newHeight == 0) {
				oBottomRowcontainer.style.height= '0px';
				oBottomRowcontainer.style.visibility= 'hidden';
			} else {
				oBottomRowcontainer.style.height = (newHeight) + 'px';
				oBottomRowcontainer.style.visibility= 'visible';
				document.getElementById('area11').style.height =  (newHeight) + 'px';
			}

		}

		
		function doSizeContentPage() {
			var emptySpace = (getWindowInnerHeight()-tableHeight)
			
			
			if (emptySpace < 0 ) {emptySpace=0};

			
			var leftColumnHeight = (sizearea3 + sizearea7)
			var rightColumnHeight = (sizearea8 + sizearea9)
			
			
			
			
			if (leftColumnHeight > rightColumnHeight) {
				//left column is larger
				document.getElementById('area7').style.height= sizearea7+emptySpace + 'px';
				document.getElementById('area8').style.height = (leftColumnHeight-sizearea9) + emptySpace + 'px';
			} else {
				//right column is larger
				document.getElementById('area8').style.height= sizearea8+emptySpace + 'px';
				document.getElementById('area7').style.height = (rightColumnHeight-sizearea3) + emptySpace + 'px';
			}
			
		}

		function doSizeHomePageAlt() {
			/*
			Alternative way of scaling the homepage:
				the content area is not scaled, but area9-10Table 
			*/
			var emptySpace = (getWindowInnerHeight()-tableHeight)
			//return false
			if (emptySpace < 0 ) {emptySpace=0};
			
			
			var leftColumnHeight = (sizearea3 + sizearea7)
			var rightColumnHeight = (sizearea8 + sizearea9)
			
			if (leftColumnHeight > rightColumnHeight) {
				//left column is larger
				document.getElementById('area7').style.height= sizearea7+emptySpace + 'px';
				document.getElementById('area9-10Table').style.height = (leftColumnHeight-sizearea8) + emptySpace + 'px';
			} else {
				//right column is larger
				document.getElementById('area9-10Table').style.height= sizearea9+emptySpace + 'px';
				document.getElementById('area7').style.height = (rightColumnHeight-sizearea3) + emptySpace + 'px';
			}
			
		}

		function getWindowInnerHeight() {

			if (window.innerHeight != null) {
				// all except Explorer 
				return window.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) {
				// Explorer 6 Strict Mode 
				return document.documentElement.clientHeight;
			} else if (document.body) {
				// other Explorers 
				return document.body.clientHeight
			} 
			
			return (0);
		}




