function getByid(id) {
  if (document.getElementById) {
    return document.getElementById(id);
  } else if (document.all) {
    return document.all[id];
  } else if (document.layers) {
    return document.layers[id];
  } else {
    return null;
  }
}
function ResizeImages(objID,maxwidth) {
  var imgs = getByid(objID).getElementsByTagName('img');
  var oldwidth="";
  for (i=0; i<imgs.length; i++) {
    oldwidth = imgs[i].width;
	oldheight = imgs[i].height;
    if(oldwidth > maxwidth) {
		imgs[i].width = maxwidth;
		imgs[i].height =  (oldheight/oldwidth)*imgs[i].width;
    }
  }
}
