﻿/* make content and sidebar div the same height */
function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function') { 
		window.onload = func; 
	} else { 
		window.onload = function() { 
			if (oldonload) { 
				oldonload(); 
			} 
			func(); 
		} 
	} 
} 

function setDivHeights(divName1,divName2) {
    var div1 = document.getElementById(divName1);
    if(div1 == null)
        return;
    
    var div2 = document.getElementById(divName2);
    if(div2 == null)
        return;
        
	if (document.all) {
		var iLeftHeight = document.getElementById(divName1).offsetHeight;
		var iRightHeight = document.getElementById(divName2).offsetHeight;
	}
	else {
		var iLeftHeight = document.getElementById(divName1).clientHeight;
		var iRightHeight = document.getElementById(divName2).clientHeight;
	}
	if(iRightHeight > iLeftHeight)
    	document.getElementById(divName1).style.height = iRightHeight;
    else
        document.getElementById(divName2).style.height = iLeftHeight;
}

function balanceSidebarContent(){
    
	setDivHeights("sidebar","content");   
}


addLoadEvent(balanceSidebarContent);
