/* 
	This function is used by text area that need to limit the input text.
	The function sets a counter control and truncates the text area if needed
*/

function textAreaCounter(field,cntfield,maxlimit) {
	//since netscape does not use the "\r" in CRLF, there 
	//is a workaround used here. Replace all "\n" with two
	//characters to get a count of characters (this allows 
	//netscape to count a CRLF as two chars like ie and opera. 
	//Replace the "\r" with empty string (this gives the correct char
	//count for ie and opera [2 for CRLF]).
	rExp = /\n/g;			
	rExp2 = /\r/g;
	str = field.value;
	str = str.replace(rExp, "XX");
	str = str.replace(rExp2, "");

	cntfield.value = maxlimit - str.length;	

}
