
function setHeights1() {
	function setColHeight(colHeight){
		document.getElementById("column1").style.height=colHeight+"px";
		document.getElementById("column2").style.height=colHeight+"px";
		document.getElementById("column3").style.height=colHeight+"px";
	}
	col1=document.getElementById("column1");
	col2=document.getElementById("column2");
	col3=document.getElementById("column3");
	cLeft=document.getElementById("contentleft");
	cMain=document.getElementById("contentmain");
	cMain1=document.getElementById("main1");
	bSpace=document.getElementById("b1space");

	colHeight=Math.max(col1.offsetHeight,col2.offsetHeight,col3.offsetHeight);
	setColHeight(colHeight);

	height1 = cLeft.offsetHeight-(cMain.offsetHeight-cMain1.offsetHeight);
	height2 = cMain1.offsetHeight;
	if(height1>height2) {
		setColHeight(height1-34);
	}
	else if(height2>height1-7)
	{
		bSpace.style.display="block";
		bSpace.style.height=height2-height1-7+"px";
	}
}

function setHeights2(){
	cLeft=document.getElementById("contentleft");
	cMain=document.getElementById("contentmain");
	cMain1=document.getElementById("main2");
	bSpace=document.getElementById("b1space");

	height1 = cLeft.offsetHeight-(cMain.offsetHeight-cMain1.offsetHeight);
	height2 = cMain1.offsetHeight;
	if(height1>height2) {
		cMain1.style.height=height1-37+"px";
	}
	else if(height2>height1-7)
	{
		//bSpace.style.display="block";
		bSpace.style.height=height2-height1-7+"px";
	}
}

function setHeights3() {
	function setColHeight(colHeight){
		document.getElementById("main3left").style.height=colHeight+"px";
		document.getElementById("main3right").style.height=colHeight+40+"px";
	}
	col1=document.getElementById("main3left");
	col2=document.getElementById("main3right");
	cLeft=document.getElementById("contentleft");
	cMain=document.getElementById("contentmain");
	cMain1=document.getElementById("main3");
	bSpace=document.getElementById("b1space");

	colHeight=Math.max(col1.offsetHeight,col2.offsetHeight);
	setColHeight(colHeight);

	height1 = cLeft.offsetHeight-(cMain.offsetHeight-cMain1.offsetHeight);
	height2 = cMain1.offsetHeight;
	if(height1>height2) {
		setColHeight(height1-37);
	}
	else if(height2>height1-7)
	{
		bSpace.style.display="block";
		bSpace.style.height=height2-height1-7+"px";
	}
}

if(document.getElementById("contentmain")&&document.getElementById("contentleft")&&document.getElementById("main1")&&document.getElementById("column1")&&document.getElementById("column2")&&document.getElementById("column3")) {
	setHeights1();
}
else if(document.getElementById("contentmain")&&document.getElementById("contentleft")&&document.getElementById("main2")&&!document.getElementById("main3")) {
	setHeights2();
}
else if(document.getElementById("contentmain")&&document.getElementById("contentleft")&&document.getElementById("main3")&&document.getElementById("main3left")&&document.getElementById("main3right")) {
	setHeights3();
}
