  var MAX_WIDTH = 590 , MAX_HEIGHT = 600;
  
  function resizeImage( ptrImage )
  {
   while( ptrImage.width > MAX_WIDTH || ptrImage.height > MAX_HEIGHT ) {
    ptrImage.width -= 10;
   }
   
   ptrImage.style.visibility = "visible";
  }   
    
