// JavaScript Document

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}


function setheight() {
    
	
    var windowHeight = getWindowHeight() - 220;
    var centerRightHeight = document.getElementById('rightColumn').clientHeight;
    var centerLeftHeight =  document.getElementById('leftColumn').clientHeight;

    if ( centerLeftHeight > windowHeight ) {
        if ( centerLeftHeight > centerRightHeight ) {
            document.getElementById('rightColumn').style.height = centerLeftHeight + "px";
        } else {
            document.getElementById('leftColumn').style.height = centerRightHeight + "px";
        }
    } else if ( centerRightHeight > windowHeight ) {
        if ( centerRightHeight > centerLeftHeight ) {
            document.getElementById('leftColumn').style.height = centerRightHeight + "px";
        } else {
            document.getElementById('rightColumn').style.height = centerLeftHeight + "px";
        }
    } else if ( windowHeight > centerRightHeight ) {
		document.getElementById('leftColumn').style.height = windowHeight + "px";
		document.getElementById('rightColumn').style.height = windowHeight + "px";
    } else if ( centerRightHeight > centerLeftHeight ) {
		document.getElementById('leftColumn').style.height = centerRightHeight + "px";
    } else {
                document.getElementById('rightColumn').style.height = centerLeftHeight + "px";
    } 
	

}

window.onload = function() {
	setheight();
}
window.onresize = function() {
	setheight();
}
