// JavaScript Document


function ta_check(e){
		if(this.value.length>=this.getAttribute('maxlength')){
			this.value=this.value.substr(0,this.getAttribute('maxlength'));
			this.readOnly=true;
		}
		if(e.keyCode==8 || e.keyCode==46)
			this.readOnly=null;
	}

window.onload=function(){
	ta=document.getElementsByTagName('textarea');
	for(i in ta){
		if(ta[i].tagName!='TEXTAREA' || !ta[i].getAttribute('maxlength'))
			continue;
		ta[i].onkeydown=ta_check;
		ta[i].onkeyup=ta_check;
		ta[i].onkeypress=ta_check;
	}
}
