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