(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<td class="back"><div class="left"></div></td>').appendTo(b),$td=$("td",this),curr=$("td.cur",this)[0];$td.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){/*move(curr)*/});$td.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){if(a == null)return;offsetWidth = 0;offsetLeft= 0;if(a != null){offsetWidth = a.offsetWidth;offsetLeft= a.offsetLeft;}$back.each(function(){$(this).dequeue()}).animate({width:offsetWidth,left:offsetLeft},o.speed,o.fx);curr=a};function move(a){offsetWidth = 0;offsetLeft= 0;if(a != null){offsetWidth = a.offsetWidth;offsetLeft= a.offsetLeft;}$back.each(function(){$(this).dequeue()}).animate({width:offsetWidth,left:offsetLeft},o.speed,o.fx)}})}})(jQuery);
