

function switch_borderbox()	{
	var bb = document.getElementById("via-borderbox");
	if (bb.style.display=="none")	{
		bb.style.display = "block";
	} else	{
		bb.style.display = "none";
	}
}

/*
function debug(obj)	{
	var str = "";
	var c = 0;
	for (var i in obj)	{
		str += "obj["+i+"] = "+obj[i]+"\n";
		if (!((++c)%8))	{
			alert(str);
			str = "";
			c = 0;
		}
	}
	alert(str);
}
*/

var isff = 0;
var sleep = 1;

function align_boxes()	{
	var co = document.getElementById("main-content-left");
	var boxes = Array();
	var boxcnt = 0;
	if ((navigator.appName.indexOf("Netscape")!=-1)||(navigator.userAgent.indexOf("Opera")!=-1))	{
		isff = 1;
	}
	for (var i in co["childNodes"])	{
		if ((co["childNodes"][i].className=="content-col-small")||(co["childNodes"][i].className=="content-col-two"))	{
			var col = co["childNodes"][i];
			for (var j in col["childNodes"])	{
				if (	(col["childNodes"][j].className=="news-latest-container")
						|| (col["childNodes"][j].className=="tx-sriframe-pi1")
						|| (col["childNodes"][j].className=="tx-skcalendar-pi1")
						)	{
					boxes[boxcnt++] = col["childNodes"][j];
				}
			}
		}
	}
	var maxoffset = 0;
	var maxheight = 0;
	for (var i in boxes)	{
		if (boxes[i].offsetTop>maxoffset)	{
//			debug(boxes[i]);
//			return;
			maxoffset = boxes[i].offsetTop;
		}
		if (boxes[i].offsetHeight>maxheight)	{
			maxheight = boxes[i].offsetHeight;
		}
	}
	for (var i in boxes)	{
		if (boxes[i].offsetTop<maxoffset)	{
			boxes[i].style.marginTop = maxoffset-boxes[i].offsetTop+"px";
		}
		if (boxes[i].clientHeight<maxheight)	{
			if ((boxes[i].className=="news-latest-container"))	{
				boxes[i].style.height = (maxheight-(30*isff))+"px";
			}
			if ((boxes[i].className=="tx-sriframe-pi1"))	{
				boxes[i].style.height = maxheight+"px";
				for (var j in boxes[i]["childNodes"])	{
					if (boxes[i]["childNodes"][j].className && (boxes[i]["childNodes"][j].className.match(/pegel-box/)))	{
						boxes[i]["childNodes"][j].style.height = (maxheight-(25*isff))+"px";
					}
				}
			}
			if (boxes[i].className=="tx-skcalendar-pi1")	{
//				boxes[i].style.height = maxheight+"px";
				for (var j in boxes[i]["childNodes"])	{
					if (boxes[i]["childNodes"][j].className=="calendar-latest-container")	{
						boxes[i]["childNodes"][j].style.height = (maxheight-(30*isff))+"px";
					}
				}
			}
		}
	}


}

