// JavaScript Document
function imagesize(img , w , h){
    
   if(img.width > w){
	   img.width = w;
	   img.height =  parseInt(img.height * img.width/w);
   }
   
   if(img.height > h){
	   img.width = parseInt(img.width * img.height / h);
	   img.height = h;
   }
 }