(function(c){var b="maxWidth" in document.documentElement.style,d=!-[1,]&&!("prototype" in Image)&&b;c.fn.autoIMG=function(){var e=this.width();return this.find("img").each(function(g,f){if(b){return f.style.maxWidth=e+"px"}var h=f.src;f.style.display="none";f.removeAttribute("src");a(h,function(j,i){if(j>e){i=e/j*i,j=e;f.style.width=j+"px";f.style.height=i+"px"}f.style.display="";f.setAttribute("src",h)})})};d&&(function(g,f,e){e=f.createElement("style");f.getElementsByTagName("head")[0].appendChild(e);e.styleSheet&&(e.styleSheet.cssText+=g)||e.appendChild(f.createTextNode(g))})("img {-ms-interpolation-mode:bicubic}",document);var a=(function(){var h=[],g=null,f=function(){var j=0;for(;j<h.length;j++){h[j].end?h.splice(j--,1):h[j]()}!h.length&&e()},e=function(){clearInterval(g);g=null};return function(j,p,q,o){var l,k,r,n,i,m=new Image();m.src=j;if(m.complete){p(m.width,m.height);q&&q(m.width,m.height);return}k=m.width;r=m.height;l=function(){n=m.width;i=m.height;if(n!==k||i!==r||n*i>1024){p(n,i);l.end=true}};l();m.onerror=function(){o&&o();l.end=true;m=m.onload=m.onerror=null};m.onload=function(){q&&q(m.width,m.height);!l.end&&l();m=m.onload=m.onerror=null};if(!l.end){h.push(l);if(g===null){g=setInterval(f,40)}}}})()})(jQuery);