(function(c){c.fn.noisy=function(b){var b=c.extend({},c.fn.noisy.defaults,b),d,h,a=!1;try{h=!0,a=localStorage.getItem(window.JSON.stringify(b))}catch(l){h=!1}if(a)d=a;else{a=document.createElement("canvas");if(a.getContext){a.width=a.height=b.size;for(var i=a.getContext("2d"),e=i.createImageData(a.width,a.height),j=Math.round(b.intensity*Math.pow(b.size,2)),k=255*b.opacity;j--;){var f=~~(Math.random()*a.width),g=~~(Math.random()*a.height),f=4*(f+g*e.width),g=j%255;e.data[f]=g;e.data[f+1]=b.monochrome?
g:~~(255*Math.random());e.data[f+2]=b.monochrome?g:~~(255*Math.random());e.data[f+3]=~~(Math.random()*k)}i.putImageData(e,0,0);d=a.toDataURL("image/png");if(0!=d.indexOf("data:image/png")||c.browser.msie&&9>c.browser.version.substr(0,1)&&32768<d.length)d=b.fallback}else d=b.fallback;window.JSON&&h&&localStorage.setItem(window.JSON.stringify(b),d)}return this.each(function(){c(this).css("background-image","url('"+d+"'),"+c(this).css("background-image"))})};c.fn.noisy.defaults={intensity:0.9,size:200,
opacity:0.08,fallback:"",monochrome:!1}})(jQuery);
