// Foggy, v1.1 // // Description: jQuery plugin for blurring page elements // Homepage: http://nbartlomiej.github.com/foggy // Author: nbartlomiej@gmail.com (function(a){a.fn.foggy=function(b){var c={opacity:.8,blurRadius:2,quality:16,cssFilterSupport:true};var d={opacity:1,blurRadius:0};var e;if(b==false){e=a.extend(c,d)}else{e=a.extend(c,b)}var f=function(a,b,c,d){this.content=a;this.position=b;this.offset=c;this.opacity=d};f.prototype.render=function(b){a("
",{html:this.content,"class":"foggy-pass-"+this.position}).css({position:this.position,opacity:this.opacity,top:this.offset[0],left:this.offset[1]}).appendTo(b)};var g=function(a){this.radius=a};g.prototype.includes=function(a,b){if(Math.pow(a,2)+Math.pow(b,2)<=Math.pow(this.radius,2)){return true}else{return false}};g.prototype.points=function(){var a=[];for(var b=-this.radius;b<=this.radius;b++){for(var c=-this.radius;c<=this.radius;c++){if(this.includes(b,c)){a.push([b,c])}}}return a};var h=function(a,b){this.element=a;this.settings=b};h.prototype.calculateOffsets=function(b,c){var d=a.grep((new g(b)).points(),function(a){return a[0]!=0||a[1]!=0});var e;if(d.length<=c){e=d}else{var f=d.length-c;var h=[];for(var i=0;i