function CharacterCount(ctl,len,type,labelid)
{
   var lengthtyped = 0;
   var remainingcount = 0;
   if (type == 1)
   {
        lengthtyped = ctl.value.length;
   }
   else
   {   
        lengthtyped = objdoc(ctl).value.length;
   }   
   maxlength = len;
   remainingcount = maxlength - lengthtyped;
   doUpdateHtml(objdoc(labelid), " "+remainingcount);
   //if (lengthtyped >= maxlength)
   //     alert ("Character limit exceeded.");
}
