/* dependencies: object.js */

function setBoxSize(boxid, width, height) {
	var box = checkForId(boxid);
	if ((box) && (box.style)) {
		if (height!=-1) {
			if (height=='auto') {
				box.style.height = height;
			} else {
				box.style.height = height + 'em';
			}
		}
		if (width!=-1) {
			if (width=='auto') {
				box.style.width = width;
			} else {
				box.style.width = width + 'em';
			}
		}
	}
}

function hideBox(boxid) {
	var box = checkForId(boxid);
	if ((box) && (box.style)) {
		box.style.height = '0px';
		box.style.overflow = 'hidden';
	}
}

function showBox(boxid) {
	var box = checkForId(boxid);
	if ((box) && (box.style)) {
		box.style.overflow = 'visible';
		box.style.height = 'auto';
	}
}

function switchBox(boxid) {
	var box = checkForId(boxid);
	if (box.style.height!='0px') {
		hideBox(boxid);
	} else {
		showBox(boxid);
	}
}
