function onchange11(obj, intLen)

    obj.Value = TextCheck(obj,intLen * 2)

end function

function TextCheck(obj, intLen)

  dim intPC    '計算加入字長度
  dim strRet   '傳回字串
	dim l,t,c
	dim i
	l=len(obj.value)
	t=l
	for i=1 to l
		c=asc(mid(obj.value,i,1))
		intPC=intPC+1
		if c<0 then 
		  c=c+65536
		end if  
		if c>255 then
			intPC=intPC+1
		end if
		if intPC > intLen then exit for
				strRet = strRet & chr((c))		
	next
	TextCheck=strRet't

end function

function onkeypressa(obj, intLen)

	'obj.Value = TextCheck(obj,intLen)
	'msgbox window.event.keyCode

end function

