jQuery.responsImg=function(n,t){var u,r,a,v,f,s,y,h,p,e,w,c,l,i,b,k,o;return r={allowDownsize:!1,elementQuery:!1,delay:200,breakpoints:null,considerDevice:!1},t&&jQuery.extend(r,t),o=jQuery(window),n=jQuery(n),i={},f=null,c=null,e=0,l=!1,p=function(){f=y(n);window.devicePixelRatio>=1.5&&(l=!0);i[0]=f==="IMG"?new Array(n.attr("src")):new Array(s(n));o.on("resize.responsImg orientationchange.responsImg",w);v()},s=function(n){var t;return t=n.css("background-image"),t=t.replace("url(",""),t.replace(")","")},y=function(n){return jQuery(n).prop("tagName")},v=function(){var e,h,o,f,t,c,s,l;o=n.data();c=/^responsimg/;for(f in o)if(l=o[f],c.test(f)){if(t=f.replace("responsimg",""),isNaN(t)){t=t.toLowerCase();s=r.breakpoints;for(e in s)h=s[e],t===e&&(t=h)}else t=parseInt(t,10);i[t]=l.replace(" ","").split(",")}u()},w=function(){clearTimeout(c);c=setTimeout(u,r.delay)},a=function(){var t,i,u;return t=null,r.elementQuery===!0?(t=n.width(),window.orientation!=null&&r.considerDevice&&(u=o.width(),i=h(),t=Math.ceil(i*t/u))):t=window.orientation!=null&&r.considerDevice?h():o.width(),t},h=function(){var n;return n=window.orientation===0?window.screen.width:window.screen.height,navigator.userAgent.indexOf("Android")>=0&&window.devicePixelRatio&&(n=n/window.devicePixelRatio),n},u=function(){var t,h,u,o,s,c;if(s=a(),t=0,e=0,h=!0,o="",s>e?e=s:r.allowDownsize===!1&&(h=!1),h===!0){for(u in i)c=i[u],parseInt(u,10)<=s&&parseInt(u,10)>=t&&(t=parseInt(u,10),o=i[t][0]);l===!0&&i[t][1]!=null&&(o=i[t][1]);f==="IMG"?k(n,o):b(n,o)}},k=function(n,t){var i;i=n.attr("src");t!==i&&n.attr("src",t)},b=function(n,t){var i;i=s(n);t!==i&&n.css("background-image","url("+t+")")},p(),this.recheck=function(){u()},this};jQuery.fn.responsImg=function(n){return this.each(function(){var t,i;t=jQuery(this);t.data("responsImg")===void 0&&(i=new jQuery.responsImg(this,n),t.data("responsImg",i))})}