//Javascript
//Common Functions
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function evenColumns()
{
	var sideBar = document.getElementById("sideBar");
	var pageBody = document.getElementById("pageBody");
	var sideBarHeight = (sideBar != null) ? sideBar.offsetHeight : 0;
	var pageBodyHeight = (pageBody != null) ? pageBody.offsetHeight : 0;
	
	// see which is taller. also have to subtract the padding from the height
	if(sideBarHeight > pageBodyHeight)
		pageBody.style.height = sideBarHeight - 40 + "px";
	else if(sideBarHeight < pageBodyHeight)
		sideBar.style.height = pageBodyHeight - 25 + "px";
}

addLoadEvent(evenColumns);