function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) 
field.value = field.value.substring(0, maxlimit);
else 
countfield.value = maxlimit - field.value.length;
}


function check(object,lin)	{
 text=centline(object,lin);
 len = text.length;
// text = text.substring(0,object.maxLength);

 var goodChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwwxyz 0123456789&=')(\"°,./-";
 goodChars=goodChars+(String.fromCharCode(160));
 
 for(var i=0; i<len; i++) {
  for(var j=0; j<goodChars.length; j++) {
   if(goodChars.charAt(j)==text.charAt(i)) {
    break;
   }
   else {
    if(j==(goodChars.length-1)) {
      alert( text.charAt(i)+"  \nNICHT erlaubt\nBitte um korrektur!");
 	text = text.substring(0,i)+text.substring(i+1,len--);
	i--;
    }
   } 
  }
 }
 object.value = text;
}

function centline(object,lin){
  txtset = document.getElementById("r"+lin);
  results = txtset.value;
  reptxt = /^\xA0*/igm;
  results = results.replace(reptxt, '');
  
  return(results);
}