// Magic Footer for North American Outdoor Fitness Company

// A legend to figure out the logic:
// div mid_interior - This is the key to positioning the other elements.  We need to obtain it's offset height (MIOH).
// div mid - Just need to dynamically change it's height.  MIOH + mid_interior.padding[19 on top and bottom = 38]
// div mid_footer - Needs to be positioned directly after the mid div.  mid_footer.top = MIOH + 38 + mid.top (combine last two)
// div bottom1 - Positioned comfortably after the mid_footer. bottom1.top = everything from mid_footer.top + comfortable space between the two
// div bottom2 - Same
// div bottom3 - Same
// div tbg -  Needs to be tall enough to encompass all other elements. MIOH + 42 + bottom.height(207) + 4
// div footer - Positioned after the tbg.

// Do I care about the window height? No, I dont think so.

function newDivs(div_id) {
	if (document.getElementById) {
		var midwithoutHeight = document.getElementById('mid_interior').offsetHeight;
		var middynamicHeight = document.getElementById(div_id).offsetHeight;
		var midinteriorHeight = (midwithoutHeight + middynamicHeight);
		if (midinteriorHeight > 0) {
			//place the divs we'll be working with into vars. We don't need to get mid_interior because we just need it's offset height.
			var midElement = document.getElementById('mid');
			var midfooterElement = document.getElementById('mid_footer');
			var tbgElement = document.getElementById('tbg');
			var footerElement = document.getElementById('footer');
			// work it!
			midElement.style.height = (midinteriorHeight) + 'px';
			midfooterElement.style.top = (midinteriorHeight) + 'px';
			tbgElement.style.height = (midinteriorHeight + 36) + 'px';
			footerElement.style.top = (midinteriorHeight + 287) + 'px';
		}
	}
}			