ReSize Imgs (AutoScale)

javascript:
(function(){
  var img=document.getElementsByTagName('img');
  var MaxWidth=window.outerWidth*0.75;
  var MaxHeight=800;
  for(i=0;i<img.length;i++){
    var HeightWidth=img[i].offsetHeight/img[i].offsetWidth;
    var WidthHeight=img[i].offsetWidth/img[i].offsetHeight;
    if(img[i].offsetWidth>MaxWidth){
      img[i].width=MaxWidth;
      img[i].height=MaxWidth*HeightWidth;
    }
    if(img[i].offsetHeight>MaxHeight){
      img[i].height=MaxHeight;
      img[i].width=MaxHeight*WidthHeight;
    }
  }
}
)()

ReSize Imgs (AutoScale)