// Textarea Expander v1.2
// Copyright (C) 2005 Digital Routes, Scotland
// http://digitalroutes.co.uk/library
// This code is licensed under the GPL, see www.gnu.org for details.
// Automatically expands all textareas in a web page so that they
// are slightly longer than their contents (no vertical scrollbar)
// Include at the bottom of your page:
//
// Locate all the document's textareas.
// Adds "onkeypress='expand_soon()'" to each textarea.
// Existing onkeypress code is preserved.
function expand_init() {
expand_textareas = document.getElementsByTagName('TEXTAREA');
var ta;
for (var z=0;ztextarea.rows || (expand_contract && rows