//Defines the funtion that gets the window height
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;
}

//Defines the funtion that gets the window width
function getWindowWidth() {
var windowWidth=0;
if (typeof(window.innerWidth)=='number') {
windowWidth=window.innerWidth;
}
else {
if (document.documentElement&&
document.documentElement.clientWidth) {
windowWidth=document.documentElement.clientWidth;
}
else {
if (document.body&&document.body.clientWidth) {
windowWidth=document.body.clientWidth;
}
}
}
return windowWidth;
}

//Defines the function that sets the heights of the content element
function setSize()
{
	if (document.getElementById)
	{
		var tallElements = new Array(document.getElementById('leftbar'));
		var maxHeight = 0;
		var maxWidth = 0;
		var windowHeight = getWindowHeight();
		var windowWidth = getWindowWidth();
		var contentTop = document.getElementById('content').offsetTop;
		var contentHeight = document.getElementById('content').offsetHeight;
		maxHeight = contentHeight + contentTop;
		if (getWindowHeight() > maxHeight) {
			maxHeight = getWindowHeight();
		}
		tallElements[0].style.height = maxHeight + 'px';
	}
	if (document.getElementById)
	{
		var wideElements = new Array(document.getElementById('topbar'));
		var maxHeight = 0;
		var maxWidth = 0;
		var windowHeight = getWindowHeight();
		var windowWidth = getWindowWidth();
		maxWidth = getWindowWidth();
		wideElements[0].style.width = maxWidth + 'px';
	}
}

//Call the necessary functions
window.onload = function() {
setSize();
}

window.onresize = function() {
setSize();
}
