function ImageAutoResize(ed,oz,oy){ImageAutoResizeFromTo(ed,ed,oz,oy)};function ImageAutoResizeFromTo(fx,lf,oz,oy){var pa,ox,rb,pv;if(typeof fx!='object')return;if(!has_object_property(fx,'height'))return;if((fx.height>0)&&(fx.width>0)){pa=fx.height;ox=fx.width;if(pa>oz||ox>oy){if(pa/ox<oz/oy){pv=oy;rb=pa*oy/ox;}else{rb=oz;pv=ox*oz/pa;};lf.height=rb;lf.width=pv;}else{lf.height=pa;lf.width=ox;};};};function has_object_property(ed,nb){for(var c in ed)if(c==nb)return true;return false};
