var value = 0;
var nameObj = '';
var MaxLength = 160;



function setOpacity() {
   value += .3;
   var testObj = document.getElementById(nameObj);
   testObj.style.width = "100%";
   testObj.style.height = "100%";
   testObj.style.display = "block";
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
   myTimeout = setTimeout("setOpacity()", 50);
   
   if ((value/10) >= .9) {
      clearTimeout(myTimeout);
   }
}

function removeOpacity() {
   value -= .3;
   var testObj = document.getElementById(nameObj);
   
   myTimeout2 = setTimeout("removeOpacity()", 1);
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
   
   if ((value/10) <= 0) {
      testObj.style.display = "none";
      clearTimeout(myTimeout2);
   }
}

function DisplayLength(){
  if ( Send_Message.koment.value.length > MaxLength ) {
	Send_Message.koment.value = Send_Message.koment.value.substr( 0, MaxLength );
  }

  Send_Message.remainchars.value = MaxLength - Send_Message.koment.value.length;
}

function CheckLength(){
  event.returnValue = Send_Message.koment.value.length < MaxLength || document.selection.type != "None";
}




