// JavaScript Document
//***********************************
// 函数名: DrawImage
// 作  用: 缩放图片比例
// 参  数: ImgD:图片项,Imgwidth:设定宽度,Imgheight:设定高度
// 返回值: 无
// oncontextmenu=self.event.returnValue=false onselectstart="return false" 
//***********************************
function DrawImage(ImgD,Imgwidth,Imgheight){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    if(image.width/image.height>= Imgwidth/Imgheight){
		 if(image.width>Imgwidth){  
			 ImgD.width=Imgwidth;
			 ImgD.height=(image.height*Imgwidth)/image.width;
		 }
		 else{
			 ImgD.width=image.width;  
			 ImgD.height=image.height;
		 }
		 ImgD.alt=image.width+"×"+image.height;

     }
    else{
		 if(image.height>Imgheight){  
			 ImgD.height=Imgheight;
			 ImgD.width=(image.width*Imgheight)/image.height;     
		 }
		 else{
			 ImgD.width=image.width;  
			 ImgD.height=image.height;
		 }

		 ImgD.alt=image.width+"×"+image.height;
     }
    }
   else{
		ImgD.src="";
		ImgD.alt=""
    }
   } 