function img_autoproxy(){ var imgs = document.images; for(var i=0;i<imgs.length;i++){ imgs[i].onerror=function(){ if(this.src.indexOf('browse.php?u')==-1) this.src=myParseURL(this.src); } } }