<!--
var topBarHeight    = 50; /* Height of the top bar image (plus some padding) */
var bottomBarHeight = 50; /* Height of the bottom bar image (plus some padding) */

function adaptWorkbenchHeight(minPageHeight) {
	var iClientAreaHeight = getClientAreaHeight();
	var dDiv = document.getElementById('workbench');

	if (iClientAreaHeight >= minPageHeight)
	{
		dDiv.style.height = iClientAreaHeight+'px';
	}
	else
	{
		dDiv.style.height = minPageHeight+'px';
	}
}

function adaptWorkbenchWidth(minPageWidth) {
	var iClientAreaWidth = getClientAreaWidth();
	var dDiv = document.getElementById('workbench');

	if (iClientAreaWidth >= minPageWidth)
	{
		dDiv.style.width = iClientAreaWidth+'px';
	}
	else
	{
		dDiv.style.width = minPageWidth+'px';
	}
}

function adaptWorkbenchSize(minContentWidth, minContentHeight) {
	adaptWorkbenchHeight(minContentHeight+topBarHeight+bottomBarHeight);
	adaptWorkbenchWidth(minContentWidth)
}

function centerWorkareaVerticallyIfPossible(iContentHeight, verticalPadding) {
	var iClientAreaHeight = getClientAreaHeight();
	var iArea = document.getElementById('workarea');

	/* If all elements still fit into page, center them */
	if ((iClientAreaHeight-(iContentHeight+topBarHeight+bottomBarHeight))/2 > 0)
	{
		/* Position is relative to workbench */
		iArea.style.top = (iClientAreaHeight-(iContentHeight+verticalPadding))/2+'px';
	}
	else
	{
		iArea.style.top = topBarHeight+'px';
		iArea.height = iContentHeight+'px';
	}
}

function adaptCopyPos(minPageWidth, minContentHeight) {
	var iClientAreaHeight = getClientAreaHeight();
	var iClientAreaWidth = getClientAreaWidth();
	var iCopy = document.getElementById('copyright');
	var iImg = document.getElementById('copyimage');
	
	var minPageHeight = minContentHeight+topBarHeight+bottomBarHeight; /* Add size of top/bottom bars */

	/* Put immediately over the bottom bar */
	if (iClientAreaHeight >= minPageHeight)
	{
		iCopy.style.top = iClientAreaHeight-bottomBarHeight-iImg.height+'px';
	}
	else
	{
		iCopy.style.top = minPageHeight-bottomBarHeight-iImg.height+'px';
	}

	/* Center Horizontally */
	if (iClientAreaWidth >= minPageWidth)
	{
		iCopy.style.left = (iClientAreaWidth-iImg.width)/2+'px';
	}
	else
	{
		iCopy.style.left = (minPageWidth-iImg.width)/2+'px';
	}
}
//-->