﻿function allocateSidebarHeight() {

	var contentDom = document.getElementById("contentCol");

/*
	var promoBottomMargin=16;
	var promoDom = document.getElementById("promo");
	var navDom = document.getElementById("navigation");
	if(contentDom != null && navDom != null){
		var promoHeight=0;
		if(promoDom!=null){promoHeight = promoDom.offsetHeight + promoBottomMargin;}
		var differenceInHeight=contentDom.offsetHeight - navDom.offsetHeight - promoHeight;
		if(differenceInHeight > 0) {navDom.style.height = (navDom.offsetHeight + differenceInHeight)+"px";}
	}
*/
	/* Adjust height for far-right content column on subpage */
	var rightCol2BottomMargin=0;
	var rightCol2Dom = document.getElementById("subpageRightCol");
	if(contentDom != null && rightCol2Dom != null){
		var differenceInHeight=contentDom.offsetHeight - rightCol2Dom.offsetHeight - rightCol2BottomMargin;
		if(differenceInHeight > 0) {rightCol2Dom.style.height = (rightCol2Dom.offsetHeight + differenceInHeight)+"px";}
	}
}

window.onload=function() {allocateSidebarHeight();}
