function setNavigationHeight() {
var maincontent = jq("#portal-content-wrapper");
var navportlet = jq("dl.portletNavigationTree");
var tabcontent = jq("#content-below-l4tabs");
var tabs = jq(".npcmview-tabs");
var columnone = jq("#portal-column-one .visualPadding");
if (tabcontent.length != 0) {
	var totalheight = tabcontent.height() + tabs.height() + 3;
	if (totalheight > navportlet.height() + 7) {
		navportlet.height(totalheight - 7);
                columnone.height(totalheight);
	}
	else {
		tabcontent.height(navportlet.height() - tabs.height() - 3);
	}
}
else {
	if (maincontent.height() > navportlet.height()) {
		var paddingtop = parseInt(navportlet.css("padding-top"), 10);
		var bwidthtop = parseInt(navportlet.css("border-top-width"), 10);
		var bwidthbot = parseInt(navportlet.css("border-bottom-width"), 10);
		navportlet.height(maincontent.height() - paddingtop);
                columnone.height(maincontent.height() + paddingtop);
	}
	else if (maincontent.height() < navportlet.height())
		maincontent.height(navportlet.height());
	}
}

//window.onload=setNavigationHeight;
//jq(document).ready(setNavigationHeight);
jq(window).load(setNavigationHeight);
