
// JavaScript Document - only for new browsers - sets the dockable nav into a usuable position

/* Stack up window.onload event using this function from Simon Willison - http://www.sitepoint.com/blog-post-view.php?id=171578 */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
/* addLoadEvent events */
addLoadEvent(adjustLayout);
addLoadEvent(eventListener);


/*****************************************
CSS Positioning Helper Script Ensures
Left, Center and Right Columns
are resized to same height
******************************************/
function adjustLayout() {
	// Get natural heights
	var lHeight = xHeight("leftcol");
	var rHeight = xHeight("rightcol");

	// Find the maximum height
	var maxHeight = Math.max(lHeight, rHeight);
  
	// Assign maximum height to all columns
	xHeight("leftcol", maxHeight);
	xHeight("rightcol", maxHeight);
  
	// Show the footer
	xShow("pagefooter");
}
function eventListener() {
	xAddEventListener(window, "resize", adjustLayout, false);
}