function writeLeave(formElement,objShow,maxl)
{if(getStringLen(formElement.value,1)>maxl)
{formElement.value=cutString(formElement.value,maxl,1);try
{objShow.value=0;}catch(e){}
try
{objShow.innerHTML=0;}catch(e){}}
else
{try
{objShow.value=maxl-getStringLen(formElement.value,1);}catch(e){}
try
{objShow.innerHTML=maxl-getStringLen(formElement.value,1);}catch(e){}}}
function cutString(str,cutLentth,gbkLen)
{return str.substring(0,cutLentth);}
function getStringLen(str,gbkLen)
{str=ltrim(str);if(2==gbkLen)
{str=str.replace(/[^\x00-\xff]/g,"**");}
return str.length;}
function trim(str)
{return str.replace(/(^\s*)|(\s*$)/g,"");}
function ltrim(str)
{return str.replace(/(^\s*)/g,"");}
function rtrim(str)
{return str.replace(/(\s*$)/g,"");}
