// JavaScript Document
function CtoH(obj)
{ 
var str=obj.value;
var result="";
for (var i = 0; i < str.length; i++)
{
if (str.charCodeAt(i)==12288)
{
result+= String.fromCharCode(str.charCodeAt(i)-12256);
continue;
}
if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375)
result+= String.fromCharCode(str.charCodeAt(i)-65248);
else result+= String.fromCharCode(str.charCodeAt(i));
} 
result=result.replace('*','x')
obj.value=result;
} 
function fucCheckNUM(NUM)
{
 var i,j,strTemp;
 strTemp="0123456789";
 if ( NUM.length== 0)
  return 0
	 for (i=0;i<NUM.length;i++)
	 {
	  j=strTemp.indexOf(NUM.charAt(i)); 
		  if (j==-1)
		  {
		  //说明有字符不是数字
		   return 0;
		  }
	 }
} 

function resizeimg(ImgD,iwidth,iheight) { 
     var image=new Image(); 
     image.src=ImgD.src; 
     if(image.width>0 && image.height>0){ 
        if(image.width/image.height>= iwidth/iheight){ 
           if(image.width>iwidth){ 
               ImgD.width=iwidth; 
               ImgD.height=(image.height*iwidth)/image.width; 
           }else{ 
                  ImgD.width=image.width; 
                  ImgD.height=image.height; 
                } 
               ImgD.alt=image.width+"×"+image.height; 
        } 
        else{ 
                if(image.height>iheight){ 
                       ImgD.height=iheight; 
                       ImgD.width=(image.width*iheight)/image.height; 
                }else{ 
                        ImgD.width=image.width; 
                        ImgD.height=image.height; 
                     } 
                ImgD.alt=image.width+"×"+image.height; 
            } 
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针 
　　　　　//ImgD.onclick = function() { window.open(this.src);} //点击打开大图片 
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE 
　　　　　　ImgD.title = "用鼠标滚轮可缩放图片或点击图片放大欣赏"; 
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放 
　　　　　 { 
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100; 
　　　　　　　　　　zoom += event.wheelDelta / 12; 
　　　　　　　　　　if (zoom> 0)　this.style.zoom = zoom + "%"; 
　　　　　　　　　　return false; 
　　　　　 } 
　　　  } else { //如果不是IE 
　　　　　　　     ImgD.title = "用鼠标滚轮可缩放图片或点击图片放大欣赏"; 
　　　　　　   } 
    } 
}
