//把全角转化为半角
function ChangeCode(fm)
{
	temp=repl("，",", ",fm.value)
	temp=repl("。",". ",temp)
	temp=repl("“",' "',temp)
	temp=repl("”",'" ',temp)
	temp=repl("／","/",temp)
	temp=repl("‘","'",temp)
	temp=repl("’","'",temp)
	temp=repl("（"," (",temp)
	temp=repl("）",") ",temp)
	temp=repl("＊","*",temp)
	temp=repl("＋","+",temp)
	temp=repl("－","-",temp)
	temp=repl("；","; ",temp)
	temp=repl("：",": ",temp)
	temp=repl("［","[",temp)
	temp=repl("］","]",temp)
	temp=repl("｛","{",temp)
	temp=repl("｝","}",temp)
	temp=repl("！","! ",temp)
	temp=repl("％","%",temp)
	temp=repl("＃","#",temp)
	temp=repl("￥","$",temp)
	temp=repl("…","..",temp)
	temp=repl("—","--",temp)
	temp=repl("＝","=",temp)
	temp=repl("．",".",temp)
	for(var i=0;i<26;i++)
	{
		temp=repl(unescape("%uff"+hex(33+i)),unescape("%"+hex(65+i)),temp);
		temp=repl(unescape("%uff"+hex(65+i)),unescape("%"+hex(97+i)),temp);
	}
	for(var i=0;i<10;i++)
	{
		temp=repl(unescape("%uff"+hex(16+i)),unescape("%"+hex(48+i)),temp);
	}
	fm.value   =   temp; 
}

function hex(d){
	h1=Math.round(d/16-0.5)
	h2=d-h1*16
	return ""+d2h(h1)+d2h(h2)
}

function d2h(d){
	if(d>9) h=unescape("%"+(d-10+41))
	else h=""+d
	return h
}
function repl(str1,str2,tmp){
	result=""
	fmLen=tmp.length
	if(fmLen=0) {  
 		return '';
	}
	strEnd=tmp.indexOf(str1)
	str1Len=str1.length
	i=0
	while(strEnd>=0){
  		i++
  		result = result + tmp.substring(0,strEnd)+str2
  		tmp=tmp.substring(strEnd+str1Len,tmp.length)
  		strEnd=tmp.indexOf(str1)
	}
	result=result+tmp;
	return result;
}//把全角转化为半角方法结束