﻿function changesize()
{
      var imgwidth;
      var imgheight;
      var imgObj = new Image();               
      var tempwidth;
      var tempheight;
      var rate;
	  var Maximgwidth;
	  var Maximgheight;
	  Maximgwidth = 125;
	  Maximgheight = 96
      imgObj.src = document.getElementById('pictures').src;    
      imgwidth = imgObj.width;     
      imgheight = imgObj.height;  
      tempwidth = Maximgwidth - imgwidth;
      tempheight = Maximgheight - imgheight;
      
      if(tempwidth < tempheight) 
          rate = Maximgwidth / imgwidth ; 
      else 
          rate = Maximgheight / imgheight;
       
     document.all("pictures").width = imgwidth * rate;  
     document.all("pictures").height = imgheight * rate; 
}    
