function DrawImage(ImgD){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width>500){
		  ImgD.width=500;
		  ImgD.height=(image.height*500)/image.width;
		}
		/*
		if(image.width/image.height>= 500/400){
			if(image.width>500){
				ImgD.width=500;
				ImgD.height=(image.height*500)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
		else{
			if(image.height>400){
				ImgD.height=400;
				ImgD.width=(image.width*400)/image.height;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
		*/
	}
}

function ShowImagePopup(ImgD,flag){
var image=new Image();
image.src = ImgD.src;
var picurl = "";
  if(ImgD){
	if(ImgD.src){
      picurl = image.src;
      if(image.width>499){
        window.open(picurl);
      }else{
        alert('此图片为原始图片');
      }
	  //window.open(picurl,  'picpopup',  'height='+image.height+',width='+image.width+',top=200,left=200,toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no,status=no');
	}
  }
}

function ShowImageLayer(ImgD,flag){

 var imgLayer = document.all.toolTipLayer;
 imgLayer.style.display="";
 if(flag){
  if(ImgD){
	if(ImgD.src){
      imgLayer.innerHTML = "<img src='"+ ImgD.src +"' border=0>";
	}else{
	  imgLayer.innerHTML = "无大图";
	}
	imgLayer.style.left=200;//ImgD.offsetLeft;
	imgLayer.style.top=200;//ImgD.offsetTop;
  }else{}
 }else{
	imgLayer.style.display="none";
	imgLayer.style.left=1;
	imgLayer.style.top=1;
 }
 
}