<!--
var flag=false;
function DrawImage(ImgD,dx){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 1){
if(image.width>dx){ 
ImgD.width=dx;
ImgD.height=(image.height*dx)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(dx<250 && image.height>dx){ 
ImgD.height=dx;
ImgD.width=(image.width*dx)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
if(dx>250 && image.width>dx){ 
ImgD.style.cursor="hand",ImgD.alt="点击查看原图！",ImgD.onclick=function(){window.open(ImgD.src)}
}
}


var imageObject;
function ResizeImage(obj, MaxW, MaxH)
{
    if (obj != null) imageObject = obj;
    var state=imageObject.readyState;
	if(state!='complete') {
        setTimeout("ResizeImage(null,"+MaxW+","+MaxH+")",50);
		return;
    }
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW=oldImage.width; var dH=oldImage.height;
    if(dW>MaxW || dH>MaxH) {
        a=dW/MaxW;
        if(MaxH>0){b=dH/MaxH;}else{b=1;}
        if(b>a) a=b;
        dW=dW/a; dH=dH/a;
        if(oldImage.width>MaxW && MaxH==0){imageObject.style.cursor="pointer",imageObject.alt="点击查看原图！",imageObject.onclick=function(){window.open(oldImage.src)}}
    }
    if(dW > 0 && dH > 0) {
        imageObject.width=dW;
		imageObject.height=dH;
	}
}

//-->