/*  Fuzzy Background jQuery Plugin - v1.0
 *  Copyright 2011, Aron Carroll & Paul Ferguson
 *  Released under the MIT license
 *  More Information: http://github.com/aron/floodlight.js
 */
 (function(f,d,a){var e=f(a.body),g=f(d),b;function c(H,z,o){var B,D,w,G,A,h,v,p,n,l,k,r,E,t,s,m,u,j,F,C,i;B=H.width;D=B<<2;
 w=H.height;if(z){G=z.data;A;if(o<0){o=0}if(o>=2.5){A=0.98711*o-0.9633}else{if(o>=0.5){A=3.97156-4.14554*Math.sqrt(1-0.26891*o)
 }else{A=2*o*(3.97156-4.14554*Math.sqrt(1-0.26891*0.5))}}h=A*A;v=h*A;p=1.57825+(2.44413*A)+(1.4281*h)+(0.422205*v);n=((2.44413*A)+(2.85619*h)+(1.26661*v))/p;
 l=(-((1.4281*h)+(1.26661*v)))/p;k=(0.422205*v)/p;r=1-(n+l+k);for(E=0;E<3;E++){for(s=0;s<w;s++){m=s*D+E;u=s*D+((B-1)<<2)+E;
 j=G[m];F=j;C=F;i=C;for(;m<=u;m+=4){j=r*G[m]+n*F+l*C+k*i;G[m]=j;i=C;C=F;F=j}m=s*D+((B-1)<<2)+E;u=s*D+E;j=G[m];F=j;C=F;i=C;
 for(;m>=u;m-=4){j=r*G[m]+n*F+l*C+k*i;G[m]=j;i=C;C=F;F=j}}}for(E=0;E<3;E++){for(t=0;t<B;t++){m=(t<<2)+E;u=(w-1)*D+(t<<2)+E;
 j=G[m];F=j;C=F;i=C;for(;m<=u;m+=D){j=r*G[m]+n*F+l*C+k*i;G[m]=j;i=C;C=F;F=j}m=(w-1)*D+(t<<2)+E;u=(t<<2)+E;j=G[m];F=j;C=F;i=C;
 for(;m>=u;m-=D){j=r*G[m]+n*F+l*C+k*i;G[m]=j;i=C;C=F;F=j}}}return(z)}}f.fuzzyBackground=function(k,j){var i,h,l;k=(k instanceof f)?k.get(0):k;
 k=(typeof k==="string")?k:k.src;if(!k||!f.fuzzyBackground.supported()){return}h=a.createElement("canvas");i=h.getContext("2d");
 l=new Image();l.onload=function(){var m;h.height=l.height;h.width=l.width;i.drawImage(l,0,0);m=i.getImageData(0,0,h.width,h.height);
 m=c(h,m,j||15);i.putImageData(m,0,0);e.css({backgroundImage:"url("+h.toDataURL()+")",backgroundAttachment:"fixed"});f.fuzzyBackground._resize()
 };l.src=k;if(b!==true){g.resize(f.fuzzyBackground._resize);b=true}};f.fuzzyBackground._resize=function(){var h=g.width()+"px "+g.height()+"px";
 e.css({backgroundSize:h,MozBackgroundSize:h,WebkitBackgroundSize:h})};f.fuzzyBackground.supported=(function(){var h=a.createElement("canvas"),k=!!(h.getContext&&h.getContext("2d")),l=false,i=a.documentElement,j={};
 if(d.getComputedStyle){j=d.getComputedStyle(i,null)}else{if(i.currentStyle){j=i.currentStyle}}f.each(["backgroundSize","MozBackgroundSize","WebkitBackgroundSize"],function(){if(this in j){l=true
 }});return function(){return k&&l}})();f.fn.fuzzyBackground=function(h){f.fuzzyBackground(this[0],h);return this}})(jQuery,window,document);

