Event.observe(window, 'load', setHeight);
Event.observe(window, 'resize', setHeight);

function getWindowHeight() {
    var height =
		document.documentElement && document.documentElement.clientHeight ||
		document.body && document.body.clientHeight ||
  		document.body && document.body.parentNode && document.body.parentNode.clientHeight ||
  		0;  		
  	return height;
}

function getBodyHeight(){
	if (window.innerHeight && window.scrollMaxY) {
		yWithScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		yWithScroll = document.body.scrollHeight;
	} else {
		yWithScroll = document.body.offsetHeight;
  	}
	return yWithScroll;
}

function setHeight() {	
	if (getBodyHeight() > getWindowHeight()) {
		$('content-wrapper').style.height = getBodyHeight() - 459 + 'px';
	} else {
		$('content-wrapper').style.height = getWindowHeight() - 459 + 'px';	
	}	
}