// jquery.autoimg.js - 2010-04-02 - tang bin - http://planeart.cn/ - mit licensed (function(a){var _="maxwidth"in document.documentelement.style,$=!-[1,]&&!("prototype"in image)&&_;a.fn.autoimg=function(){var $=this.width();return this.find("img").each(function(d,a){if(_)return a.style.maxwidth=$+"px";var c=a.src;a.style.display="none";a.removeattribute("src");b(c,function(b,_){if(b>$){_=$/b*_,b=$;a.style.width=b+"px";a.style.height=_+"px"}a.style.display="";a.setattribute("src",c)})})};$&&(function(a,$,_){_=$.createelement("style");$.getelementsbytagname("head")[0].appendchild(_);_.stylesheet&&(_.stylesheet.csstext+=a)||_.appendchild($.createtextnode(a))})("img {-ms-interpolation-mode:bicubic}",document);var b=(function(){var b=[],a=null,_=function(){var _=0;for(;_1024){j(h,$);d.end=true}};d();g.onerror=function(){e&&e();d.end=true;g=g.onload=g.onerror=null};g.onload=function(){i&&i(g.width,g.height);!d.end&&d();g=g.onload=g.onerror=null};if(!d.end){b.push(d);if(a===null)a=setinterval(_,40)}}})()})(jquery)