function textarea_init(A){if(!A.getAttribute("rows")){A.setAttribute("rows",5)}if(!A.getAttribute("cols")){A.setAttribute("cols",50)}if(!A.getAttribute("defaultRows")){A.setAttribute("defaultRows",A.rows)}if(!A.getAttribute("maxRows")){A.setAttribute("maxRows",Math.max(Math.floor(((window.innerHeight)?window.innerHeight:document.body.offsetHeight)/A.offsetHeight*A.rows),A.getAttribute("defaultRows")))}if(A.className&&A.className.indexOf("maxchars")!=-1){if(A.getAttribute("maxlength")&&!A.getAttribute("maxChars")){A.setAttribute("maxChars",A.getAttribute("maxlength"))}if(!A.getAttribute("maxChars")){A.setAttribute("maxChars",A.getAttribute("cols")*A.getAttribute("rows"))}var B=document.createElement("span");B.className="form_msg no_error";A.parentNode.insertBefore(B,A.nextSibling)}if(A.className&&A.className.indexOf("maxlines")!=-1){if(!A.getAttribute("maxLines")){A.setAttribute("maxLines",A.getAttribute("cols"))}var B=document.createElement("span");A.parentNode.insertBefore(B,A.nextSibling)}}function textarea_counter(A){if(A.getAttribute("maxlength")&&A.getAttribute("maxlength")<A.value.length){A.value=A.value.substring(0,A.getAttribute("maxlength"))}A.nextSibling.innerHTML="Zeichen: "+A.value.length+" von "+A.getAttribute("maxChars");A.nextSibling.style.color=(A.value.length>A.getAttribute("maxChars"))?"red":"black";A.nextSibling.className=(A.value.length>A.getAttribute("maxChars"))?"form_msg":"form_msg no_error"}function textarea_linecounter(A){A.nextSibling.innerHTML="Zeilen: "+A.rows+" von "+A.getAttribute("maxLines");A.nextSibling.style.color=(A.rows>A.getAttribute("maxLines"))?"red":"black"}function textarea_extend(A){if(!A.getAttribute("maxRows")){textarea_init(A)}var B=A.value.split("\n");var C=0;for(var D=0;D<B.length;++D){C=C+Math.floor(B[D].length/A.cols)+1}A.rows=Math.min(A.getAttribute("maxRows"),Math.max(A.getAttribute("defaultRows"),C+1));if(A.getAttribute("maxChars")){textarea_counter(A)}if(A.getAttribute("maxLines")){textarea_linecounter(A)}return(false)}function textarea_extend2(A){if(!A.getAttribute("maxRows")){textarea_init(A)}var B=A.value.split("\n");A.rows=Math.min(A.getAttribute("maxRows"),Math.max(A.getAttribute("defaultRows"),B.length+1));if(A.getAttribute("maxChars")){textarea_counter(A)}return(false)}function textarea_collapse(B,A){B.rows=A};
