// Automatic height adjuster
// copyright by Danny Rawlins, romster at shortcircuit dot net dot au
// revision 5

// example to autoadjust 3 div's
// <body onload="adjustHeight(['menu-left','content','menu-right'])">

if (!document.getElementById) {
	if (document.all) {
		document.getElementById = function() {
			if (typeof document.all[arguments[0]] != "undefined") {
				return document.all[arguments[0]];
			}
			else {
				return null;
			}
		}
	}
	else if (document.layers) {
		document.getElementById = function() {
			if (typeof document[arguments[0]] != "undefined") {
				return document[arguments[0]];
			}
			else {
				return null;
			}
  		}
	}
}

var ids = [];
var height = 0;

function setHeight(ids,height) {
	var i = 0;
	for (i in ids) {
		document.getElementById(ids[i]).style.height = height;
	}
}

function adjustHeight(ids) {
	var a = [];
	var i = 0;
	for (i in ids) {
		docObj = document.getElementById(ids[i]);
		x = document.defaultView.getComputedStyle(docObj, '').getPropertyValue('height');
		a[i] = x.replace(/px/,'');
	}
	b = a[0];
	c = 0;
	while(c < a.length) {
		b = Math.max(b,a[c]);
		c++;
	}
	setHeight(ids,b + 'px');
}


