function check_length(my_form)
{
  maxLen = 300; // max number of characters allowed
  if (my_form.OPIS.value.length >= maxLen) {
    // Alert message if maximum limit is reached.
    // If required Alert can be removed.
    var msg = "Maksymalna dlugosc opisu to 300 znakow.";
    alert(msg);
    // Reached the Maximum length so trim the textarea
    my_form.OPIS.value = my_form.OPIS.value.substring(0, maxLen);
  }
  else{ // Maximum length not reached so update the value of my_text counter

  $('textarea_counter').innerHTML = (maxLen-1) - my_form.OPIS.value.length;}
  //my_form.text_num.value = maxLen - my_form.OPIS.value.length;}
}