// The HTML text box increases the number of rows as you type
// Created: 16.3.2008
// Author: Rok Stritar

function resize_textarea(textarea_id){
	cols=$(textarea_id).cols;

	new_line=0;
	myArray=$(textarea_id).value;

	//for (i=0;i<myArray.length;i++)
	//{
	//if (myArray[i] == "\n")
	//{
	//new_line++;
	//}
	//}
	new_line =
myArray.replace(/[^\r\n]/g, '').replace(/(\r\n|\r|\n)/g, '#').length

	str_lenght=myArray.length;

	rows=(str_lenght/cols)+new_line+2;

	
	$(textarea_id).rows=rows;
	
};

	

