
	function growableFieldUpdateHeight(inputfield, event, minheight)
	{
		if (inputfield != null)
		{
//			var height = parseInt(inputfield.scrollHeight);
			if (minheight == undefined)
			{
				minheight = 18;
			}
//			while (height == parseInt(inputfield.scrollHeight))
//			{
//				height--;
//				if (height >= 0)
//				{
//					inputfield.style.height = "" + height + "px";
//				}
//			}
			inputfield.style.height = "" + minheight + "px";
			height = parseInt(inputfield.scrollHeight);
			if (height < minheight)
			{
				height = minheight;
			}
			inputfield.style.height = "" + height + "px";

			if (event)
			{
				ctrlPressed = event.ctrlKey;
				
				if (ctrlPressed)
				{
					key = null;
				    if(typeof(event.which) == 'number')
				    {
				        //NS 4, NS 6+, Mozilla 0.9+, Opera
				        key = event.which;
				    }
					else if(typeof(event.keyCode) == 'number')
					{
				        //IE, NS 6+, Mozilla 0.9+
				        key = event.keyCode;
				    }
				    else if(typeof(event.charCode) == 'number')
				    {
				        //also NS 6+, Mozilla 0.9+
				        key = event.charCode;
				    }
				    
				    if (key && key == 13)
				    {
				    	if (inputfield.form)
				    	{
				    		inputfield.form.submit();
				    	}
				    }
				}
			}
		}
	}

	function growableFieldLimitText(inputfield, limit)
	{
		if (inputfield)
		{
			if (inputfield.value.length > limit)
			{
				inputfield.value = inputfield.value.substring(0, limit);
			}
		}
	}
	
	function growableFieldStripEnter(inputfield)
	{
		if (inputfield)
		{
			var str = inputfield.value.replace(/\n/g, "").replace(/\r/g, "");
			if (inputfield.value != str)
			{
				inputfield.value = str;
			}
		}
	}

