

function setTall() {

	//first set equal heights for content div tags

	var c = new getObj('centercolumn1');
	var r = new getObj('rightcolumn1');
	var l = new getObj('leftcolumn1');

	//var divs = new Array(document.getElementById('centercolumn1'), document.getElementById('rightcolumn1'), document.getElementById('leftcolumn1'));
	var divs = new Array(c.obj, r.obj, l.obj);

	// Let's determine the maximum height out of all columns specified
	var maxHeight = 0;
	for (var i = 0; i < divs.length; i++) {
		if (divs[i].offsetHeight > maxHeight) maxHeight = divs[i].offsetHeight;
	}



	// Let's set all columns to that maximum height
	for (i = 0; i < divs.length; i++) {
		divs[i].style.height = maxHeight + 'px';
		// Now, if the browser's in standards-compliant mode, the height property
		// sets the height excluding padding, so we figure the padding out by subtracting the
		// old maxHeight from the new offsetHeight, and compensate!  So it works in Safari AND in IE 5.x
		if (divs[i].offsetHeight > maxHeight) {
			divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
		}
	}

	//find the wrappers

	var windowheight = getHeight();
	var f = new getObj('wrapper1');
	var f2 = new getObj('wrapper2');

	//adjust wrapper1, the outer wrap
	if (navigator.userAgent.indexOf("MSIE") == -1) {
		//this triggers with non-IE
		f.style.height = (maxHeight + 170) + 'px';  //sisältöelementtien korkeus maxHeight + header/navi/footer/yht + 13px jotakin, what? padding?
		} else {
		//and this is for IE
		f.style.height = (maxHeight + 173) + 'px';  //samaan tapaan kuin non-IE, mutta tulkitsevat korkeuslukuja erilailla...
	}

	//adjust wrapper2, the inner wrap
	if (navigator.userAgent.indexOf("MSIE") == -1) {
		//this triggers with non-IE
		f2.style.height = (maxHeight + 166) + 'px'; //vähennä 3px f lukemasta
		} else {
		//and this is for IE
		f2.style.height = (maxHeight + 170) + 'px'; //vähennä 3px f lukemasta
	}


	//onko sisältö on matalampi kuin ruudun korkeus?
	//säädä footer paikka ja wrapperien alareunat
	if (f.obj.offsetHeight < windowheight)	{

		//haetaan viitteet div tageihin
		var n =  new getObj('navbar1');
		var b =  new getObj('logobkg1');
		var fff = new getObj('footer1');
		var rcol = new getObj('rightcolumn1');
		var lcol = new getObj('leftcolumn1');

		// calculate cumulative height
		var yht = lcol.obj.offsetHeight + n.obj.offsetHeight + b.obj.offsetHeight + fff.obj.offsetHeight;
//alert('leftcolumn height: ' + lcol.obj.offsetHeight);
		//säädetään
		if (navigator.userAgent.indexOf("MSIE") == -1) {
			//for non-IE
			m.style.height = (windowheight-adjustheight) + 'px';
			f.style.height = (windowheight-18) + 'px';
			f2.style.height = (windowheight-20) + 'px';
			//ylläolevilla säädetään footerin ja wrapperien alareunan paikkaa
			//m on piilossa oleva middlecolumn, se tönii footerin kohdalleen
			//f ja f2 on wrapperit, laita sopiva erotus,
			//f2 on sisempi wrapper ja näyttää kehyksen
			//entä jäävätkö left ja right taustat liian mataliksi?
			if (yht < windowheight) {
				rcol.style.height = (windowheight - (n.obj.offsetHeight + b.obj.offsetHeight + fff.obj.offsetHeight + 38)) + 'px';
				lcol.style.height = (windowheight - (n.obj.offsetHeight + b.obj.offsetHeight + fff.obj.offsetHeight + 38)) + 'px';
				//pienennä viimeisiä lukuja; left ja right column alareuna putoaa
			}
			} else {
			//for IE
			m.style.height = (windowheight-adjustheight) + 'px';
			f.style.height = (windowheight-2) + 'px';
			f2.style.height = (windowheight-2) + 'px';
			//ylläolevilla säädetään footerin ja wrapperien alareunan paikkaa
			//m on piilossa oleva middlecolumn, se tönii footerin kohdalleen
			//f ja f2 on wrapperit, laita sopiva erotus,
			//f2 on sisempi wrapper ja näyttää kehyksen
			//entä jäävätkö left ja right taustat liian mataliksi?
			if (yht < windowheight) {
				rcol.style.height = (windowheight - (n.obj.offsetHeight + b.obj.offsetHeight + fff.obj.offsetHeight + 6)) + 'px';
				lcol.style.height = (windowheight - (n.obj.offsetHeight + b.obj.offsetHeight + fff.obj.offsetHeight + 6)) + 'px';
				//pienennä viimeisiä lukuja; left ja right column alareuna putoaa
			}
		}
	}
}

window.onload = function() {

	//liittyen document.body, document.documentElement mittoihin, testi
	//body_and_documentElement_debug_writeroot.js
	//createTable();

	setTall();
}

window.onresize = function() {
	setTall();
}
