var pos = 1000;

function calc() {
   var b = document.translate.word.value;
   var a = document.translate.word.value.length;
   if (a > pos) {
     document.translate.count.value = 0;
	 document.translate.word.value = b.substring(0,1000);
   }
   else { document.translate.count.value = pos - a; }
   
   if (document.translate.count.value == 0) document.translate.s.disabled=true;
   else document.translate.s.disabled=false;
}

function chtxt(stxt) {
   if (stxt == "") { 
      alert("Пожалуйста, введите текст для перевода");
	  document.translate.word.focus();
	  return false;
   }
   return true;
}

function check() {
   if (!chtxt(document.translate.word.value)) {
    window.status.value = "!";
      return false;
   }
   return true;
}
