window.onerror = function(){return true;} function imagezoom(img,width,height) { var image=new image(); image.src=img.src; if(image.width>width||image.height>height) { w=image.width/width; h=image.height/height; if(w>h) { img.width=width; img.height=image.height/w; } else { img.height=height; img.width=image.width/h; } } }