// prosys.js
// some utility functions for www.prosys.fi
// author: Tatu Paronen

function showNews(url) {
	new Ajax.Updater('scroll-content', url, {
      method: 'get',
	  encoding: 'iso-8859-1'
	});
}

function sortNumber(a,b) {
	return b - a;
}

function evenOutDivs() {
	divHeight = new Array();
	div1 = document.getElementById("d1");
	div2 = document.getElementById("d2");
	div3 = document.getElementById("d3");
	div4 = document.getElementById("d4");
	if (div1 != null && div2 != null && div3 != null && div4 != null) {
		divHeight[0] = div1.offsetHeight;
		divHeight[1] = div2.offsetHeight;
		divHeight[2] = div3.offsetHeight;
		divHeight[3] = div4.offsetHeight;
		divHeight.sort(sortNumber);
		maxHeight = divHeight[0];
		//alert(maxHeight);
		div1.style.height = maxHeight-25+"px";
		div2.style.height = maxHeight+"px";
		div3.style.height = maxHeight+"px";
		div4.style.height = maxHeight+"px";
	}
}

function changeBgImage(image, obj) {
	var element = obj;
	element.style.backgroundImage = "url("+image+")";
}


function init() {
	evenOutDivs();
}
