/*按比例生成缩略图*/
<!-- 
var flag=false; 
function DrawImage(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= w/h){ 
if(image.width>w){ 
ImgD.width=w; 
ImgD.height=(image.height*w)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
else{ 
if(image.height>h){ 
ImgD.height=h; 
ImgD.width=(image.width*h)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
} 
} 
//-->

function img_auto_size(oldimg,maxSize,openNewWindow){
	var newimg = new Image();
	newimg.src = oldimg.src;
	if (newimg.width > 0 && newimg.height > 0) {
		if (newimg.width > maxSize){ 
			oldimg.width = maxSize;
			oldimg.height = (newimg.height * maxSize) / newimg.width;
			oldimg.onmouseover = function() {
				this.style.cursor= "hand";
			};
			oldimg.onmouseout = function() {
				this.style.cursor="";
			};
			if(openNewWindow){
				oldimg.onclick = function() {
					window.open(this.src, '_blank');
				};
			}
			//oldimg.alt = "点击查看原始大小 " + newimg.width + " x " + newimg.height;
		} else {
			oldimg.width = newimg.width; 
			oldimg.height = newimg.height;
			
		}
		
	}
} 

<!--//弹出窗口
function OpenPD(evnt,obj,w,h) 
{
    var evnt=window.event || evnt;
    evnt.returnValue=false;
    var isFF=!document.all;
    var width=w; 
    var height=h;
    return OpenWin(obj.href,width,height);
}

function OpenWin(url,w,h)
{
    var left=(screen.width-w)/2;
    var top=(screen.height-h)/2;
    window.open(url,"","width="+w+",height="+h+",top="+top+",left="+left+",toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no");
    return false;
}
//-->

