function DrawImage(img,size){ 
var image=new Image(); 
image.src=img.src; 
	if(image.width>0 && image.height>0)
	{
	  if(image.width>size)
	  {
	  	rate=image.height/image.width;
	  	newHeight=rate*size;
	  	img.width=size;
	  	img.height=newHeight;
	  } 
	}
	if(img.height>size)
	{
		rate=image.width/image.height;
		newWidth=rate*size;
		img.height=size;
		img.width=newWidth;
	}
}
var show=true;