(function(b){var a={init:function(c){var d={url:"/Heartbeat.action",timer:600000}; this.options=b.extend(d,c); a._poke.apply(this); return this; },stop:function(){if(this.nextPoke){clearTimeout(this.nextPoke); }},_poke:function(){var c=this; this.nextPoke=setTimeout(function(){b.ajax({url:c.options.url,cache:false}); a._poke.apply(c); },c.options.timer); }}; b.fn.heartbeat=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1)); }else{if(typeof c==="object"||!c){return a.init.apply(this,arguments); }else{b.error("The method "+c+" doesn't exist in $.fn.hearbeat"); }}}; })(jQuery);