(function(n){n.fn.togglebutton=function(t){var i=n(this),u=jQuery.extend({play:function(){playanim(i)},pause:function(){pauseanim(i)},updater:function(){Silder()},state:"off",interval:1e3},t||{}),r="";return i.children(".offstate").hide(),i.toggle(function(){i.children(".onstate").hide(),i.children(".offstate").show(),r=setInterval(u.updater,u.interval)},function(){i.children(".offstate").hide(),i.children(".onstate").show(),clearTimeout(r),r=""}),u.state=="on"&&i.toggle(),this.stop=function(){r!=""&&(clearTimeout(r),r="")},this}})(jQuery)
