function getOffsetHeight(id) {
	if(document.getElementById(id)!=null) {
		var div = document.getElementById(id);
		var height = 0;
		height+=$$("#"+id).getStyle("padding-bottom")[0].toInt();
		height+=$$("#"+id).getStyle("padding-top")[0].toInt();
		var div2 = $$("#"+id).getChildren();
		$each(div2, function(elem, index) {
			$each(elem, function(arr, index) {
				height+=arr.offsetHeight;
			});
		});
        return height;
	}
	else {
		return null;
	}
}

function adjustLayout() {
	//Obtain DIVS for height manipulation
	var divContentCenter = document.getElementById("content-content");
	var divContentLeft = document.getElementById("content-photo");
	var divContentRight = document.getElementById("content-alternate");
	
	//Obtain heights for DIV and WINDOWS
	var contentCenter = getOffsetHeight("content-content");
	var contentLeft = getOffsetHeight("content-photo");
	var contentRight = getOffsetHeight("content-alternate");
	var idealContentHeight = 0;
	if(contentCenter<contentLeft) {
		if(contentRight<contentLeft) {
			idealContentHeight = contentLeft;	
		}
		else {
			idealContentHeight = contentRight;	
		}
	}
	else {
		if(contentCenter>contentRight) {
			idealContentHeight = contentCenter;	
		}
		else {
			idealContentHeight = contentRight;	
		}
	}
	
	divContentCenter.style.height = (idealContentHeight+50) + 'px';
	divContentLeft.style.height = (idealContentHeight+60) + 'px';
	divContentRight.style.height = (idealContentHeight+50) + 'px';
}
/*
WatchFontSize
From http://forum.mootools.net/viewtopic.php?id=5785
*/
var WatchFontSize = {
	init : function(id){
		this.element = $$('#content-content p')[0];
		this.initSize = this.previousSize = this.element.getStyle('height').toInt();
		this.watch.periodical(200,this);
	},
	watch : function(){
		if(this.element.getStyle('height')){
		this.newSize = this.element.getStyle('height').toInt();
		}
		if(this.newSize != this.previousSize) this.changed();
	},
	changed : function(){
		adjustLayout();
		this.previousSize = this.newSize;
	}
}
window.addEvent('load', function() {
	adjustLayout();
});
window.addEvent('load',WatchFontSize.init.pass('content-photo p',WatchFontSize));	