﻿function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

function resizeContent()
{
    var content = document.getElementById('content');
    var navigation = document.getElementById('navigation');
    var extra = document.getElementById('extra');
    
    if (navigation.offsetHeight > content.offsetHeight)
    {
        content.style.height = navigation.offsetHeight.toString() + 'px';
    }
    if (extra.offsetHeight > content.offsetHeight)
    {
        content.style.height = extra.offsetHeight.toString() + 'px';
    }
}

addLoadEvent(resizeContent);