var flag=false;
//widthMax 和 heightMax 参数不能同时 大于 0
function DrawImage(ImgD,iWidth,iHeight,widthMax,heightMax){
   var image = new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
		flag=true;
		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;
			 ImgD.alt = "本站图片";
		}
		else{
			 if(image.height>iHeight){  
				 ImgD.height=iHeight;
				 ImgD.width=(image.width*iWidth)/image.height;     
			 }
			 else{
				 ImgD.width=image.width;  
				 ImgD.height=image.height;
			 }
			 //ImgD.alt=image.width+"×"+image.height;
			 ImgD.alt = "本站图片";
		}
	}
	if(widthMax>0){
		if(widthMax<image.width){
			ImgD.width = widthMax;
			ImgD.height = widthMax*image.height/image.width;
		}
	}
	if(heightMax>0){
		if(heightMax<image.height){
			ImgD.width = heightMax*image.width/image.height;
			ImgD.height = heightMax;
		}
	}
} 

function submitChange(strFrm,strURL){
		document.all[strFrm].action = strURL
		document.all[strFrm].submit();
	}
