function start_resize() {
	document.onmouseup = stop_resize;
	document.onblur = stop_resize;
	document.onmousemove = do_resize;
}

function stop_resize() {
	document.onmouseup = null;
	document.onblur = null;
	document.onmousemove = null;
	document.getElementById("message").focus();
}

function do_resize(event) {
	textarea = document.getElementById("message");

	if (!event) {
		event = window.event;
		scrollY = document.documentElement.scrollTop;
		posY = 11;
	} else {
		scrollY = window.pageYOffset;
		posY = 8;
	}

	obj = textarea;
	do {
		posY += obj.offsetTop;
	} while (obj = obj.offsetParent);

	height = event.clientY - posY + scrollY;
	if (height < 16) {
		height = 16;
	}
	textarea.style.height = height + "px";

	if (document.selection && document.selection.empty) {
		document.selection.empty();
	}
}

