﻿(function($){var currentRadius,multiplier;function parseOptions(a){return {RADIUS:a.radius||20,DURATION:a.duration||500,TEXT_COLOR:a.textColor||"#fff",HALO_COLOR:a.haloColor||"#777"}}function currentRadius(a){if(prop=a.style["text-shadow"])return parseInt(prop.match(/0 0 (\d+)px/));else return 0}function stepTextShadow(a){if(a.state==0)a.start=currentRadius(a.elem);updatedRadius=a.end.begin?parseInt(a.end.radius*a.pos):parseInt(a.end.radius-a.end.radius*a.pos);if(a.end.begin||a.state<1)$(a.elem).css("text-shadow",a.end.color+" 0 0 "+updatedRadius+"px");else $(a.elem).css("text-shadow",$(a.elem).data("glow.originalGlow"))}function addGlow(opts){var opts=parseOptions(opts||{});function startGlow(){$(this).stop().animate({color:opts.TEXT_COLOR,textShadow:{begin:true,color:opts.HALO_COLOR,radius:opts.RADIUS}},opts.DURATION)}function startFade(){$(this).stop().animate({color:$(this).data("glow.originColor"),textShadow:{begin:false,color:opts.HALO_COLOR,radius:opts.RADIUS}},opts.DURATION)}with($(this)){bind("mouseenter",startGlow);bind("mouseleave",startFade);data("glow.originColor",css("color"));data("glow.originalGlow",css("text-shadow")||"none")}return this}$.fx.step["textShadow"]=stepTextShadow;$.fn.addGlow=addGlow})(jQuery)
