function resizeImages(){

   maxSize = 150;
 
  for (x=0;x<document.images.length;x++){
      iHeight = document.images[x].height;
      iWidth = document.images[x].width;
 
      if (iHeight > iWidth){
         sizeGuide = iHeight;
        size2 = iWidth;
     }else{
        sizeGuide = iWidth;
         size2 = iHeight;
      }
 

      if (sizeGuide > maxSize){
 
        sizeRatio = sizeGuide / size2;
        newSize1 = maxSize;
         newSize2 = newSize1 / sizeRatio;
 
        if (iHeight > iWidth){
            document.images[x].height = newSize1;
            document.images[x].width = newSize2;
         }else{
            document.images[x].width = newSize1;
            document.images[x].height = newSize2;
         }
 

 

     }
 
 
   }
 
 }