<!--
//图片缩略图效果
function DrawImage(ImgD,FitWidth,FitHeight){
    var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
if(image.width/image.height>= FitWidth/FitHeight){
if(image.width>FitWidth){
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}else{
if(image.height>FitHeight){
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
} 
}
}
//图片高小于设定的边框高时，让图片上下居中 padding 为内边距
if(ImgD.height < FitHeight ){
var paddH = parseInt((FitHeight - ImgD.height)/2);
ImgD.style.paddingTop    = paddH+"px";
ImgD.style.paddingBottom = paddH+"px";
}
//图片宽小于设定的边框宽时，让图片左右居中 padding 为内边距
if(ImgD.width < FitWidth ){
var paddW = parseInt((FitWidth - ImgD.width)/2);
ImgD.style.paddingRight = paddW+"px";
ImgD.style.paddingLeft  = paddW+"px";
}
 }
//-->
