
/**
 * Assign a resize handler function to the browser window.
 * Parameters:
 * 	theHandler - a pointer to the handler function.  Should have the 
 *		following prototype:
 *		handler_func( evt )
 *			evt will be null for IE (use global event) object
 */
function setResizeHandler( theHandler )
{
	if( typeof window.addEventListener != "undefined" )
	{	// NN6
		window.addEventListener( "resize", theHandler, false );
	}
	else if( typeof window.onresize != "undefined" )
	{	// IE
		window.onresize = theHandler;
	}
}	// setResizeHandler



/**
 * Get the height of the element (in pixels)
 */

/* function getElementHeight( theElem )
{
	return theElem.offsetHeight;
}*/

function getElementHeight( theElem )
{
	return theElem.offsetHeight;
}


function minMainHeight( theElem )
{
	var h =  getElementHeight(theElem);
	return (h < 500) ? 500 : h;
}


function doResize()
{
	var maincontentHeight = minMainHeight( document.getElementById('maincontent')) - 2;
	document.getElementById('sidebar_links').style.height = (maincontentHeight + "px");
}


function onLoadInit()
{
	doResize();
	setResizeHandler( doResize );
}

