function autosize_taff(textarea) {
var heightLimit = 600;
var dif = parseInt(textarea.scrollHeight) - parseInt(textarea.clientHeight);
if (dif>0){// +8 - äëÿ ÎÏÅÐÛ; dif>0 - ÷òîáû íå óìåíüøàë ïîëå, à òîëüêî ðàçäâèãàë
if (isNaN(parseInt(textarea.style.height))){
textareaHeight = textarea.scrollHeight*1 + 8;
}else{
textareaHeight = parseInt(textarea.style.height) + parseInt(dif)+8;
}
if (textareaHeight>heightLimit){
if (parseInt(textarea.clientHeight)<heightLimit) textarea.style.height = heightLimit+"px";
return;
}
textarea.style.height = textareaHeight+"px";
dif = parseInt(textarea.scrollHeight) - parseInt(textarea.clientHeight);
if ((dif+8)>0)textarea.style.height = parseInt(textarea.style.height) + parseInt(dif)+8+ "px";
}
}
 
function ctrlEnter(event, formElem) {
if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD))) {
formElem.submit();
}
}
