(function($){$.fn.hoverpulse=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).hoverpulse(options);});}return this;}var opts=$.extend({},$.fn.hoverpulse.defaults,options);this.parent().css({position:"relative"});this.css({position:"absolute",top:0,left:0});this.each(function(){var $this=$(this);var w=$this.width(),h=$this.height();w=$(this).css("width");h=$(this).css("height");$this.data("hoverpulse.size",{w:parseInt(w),h:parseInt(h)});});return this.hover(function(){var $this=$(this);$this.parent().css("z-index",opts.zIndexActive);var size=$this.data("hoverpulse.size");var w=size.w,h=size.h;$this.stop().animate({top:("-"+opts.size+"px"),left:("-"+opts.size+"px"),height:(h+2*opts.size)+"px",width:(w+2*opts.size)+"px"},opts.speed);},function(){var $this=$(this);var size=$this.data("hoverpulse.size");var w=size.w,h=size.h;$this.stop().animate({top:0,left:0,height:(h+"px"),width:(w+"px")},opts.speed,function(){$this.parent().css("z-index",opts.zIndexNormal);});});};$.fn.hoverpulse.defaults={size:8,speed:150,zIndexActive:100,zIndexNormal:1};})(jQuery);
