// Magic Footer for John G. Wilson

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;
}

//Space above Left is 166px
//Space above Right is 269px

function newDivs() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var leftHeight = document.getElementById('left').offsetHeight;
		var righHeight = document.getElementById('righ').offsetHeight;
		if (windowHeight > 0) {
			var backgroundElement = document.getElementById('background');
			if ((leftHeight + 166) || (righHeight + 269) > windowHeight) {
				if ((leftHeight + 166) > (righHeight + 269) ) {
					backgroundElement.style.height = (leftHeight + 206) + 'px';
				} else {
					backgroundElement.style.height = (righHeight + 309) + 'px';
				}
			} else {
				backgroundElement.style.height = (1000) + 'px';
			}
		}
	}
}