function sizEm() {

imgmax=300; 

for(i=1;i<document.images.length;i++){
if(document.images[i].name=='sizem'){
imgw = document.images[i].width;
imgh = document.images[i].height; 
if((imgw > imgmax) && (imgw > imgh)){
document.images[i].width=imgmax;
}else if(imgh > imgmax) {document.images[i].height = imgmax;}
}}}
