function resizeimg(ImgD, iwidth, iheight) {
    var image = new Image();
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) {

        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.style.cursor = "pointer"; //改变鼠标指针
    ImgD.onclick = function () { window.open(this.src); } //点击打开大图片 
}