function  reSizeImage(ImgObj, reWidth, reHeight){
	reWidth = reWidth || 300; reHeight=reHeight || 260;
	var image=new  Image(); image.src=ImgObj.src;
	if(image.width>0 && image.height>0){
		if(image.width / image.height >=  reWidth / reHeight){
			if(image.width > reWidth){
				ImgObj.width  = reWidth;
				ImgObj.height = (image.height * reWidth) / image.width;
			}else{
				 ImgObj.width = image.width;
				 ImgObj.height= image.height;
			}
        }else{
			if(image.height > reHeight){
				ImgObj.height =reHeight;
				ImgObj.width  =(image.width*reHeight) / image.height;
				}else{
					ImgObj.width  =image.width;
					ImgObj.height =image.height;
			}
		}
	}
}
