/**************************** 
* 功能：把字符串中的全角->半角
* 参数说明: 
*   ---- str:要转换的字符串 
* 返回值类型：字符串 
****************************/

function DBC2SBC(str)
{
     var i;
     var result='';
	 if (str.length<=0) {return "";}
	 for(i=0;i<str.length;i++) 
	 {
		 code=str.charCodeAt(i);
		 if(code>=65281&&code<65373)	    // “65281”是“！”，“65373”是“｝”
		 {   
			   result+=String.fromCharCode(code-65248);  // “65248”是转换码距
		 }
		 else
		 {
			 result+=str.charAt(i);
		 }
	 }
     return result;
}
