// layout2.js
// Cross-Browser.com & SitePoint.com - Equal Column Height Demo (2 Column)

if (document.getElementById || document.all) { // minimum dhtml support required
  document.write("<"+"style type='text/css'>#sig{visibility:hidden;}<"+"/style>");
  xAddEventListener(window, 'load', winOnLoad, false);
}

function winOnLoad() {
	var ele = xGetElementById('maincontent_insides');
	if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
		adjustLayout();
		xAddEventListener(window, 'resize', winOnResize, false);
	}
}

function winOnResize() {
  adjustLayout();
}

function adjustLayout() {
	// Get content heights
	var cHeight = xHeight('maincontent_insides');

	// Find the maximum height
	var maxHeight = 537;
	if (cHeight+140 > 537) {
		maxHeight = cHeight+140;
	}
	
	// Assign maximum height to all columns
	xHeight('content_bucket', maxHeight);

	// Show the footer
	xGetElementById('sig').style.visibility = 'visible';
}
